![]() |
Dynamixel
2.9.5
RoadNarrows Robotics Dynamixel Package
|
#include <dynashell_recording.h>
Public Member Functions | |
| DynaRecording () | |
| Default constructor. | |
| virtual | ~DynaRecording () |
| Default destructor. | |
| virtual void | Init (int nSamplePeriod, const char *sDate=NULL) |
| (Re)Initialize recording. More... | |
| virtual int | FirstRecord () |
| Get the first record number in the recording. More... | |
| virtual int | NextRecord (int nRecNum) |
| Get the next record number in the recording after the given record number. More... | |
| virtual int | AddRecord () |
| Add a new empty record to the recording. More... | |
| virtual int | CopyRecord (int nRecNumDst, int nRecNumSrc) |
| Copy source record to destination record. More... | |
| virtual int | FirstField (int nRecNum) |
| Get the first field number in the given record. More... | |
| virtual int | NextField (int nRecNum, int nFldNum) |
| Get the next field number in the record after the given field number. More... | |
| virtual int | AddFieldTuple (int nRecNum, int nServoId, int nPos, int nSpeed) |
| Add new recording field tuple. More... | |
| virtual const DynaRecord::FieldTuple_T & | GetField (const int nRecNum, const int nFldNum) const |
| Get the given recorded field tuple. More... | |
| virtual int | GetNumOfRecords () |
| Get the number of records in the recording. More... | |
| virtual int | GetNumOfServosInRecording () |
| Get the number of servos in the recording. More... | |
| virtual int | RegisterServoInfo (int nServoId, uint_t uModelNum) |
| Register servo information in recording header. More... | |
| virtual const int | GetServoId (int nFldNum) |
| Get the servo id associated with the given field number. More... | |
| virtual bool | HasServoAt (int nFldNum, int nServoId) const |
| Check if the given servo is associated with the given field number, as per the ordering of the registered servos in the recording header. More... | |
| virtual bool | HasServo (int nServoId) |
| Check if the given servo is in the list of registered servos in the recording header. More... | |
| virtual uint_t | GetServoModelNumber (int nServoId) |
| Get the registered servo model number. More... | |
| virtual int | GetSamplePeriod () const |
| Get the sample period of the recording. More... | |
| virtual int | SetSamplePeriod (int nSamplePeriod) |
| Set the sample period of the recording. More... | |
| virtual const char * | GetDate () const |
| Get the recording data. More... | |
| virtual void | SetDate (const char *sDate) |
| DynaRecord const & | operator[] (const int nRecNum) const |
| Subscript operator. More... | |
Static Public Attributes | |
| static const int | MaxRecords = 5000 |
| maximum number of records | |
| static const int | END = -1 |
| past-the-end mark | |
Protected Types | |
| typedef vector< ServoInfo_T > | VecServoInfo |
| Map of record servos ids and model numbers indexed by field number. | |
| typedef map< int, int > | MapIIdx |
| Indirect indexing by servo id of servo info map. | |
Protected Attributes | |
| char * | m_sDate |
| recording date | |
| VecServoInfo | m_vecServoInfo |
| vector of recorded servo information | |
| MapIIdx | m_mapIIdx |
| indirect index map | |
| int | m_nSamplePeriod |
| recording sample period (ms) | |
| int | m_nRecordCnt |
| number of records recorded | |
| DynaRecord | m_record [MaxRecords] |
| the recording data | |
Dynamixel recording. The recording is usually made by a training session, but does not have to be.
Definition at line 186 of file dynashell_recording.h.
|
virtual |
Add new recording field tuple.
The field position must match the registered servo position listed in the header.
| nRecNum | Record number. |
| nServoId | Servo id of field tuple data. |
| nPos | Servo position. |
| nSpeed | Servo speed. |
Definition at line 208 of file dynashell_recording.cxx.
Referenced by DynaShellCmdLoadRecording::ParseRecordedData(), and DynaShellCmdTrain::RecordTraining().
|
virtual |
Add a new empty record to the recording.
Definition at line 176 of file dynashell_recording.cxx.
Referenced by DynaShellCmdLoadRecording::ParseRecordedData(), and DynaShellCmdTrain::RecordTraining().
|
inlinevirtual |
Copy source record to destination record.
| nRecNumDst | Destination record number. |
| nRecNumSrc | Source record number. |
Definition at line 256 of file dynashell_recording.h.
References DYNA_ECODE_BAD_VAL, and DYNA_OK.
|
inlinevirtual |
Get the first field number in the given record.
| nRecNum | Record number. |
Definition at line 278 of file dynashell_recording.h.
Referenced by DynaShellCmdPlay::ControlToGoals(), DynaShellCmdSaveRecording::Save(), and DynaShellCmdPlay::SetRecordGoals().
|
inlinevirtual |
Get the first record number in the recording.
Definition at line 220 of file dynashell_recording.h.
Referenced by DynaShellCmdPlay::Play(), and DynaShellCmdSaveRecording::Save().
|
inlinevirtual |
Get the recording data.
Definition at line 457 of file dynashell_recording.h.
Referenced by DynaShellCmdLoadRecording::Load(), DynaShellCmdPlay::Play(), DynaShellCmdPlay::PlotInit(), and DynaShellCmdSaveRecording::Save().
|
inlinevirtual |
Get the given recorded field tuple.
| nRecNum | Record number. |
| nFldNum | Field number. |
Definition at line 327 of file dynashell_recording.h.
References DynaRecord::NoField.
Referenced by DynaShellCmdSaveRecording::Save(), and DynaShellCmdPlay::SetRecordGoals().
|
inlinevirtual |
Get the number of records in the recording.
Number of records.
Definition at line 346 of file dynashell_recording.h.
Referenced by DynaShellCmdPlay::ControlToGoals(), DynaShellCmdSaveRecording::Exec(), DynaShellCmdPlay::Exec(), DynaShellCmdLoadRecording::Load(), DynaShellCmdPlay::Play(), DynaShellCmdPlay::PlotInit(), and DynaShellCmdSaveRecording::Save().
|
inlinevirtual |
Get the number of servos in the recording.
The number of servos is the count of registered servos in the recording header.
Definition at line 359 of file dynashell_recording.h.
Referenced by DynaShellCmdPlay::Exec(), DynaShellCmdLoadRecording::Load(), and DynaShellCmdSaveRecording::Save().
|
inlinevirtual |
Get the sample period of the recording.
Definition at line 433 of file dynashell_recording.h.
Referenced by DynaShellCmdPlay::ControlToGoals(), DynaShellCmdLoadRecording::Load(), DynaShellCmdPlay::PlotInit(), and DynaShellCmdSaveRecording::Save().
|
inlinevirtual |
Get the servo id associated with the given field number.
Definition at line 372 of file dynashell_recording.h.
References DYNA_ID_NONE.
Referenced by DynaShellCmdPlay::ControlToGoals(), DynaShellCmdLoadRecording::ParseRecordedData(), DynaShellCmdSaveRecording::Save(), and DynaShellCmdPlay::SetRecordGoals().
|
inlinevirtual |
Get the registered servo model number.
| nServoid | Servo Id. |
Definition at line 414 of file dynashell_recording.h.
References DYNA_MODEL_NUM_GENERIC.
Referenced by DynaShellCmdPlay::Exec(), and DynaShellCmdSaveRecording::Save().
|
inlinevirtual |
Check if the given servo is in the list of registered servos in the recording header.
| nServoid | Servo Id. |
Definition at line 401 of file dynashell_recording.h.
Referenced by DynaShellCmdPlay::Exec().
|
inlinevirtual |
Check if the given servo is associated with the given field number, as per the ordering of the registered servos in the recording header.
| nFldNum | Field number. |
| nServoid | Servo Id. |
Definition at line 387 of file dynashell_recording.h.
|
virtual |
(Re)Initialize recording.
Any previously recorded data is 'erased'.
| nSamplePeriod | Recording sample period (msec). |
| sData | Recording date string. |
Definition at line 147 of file dynashell_recording.cxx.
Referenced by DynaShell::RecordingInit().
|
inlinevirtual |
Get the next field number in the record after the given field number.
| nRecNum | Record number. |
| nFldNum | Field number. |
Definition at line 302 of file dynashell_recording.h.
Referenced by DynaShellCmdPlay::ControlToGoals(), DynaShellCmdSaveRecording::Save(), and DynaShellCmdPlay::SetRecordGoals().
|
inlinevirtual |
Get the next record number in the recording after the given record number.
| nRecNum | Record number. |
Definition at line 236 of file dynashell_recording.h.
Referenced by DynaShellCmdPlay::Play(), and DynaShellCmdSaveRecording::Save().
|
inline |
Subscript operator.
| nRecNum | Record number subscript. |
Definition at line 471 of file dynashell_recording.h.
|
virtual |
Register servo information in recording header.
| nServoId | Servo Id. |
| uModelNum | Servo model number. |
Definition at line 254 of file dynashell_recording.cxx.
References DYNA_ECODE_BAD_VAL, DYNA_ECODE_RSRC, DYNA_ID_NUMOF, DYNA_OK, ServoInfo_T::m_nServoId, and ServoInfo_T::m_uModelNum.
Referenced by DynaShellCmdTrain::Exec(), and DynaShellCmdLoadRecording::ParseServoList().
|
virtual |
Set recording date string.
| sData | Recording date string. If NULL, then the current local time and date are used. |
Definition at line 283 of file dynashell_recording.cxx.
References DELOBJ, and newstr().
Referenced by DynaShellCmdLoadRecording::SetDateField().
|
inlinevirtual |
Set the sample period of the recording.
| nSamplePeriod | Sample period in milliseconds. |
Definition at line 443 of file dynashell_recording.h.
Referenced by DynaShellCmdLoadRecording::Load().