| Trees | Indices | Help |
|---|
|
|
Concrete class PoseRecorder
Provides a convenient interface for 'poseable programming' by allowing positions of servos to be recorded and played back.
Convenience methods for saving and loading .csv files are also provided
For typical usage, see the source code for recordFromCluster()
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
Initialize the PoseRecorder to record a list of modules INPUT: mods -- sequence of modules with .get_pos(), .set_pos() and .go_slack() methods
|
Add the first pose at the end of the recording, with specified delay. This allows loops to be cleanly repeated. INPUT: dt -- float -- delay in seconds between last and first pose |
Write the current recording out on a stream in a text-based format INPUT: stream -- output stream object. Must support .write() delim -- str -- delimiter user between columns fmt -- str -- format string for numbers (except time) hfmt -- str -- format string for column headings rdel -- str -- row delimiter slc -- slice -- range of pose sequence to show |
append a recording from a textual representation
INPUT:
stream -- list -- a recording with one line per list entry
-- file -- a file containing a recording
cdel -- str -- column delimiter
dt -- float -- gap in time between last entry and newly loaded data
Caveats:
(1) columns must match the list of servos for which the
PoseRecorder was configured.
(2) the first (header) row of the file is ignored
Example: load froma literal multiline string
>>> pr.appendFrom('''
0, 1000, 0, 1000
1, 0, 1000, 0
'''.split("
"))
|
Syntactic sugar for using .show() to write a .csv formatted recording
INPUT:
stream -- a file object or a file path. The '.csv' will be added if missing
Typical usage:
pr.saveCSV('motion.csv')
|
Play back the current recording one or more times.
INPUT:
period -- float / None -- duration for entire recording
if period is None, the recording timestamps are used
count -- integer -- number of times to play
rate -- float -- delay between commands sent (sec)
|
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Thu Jan 4 16:46:17 2018 | http://epydoc.sourceforge.net |