AnimatLab  2
Test
RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo Class Reference
+ Inheritance diagram for RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo:
+ Collaboration diagram for RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo:

Public Member Functions

virtual bool dxl_read_block (int id, int address, int length, std::vector< int > &aryData)
 Reads an entire block of data from a dynamixel servo. This is used to allow us to read back a number of params at one time instead of having to seperate them into different packets. More...
 
virtual std::string GetCommStatus (int CommStatus)
 
virtual float * GetDataPointer (const std::string &strDataType)
 Returns a float pointer to a data item of interest in this object. More...
 
virtual std::string GetErrorCode ()
 Checks the error code and returns an associated error message. More...
 
virtual Simulator * GetSimulator ()
 
virtual bool IncludeInPartsCycle ()
 
virtual void Initialize ()
 Initializes this object. More...
 
virtual void IOComponentID (int iID)
 
virtual bool IsMotorControl ()
 Returns true if this part interface is for controlling a motor. More...
 
virtual void Load (StdUtils::CStdXml &oXml)
 
virtual void MicroSleep (unsigned int iTime)
 
virtual float QuantizeServoPosition (float fltPos)
 If this is a servo controller interface then it will take a continuous positon and return back a valid quantized position for that servo. More...
 
virtual float QuantizeServoVelocity (float fltVel)
 If this is a servo controller interface then it will take a continuous velocity and return back a valid quantized velocity for that servo. More...
 
virtual void QueryProperties (CStdPtrArray< TypeProperty > &aryProperties)
 
virtual void ReadAllParams ()
 Reads all major data parameters from the servo in one read packet. This include present position, speed, load, temperature, and voltage. It sets the corresponding internal variables. More...
 
virtual void ReadKeyParams ()
 Reads only the key data parameters from the servo in one read packet. This include present position and speed. It sets the corresponding internal variables. More...
 
virtual void ResetSimulation ()
 Resets the simulation back to time 0. More...
 
virtual bool SetData (const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
 Set a variable based on a string data type name. More...
 
virtual void SetupIO ()
 This method is called after all connections to whatever control board have been made. It is meant to be used to setup connection information specific to this part. For example, We connect to a Firmata microcontroller like an Arduino, and then do a setup that could take some time. We should not attempt to setup any of the pins until after the board itself has been setup. After that we need to loop through and setup all the parts. That is what this method is for. More...
 
virtual void ShutdownIO ()
 This method is called just before the IO thread is closed down. It gives the IO objects a chance to do any required cleanup. More...
 
virtual void StepIO (int iPartIdx)
 This method is used to send/recieve the actual IO. This will often be in a seperate thread than the StepSimulation. StepSimulation gets/sets the values in the sim and gets it read for the thread that does the IO. Once that thread is ready to send/receive it uses that value to perform the operation. More...
 
virtual void StepSimulation ()
 
virtual void UpdateAllParamsCount (int iVal)
 
virtual int UpdateAllParamsCount ()
 
virtual void UpdateQueueIndex (int iVal)
 
virtual int UpdateQueueIndex ()
 
- Public Member Functions inherited from AnimatSim::Robotics::RobotPartInterface
virtual bool Changed ()
 
virtual void Changed (bool bVal)
 
virtual GainGetGain ()
 Gets the poitner to the gain function. More...
 
virtual int IOComponentID ()
 
virtual float IOScaledValue ()
 
virtual void IOScaledValue (float fltVal)
 
virtual float IOValue ()
 
virtual void IOValue (float fltVal)
 
virtual int IOValueInt ()
 
virtual void IOValueInt (int iVal)
 
virtual void LinkedPartID (std::string strID)
 
virtual std::string LinkedPartID ()
 
virtual void Load (CStdXml &oXml)
 
virtual void ParentIOControl (RobotIOControl *lpParent)
 
virtual RobotIOControlParentIOControl ()
 
virtual void PropertyName (std::string strName)
 
virtual std::string PropertyName ()
 
virtual void QueryProperties (CStdPtrArray< TypeProperty > &aryProperties)
 Queries this object for a list of properties that can be changed using SetData. More...
 
virtual void SetGain (Gain *lpGain)
 
virtual float StepIODuration ()
 Gets the time duration required to perform one step of the IO for this part. More...
 
- Public Member Functions inherited from AnimatSim::AnimatBase
 AnimatBase ()
 Constructs an AnimatBase object. More...
 
virtual ~AnimatBase ()
 Destroys the AnimatBase object.. More...
 
virtual bool AddItem (const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false)
 Adds a new object to this parent. More...
 
virtual void AfterResetSimulation ()
 Called after a simulation reset for some objects. More...
 
virtual long CalculateSnapshotByteSize ()
 Calculates the snapshot byte size. More...
 
virtual void Copy (CStdSerialize *lpSource)
 
virtual void Enabled (bool bVal)
 Tells whether this item is enabled or not. This is not actually used for all objects, only specific ones. I am putting it in the base class though to prevent numerous duplications. More...
 
virtual bool Enabled ()
 Tells whether this item is enabled or not. This is not actually used for all objects, only specific ones. I am putting it in the base class though to prevent numerous duplications. More...
 
virtual NeuralModuleGetNeuralModule ()
 Gets the neural module. More...
 
virtual NodeGetNode ()
 Gets the node. More...
 
virtual StructureGetStructure ()
 Gets the structure for this node. More...
 
virtual bool HasProperty (const std::string &strName)
 Queries this object if it has a property with the given name. More...
 
virtual std::string ID ()
 Gets the unique GUID ID of this object. More...
 
virtual void ID (std::string strValue)
 Sets the unique GUID ID of the object. More...
 
virtual void Kill (bool bState=true)
 Kills. More...
 
virtual void LoadKeyFrameSnapshot (byte *aryBytes, long &lIndex)
 Loads a key frame snapshot. More...
 
virtual std::string Name ()
 Gets the name of this object. More...
 
virtual void Name (std::string strValue)
 Sets the name of the object. Blank is acceptable. More...
 
virtual AnimatPropertyType PropertyType (const std::string &strName)
 
virtual void ReInitialize ()
 Re-initialize this object. More...
 
virtual bool RemoveItem (const std::string &strItemType, const std::string &strID, bool bThrowError=true)
 Removes a child item from this parent. More...
 
virtual void Reset ()
 Resets this object. More...
 
virtual void RigidBodyAdded (std::string strID)
 
virtual void RigidBodyRemoved (std::string strID)
 
virtual void SaveKeyFrameSnapshot (byte *aryBytes, long &lIndex)
 Saves a key frame snapshot. More...
 
virtual bool Selected ()
 Tells if this items is selected or not. More...
 
virtual void Selected (bool bValue, bool bSelectMultiple)
 Selects this object. More...
 
virtual bool SetData (const std::string &strDataType, const float fltValue, bool bThrowError=true)
 Set a variable based on a string data type name. More...
 
virtual bool SetData (const std::string &strDataType, const long lValue, bool bThrowError=true)
 Set a variable based on a string data type name. More...
 
virtual void SetSystemPointers (Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
 Sets the system pointers. More...
 
virtual void SimPausing ()
 Called just before the simulation pauses. More...
 
virtual void SimStarting ()
 Called just before the simulation starts. More...
 
virtual void SimStopping ()
 Called just before the simulation stops. More...
 
virtual void TimeStepModified ()
 Notification method that the time step modified has been modified. Objects should recalculate any slice times as needed. More...
 
virtual std::string Type ()
 returns the string type name of this object. More...
 
virtual void Type (std::string strValue)
 Sets the class type for this object. More...
 
virtual void VerifySystemPointers ()
 Verify that system pointers have been set correctly. More...
 
virtual void VisualSelectionModeChanged (int iNewMode)
 Visual selection mode changed. More...
 
- Public Member Functions inherited from RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo
virtual void CCWComplianceMargin (int iVal)
 
virtual int CCWComplianceMargin ()
 
virtual void CCWComplianceSlope (int iVal)
 
virtual int CCWComplianceSlope ()
 
virtual int ConvertFloatVelocity (float fltVelocity)
 Gets the fixed point velocity form the floating point. More...
 
virtual float ConvertFPLoad (int iLoad)
 Gets the floating point value of the servo load. The fixed point value is retrieved from the servo and then converted. More...
 
virtual float ConvertFPVelocity (int iVel)
 Gets the floating point value of the servo actual velocity. The fixed point value is retrieved from the servo and then converted to rad/s. More...
 
virtual int ConvertPosFloatToFP (float fltPos)
 
virtual float ConvertPosFPToFloat (int iPos)
 
virtual void CWComplianceMargin (int iVal)
 
virtual int CWComplianceMargin ()
 
virtual void CWComplianceSlope (int iVal)
 
virtual int CWComplianceSlope ()
 
virtual float GetActualLoad ()
 Gets the floating point value of the servo actual torque. The fixed point value is retrieved from the servo and then converted to Nm. More...
 
virtual int GetActualLoad_FP ()
 Gets the fixed point value of the servo actual load. This is the exact value returned from the servo. More...
 
virtual float GetActualPosition ()
 Gets the floating point value of the servo actual position. The fixed point value is retrieved from the servo and then converted to radians. More...
 
virtual int GetActualPosition_FP ()
 Gets the fixed point value of the servo actual position. This is the exact value returned from the servo. More...
 
virtual float GetActualTemperatureCelcius ()
 Gets the floating point value of the servo actual temperature. The fixed point value is retrieved from the servo and then converted to celcius. More...
 
virtual float GetActualTemperatureFahrenheit ()
 Gets the floating point value of the servo actual temperature. The fixed point value is retrieved from the servo and then converted to fahrenheit. More...
 
virtual float GetActualVelocity ()
 Gets the floating point value of the servo actual velocity. The fixed point value is retrieved from the servo and then converted to rad/s. More...
 
virtual int GetActualVelocity_FP ()
 Gets the fixed point value of the servo actual velocity. This is the exact value returned from the servo. More...
 
virtual float GetActualVoltage ()
 Gets the floating point value of the servo actual voltage. The fixed point value is retrieved from the servo and then converted to V. More...
 
virtual int GetActualVoltage_FP ()
 Gets the fixed point value of the servo actual voltage. This is the exact value returned from the servo. More...
 
virtual float GetCCWAngleLimit ()
 Gets the limit for the CCW limit of the servo in radian values. More...
 
virtual int GetCCWAngleLimit_FP ()
 Gets the limit for the CCW limit of the servo in fixed point value. More...
 
virtual int GetCCWComplianceMargin_FP ()
 
virtual int GetCCWComplianceSlope_FP ()
 
virtual float GetCWAngleLimit ()
 Gets the limit for the CW limit of the servo in radian values. More...
 
virtual int GetCWAngleLimit_FP ()
 Gets the limit for the CW limit of the servo in fixed point value. More...
 
virtual int GetCWComplianceMargin_FP ()
 
virtual int GetCWComplianceSlope_FP ()
 
virtual int GetFirmwareVersion ()
 Returns whether the servo firmware version number. More...
 
virtual float GetGoalPosition ()
 Gets the floating point value of the servo goal position. The fixed point value is retrieved from the servo and then converted to radians. More...
 
virtual int GetGoalPosition_FP ()
 Gets the fixed point value of the servo goal position. This is the exact value returned from the servo. More...
 
virtual float GetGoalVelocity ()
 Gets the floating point value of the servo velocity. The fixed point value is retrieved from the servo and then converted to rad/s. More...
 
virtual int GetGoalVelocity_FP ()
 Gets the fixed point value of the servo velocity. This is the exact value returned from the servo. More...
 
virtual int GetIDNumber ()
 Returns whether the servo ID number. More...
 
virtual bool GetIsAlarmShutdown ()
 Returns whether the alarm shutdown state is active. More...
 
virtual void GetIsLEDOn (bool &bIsBlueOn, bool &bIsGreenOn, bool &bIsRedOn)
 Returns whether the servo blue led is currently on. More...
 
virtual bool GetIsMoving ()
 Returns whether the servo is currently moving or has already reached its goal state. More...
 
virtual float GetMaxSimPos ()
 Gets the maximum position in radians that the simulation will allow for the joint. More...
 
virtual int GetMaxSimPos_FP ()
 Gets the maximum position in fixed point that the simulation will allow for the joint. More...
 
virtual int GetMaxTorque_FP ()
 
virtual float GetMinSimPos ()
 Gets the minimum position in radians that the simulation will allow for the joint. More...
 
virtual int GetMinSimPos_FP ()
 Gets the minimum position in fixed point that the simulation will allow for the joint. More...
 
virtual int GetModelNumber ()
 Returns whether the model number of the servo. More...
 
virtual float GetPresentLoad ()
 
virtual float GetPresentPosition ()
 
virtual float GetPresentTemperature ()
 
virtual float GetPresentVelocity ()
 
virtual float GetPresentVoltage ()
 
virtual int GetReturnDelayTime_FP ()
 Gets the return delay time of the servo. More...
 
virtual int GetTorqueLimit_FP ()
 Gets the torque limit of the servo in fixed point value. More...
 
virtual void InitMotorData ()
 Initializes the internal data on position and velocity from the actual motor. More...
 
virtual int LastGoalPosition_FP ()
 Gets the last goal position that was sent to the servo. This is used so we can see the last value we set without having to requery it from the servo. More...
 
virtual int LastGoalVelocity_FP ()
 Gets the last goal velocity that was sent to the servo. This is used so we can see the last value we set without having to requery it from the servo. More...
 
virtual void MaxAngle (float fltVal)
 
virtual float MaxAngle ()
 
virtual void MaxLoadFP (int iVal)
 
virtual int MaxLoadFP ()
 
virtual void MaxPosFP (int iVal)
 
virtual int MaxPosFP ()
 
virtual void MaxTorque (int iVal)
 
virtual int MaxTorque ()
 
virtual void MaxVelocityFP (int iVal)
 
virtual int MaxVelocityFP ()
 
virtual void MinAngle (float fltVal)
 
virtual float MinAngle ()
 
virtual void MinLoadFP (int iVal)
 
virtual int MinLoadFP ()
 
virtual void MinPosFP (int iVal)
 
virtual int MinPosFP ()
 
virtual void MinVelocityFP (int iVal)
 
virtual int MinVelocityFP ()
 
virtual void Move (float fltPos, float fltVel)
 Moves the motor to the specified position at the given speed. More...
 
virtual void QueryMotorData (bool bVal)
 
virtual bool QueryMotorData ()
 
virtual bool ResetToStartPos ()
 
virtual void ResetToStartPos (bool bVal)
 
virtual void RPMPerFPUnit (float fltVal)
 
virtual float RPMPerFPUnit ()
 
virtual void ServoID (int iID)
 Sets the ID that will be used for communications with this servo. This is NOT writing an ID to the servo. It is just specifying which one to use for com access. More...
 
virtual int ServoID ()
 Gets the servo ID being used for communications. More...
 
virtual void SetCCWAngleLimit (float fltLimit)
 Sets the limit for the CCW limit of the servo using radians. More...
 
virtual void SetCCWAngleLimit_FP (int iVal)
 Sets the limit for the CCW limit of the servo using fixed point value. More...
 
virtual void SetCCWComplianceMargin_FP (int iVal)
 
virtual void SetCCWComplianceSlope_FP (int iVal)
 
virtual void SetCWAngleLimit (float fltLimit)
 Sets the limit for the CW limit of the servo using radians. More...
 
virtual void SetCWAngleLimit_FP (int iVal)
 Sets the limit for the CW limit of the servo using fixed point value. More...
 
virtual void SetCWComplianceMargin_FP (int iVal)
 
virtual void SetCWComplianceSlope_FP (int iVal)
 
virtual void SetGoalPosition (float fltPos)
 Sets the floating point value of the servo goal position. This is the position in radians. It will be converted to a fixed point value based on the motor configuration and then used to set the position. This method assumes that center value is 0 and that it uses +/- values on either side. More...
 
virtual void SetGoalPosition_FP (int iPos)
 Sets the fixed point value of the servo goal position. This is the exact value that will be sent to the servo. More...
 
virtual void SetGoalVelocity (float fltVelocity)
 Sets the floating point value of the servo velocity. This is the velocity in rad/s. It will be converted to a fixed point value based on the motor configuration and then used to set the velocity. More...
 
virtual void SetGoalVelocity_FP (int iVelocity)
 Sets the fixed point value of the servo velocity. This is the exact value that will be sent to the servo. This method excludes the velocity of 0 which defaults it to move at its fastest speed. If you want to do that then use the SetMaximumVelocity method. More...
 
virtual void SetMaximumVelocity ()
 Sets the servo goal speed to 0 for maximum velocity. More...
 
virtual void SetMaxSimPos (float fltVal)
 Sets the maximum position that the simulation will allow for this joint in radians. More...
 
virtual void SetMaxTorque_FP (int iVal)
 
virtual void SetMinSimPos (float fltVal)
 Sets the minimum position that the simulation will allow for this joint in radians. More...
 
virtual void SetNextGoalPosition (float fltPos)
 Sets the floating point value of the servo goal position that will be used the next time the iO for this servo is processed. This is the position in radians. It will be converted to a fixed point value based on the motor configuration and then used to set the position. This method assumes that center value is 0 and that it uses +/- values on either side. More...
 
virtual void SetNextGoalPosition_FP (int iPos)
 Sets the fixed point value of the servo goal position that will be used the next time the IO for this servo is processed. This is the exact value that will be sent to the servo. More...
 
virtual void SetNextGoalVelocity (float fltVelocity)
 Sets the floating point value of the servo velocity the next time the IO for this servo is processed. This is the velocity in rad/s. It will be converted to a fixed point value based on the motor configuration and then used to set the velocity. More...
 
virtual void SetNextGoalVelocity_FP (int iVelocity)
 Sets the fixed point value of the servo velocity for the next time the IO for this servo is processed. More...
 
virtual void SetNextMaximumVelocity ()
 Sets the servo goal speed to 0 for maximum velocity the next time the IO for this servo is processed. More...
 
virtual void SetReturnDelayTime_FP (int iVal)
 Sets the return delay time of the servo. More...
 
virtual void SetTorqueLimit_FP (int iVal)
 Sets the torque limit of the servo using fixed point value. More...
 
virtual void ShutdownMotor ()
 Shuts the motor down cleanly and ensures that it is not continuing to move after processing has stopped. More...
 
virtual void Stop ()
 Attempts to stop the motor at its current position. More...
 
virtual float TranslationRange ()
 Gets the the total range of translation for a prismatic joint (meters). More...
 
virtual void TranslationRange (float fltVal)
 Sets the total range for translation of a prismatic joint. More...
 
virtual void WaitForMoveToFinish ()
 

Protected Member Functions

virtual void AddMotorUpdate (int iPos, int iSpeed)
 
virtual int GetRegister (unsigned char reg, unsigned char length)
 
virtual int ReadAlarmShutdown (int iServoID)
 
virtual int ReadCCWAngleLimit (int iServoID)
 
virtual int ReadCCWComplianceMargin (int iServoID)
 
virtual int ReadCCWComplianceSlope (int iServoID)
 
virtual int ReadCWAngleLimit (int iServoID)
 
virtual int ReadCWComplianceMargin (int iServoID)
 
virtual int ReadCWComplianceSlope (int iServoID)
 
virtual int ReadFirmwareVersion (int iServoID)
 
virtual int ReadGoalPosition (int iServoID)
 
virtual int ReadID (int iServoID)
 
virtual int ReadIsMoving (int iServoID)
 
virtual int ReadLED (int iServoID)
 
virtual int ReadMaxTorque (int iServoID)
 
virtual int ReadModelNumber (int iServoID)
 
virtual int ReadMovingSpeed (int iServoID)
 
virtual int ReadPresentLoad (int iServoID)
 
virtual int ReadPresentPosition (int iServoID)
 
virtual int ReadPresentSpeed (int iServoID)
 
virtual int ReadPresentTemperature (int iServoID)
 
virtual int ReadPresentVoltage (int iServoID)
 
virtual int ReadReturnDelayTime (int iServoID)
 
virtual int ReadTorqueLimit (int iServoID)
 
virtual void SetRegister (unsigned char reg, unsigned char length, unsigned int value)
 
virtual void WriteCCWAngleLimit (int iServoID, int iVal)
 
virtual void WriteCCWComplianceMargin (int iServoID, int iVal)
 
virtual void WriteCCWComplianceSlope (int iServoID, int iVal)
 
virtual void WriteCWAngleLimit (int iServoID, int iVal)
 
virtual void WriteCWComplianceMargin (int iServoID, int iVal)
 
virtual void WriteCWComplianceSlope (int iServoID, int iVal)
 
virtual void WriteGoalPosition (int iServoID, int iPos)
 
virtual void WriteMaxTorque (int iServoID, int iVal)
 
virtual void WriteMovingSpeed (int iServoID, int iVelocity)
 
virtual void WriteReturnDelayTime (int iServoID, int iVal)
 
virtual void WriteTorqueLimit (int iServoID, int iVal)
 
- Protected Member Functions inherited from AnimatSim::Robotics::RobotPartInterface
virtual void AddGain (std::string strXml)
 Creates and adds a gain object. More...
 
- Protected Member Functions inherited from RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo
virtual void ConfigureServo ()
 Checks the current limits on the motor and sets them according to the simulation params. More...
 
virtual void GetLimitValues ()
 
virtual void RecalculateParams ()
 
virtual bool SetData (const std::string &strDataType, const std::string &strValue)
 
virtual void SetMotorPosVel ()
 

Protected Attributes

int m_iUpdateAllParamsCount
 
int m_iUpdateIdx
 Keeps track of the number of update loops that have occurred since we last updated all params.
 
int m_iUpdateQueueIndex
 
RbDynamixelUSBm_lpParentUSB
 
- Protected Attributes inherited from AnimatSim::Robotics::RobotPartInterface
bool m_bChanged
 True when the value changes.
 
float m_fltIOScaledValue
 
float m_fltIOValue
 
float m_fltStepIODuration
 
int m_iIOComponentID
 
int m_iIOValue
 This stores the temporary IO value to be used later in IO calculations.
 
Gain * m_lpGain
 Pointer to the Gain that will be used to convert the source value into the target value.
 
RobotInterfacem_lpParentInterface
 
RobotIOControlm_lpParentIOControl
 
BodyPart * m_lpPart
 
float * m_lpProperty
 
std::string m_strPartID
 
std::string m_strPropertyName
 
- Protected Attributes inherited from AnimatSim::AnimatBase
bool m_bEnabled
 Tells if this item is enabled or not. If it is not enabled then it is not run.
 
bool m_bSelected
 Tells whether the object is selected or not.
 
AnimatSim::Behavior::NeuralModulem_lpModule
 The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NULL.
 
Nodem_lpNode
 The pointer to this items parent Node. If this is not relevant for this object then this is NULL.
 
Simulatorm_lpSim
 The pointer to a Simulation.
 
AnimatSim::Environment::Structurem_lpStructure
 The pointer to this items parent Structure. If this is not relevant for this object then this is NULL.
 
std::string m_strID
 The unique Id for this object.
 
std::string m_strName
 The name for this object.
 
std::string m_strType
 The type for this object. Examples are Box, Plane, Neuron, etc..
 
- Protected Attributes inherited from RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo
bool m_bIsHinge
 
bool m_bNeedSetVelStopPos
 
bool m_bQueryMotorData
 
bool m_bResetToStartPos
 If true then we should reset to the start position at the beginning of the simulation.
 
bool m_bVelStopPosSet
 Keeps track of whether we have already set velocity to stop when doing velocity control.
 
float m_fltCenterPos
 The center point value in radians.
 
float m_fltConvertFPToLoad
 Used to conver the load fixed point value back to a percentage of load.
 
float m_fltConvertFPToPosS
 The conversion factor to convert FP velocity value to rad/s.
 
float m_fltConvertPosSToFP
 The conversion factor to convert rad/s to FP velocity.
 
float m_fltFloatToFPTranslation
 Conversion factor for when we are doing prismatic joints. Converts rotations to linear movements.
 
float m_fltFPToFloatTranslation
 Conversion factor for when we are doing prismatic joints. Converts rotations to linear movements.
 
float m_fltHiLimit
 Hi constraint limit value.
 
float m_fltIOPos
 Used to report back the IO position of the servo at each step.
 
float m_fltIOVelocity
 Used to report back the IO velocity of the servo at each step.
 
float m_fltLoad
 The current load that was last read in for this servo.
 
float m_fltLowLimit
 Low constraint limit value.
 
float m_fltMaxAngle
 Maximum value that can be set for the position in floating point number.
 
float m_fltMaxPosSec
 Stores the maximum rad/sec for this motor.
 
float m_fltMaxSimPos
 This is the maximum angle in radians that can be used for this servo as specified in the simulation.
 
float m_fltMinAngle
 Minimum value that can be set for the position in floating point number.
 
float m_fltMinSimPos
 This is the minimum angle in radians that can be used for this servo as specified in the simulation.
 
float m_fltPosFloatToFPIntercept
 The conversion factor to convert radians to FP position.
 
float m_fltPosFloatToFPSlope
 The conversion factor to convert radians to FP position.
 
float m_fltPosFPToFloatIntercept
 The conversion factor to convert FP position to floating point position..
 
float m_fltPosFPToFloatSlope
 The conversion factor to convert FP position to floating point position.
 
float m_fltPresentPos
 The current position that was last read in for this servo.
 
float m_fltPresentVelocity
 The current velocity that was last read in for this servo.
 
float m_fltReadParamTime
 The time taken to read the params of this motor for the current step.
 
float m_fltRPMPerFPUnit
 Stores the maximum rot/min for this motor. The max rotations (rad) per fixed point unit.
 
float m_fltTemperature
 The current temperature that was last read in for this servo.
 
float m_fltTotalAngle
 Maximum angle the servo can move in floating point number. m_iMaxPosFP - m_iMinPosFP.
 
float m_fltTranslationRange
 The total translation range over which a prismatic joint can move. This does not apply to hinge joints.
 
float m_fltVoltage
 The current voltage that was last read in for this servo.
 
int m_iCCWComplianceMargin
 Used to set the CCW compliance margin of the servo.
 
int m_iCCWComplianceSlope
 Used to set the CCW compliance slope of the servo.
 
int m_iCenterPosFP
 The center point value in fixed point numbers.
 
int m_iCWComplianceMargin
 Used to set the CW compliance margin of the servo.
 
int m_iCWComplianceSlope
 Used to set the CW compliance slope of the servo.
 
int m_iLastGoalPos
 Keeps track of the last servo goal position that we set.
 
int m_iLastGoalVelocity
 Keeps track of the last servo goal velocity that we set.
 
int m_iLoad
 The current load that was last read in for this servo.
 
int m_iMaxLoadFP
 Maximum value that can be set for the load.
 
int m_iMaxPosFP
 Maximum value that can be set for the position in fixed point number.
 
int m_iMaxSimPos
 This is the maximum angle in fixed point that can be used for this servo as specified in the simulation.
 
int m_iMaxTorque
 Used to set the maximum torque of the servo.
 
int m_iMaxVelocityFP
 Maximum value that can be set for the velocity.
 
int m_iMinLoadFP
 Minimum value that can be set for the load.
 
int m_iMinPosFP
 Minimum value that can be set for the position in fixed point number.
 
int m_iMinSimPos
 This is the minimum angle in fixed point that can be used for this servo as specified in the simulation.
 
int m_iMinVelocityFP
 Minimum value that can be set for the velocity.
 
int m_iNextGoalPos
 This is the goal position that you would like to use in the next time step.
 
int m_iNextGoalVelocity
 This is the goal velocity that you would like to use in the next time step.
 
int m_iPresentPos
 The current position that was last read in for this servo.
 
int m_iPresentVelocity
 The current velocity that was last read in for this servo.
 
int m_iServoID
 ID used for communications with this servo.
 
int m_iTemperature
 The current temperature that was last read in for this servo.
 
int m_iTotalAngle
 Maximum angle the servo can move in fixed point number. m_iMaxPosFP - m_iMinPosFP.
 
int m_iVoltage
 The current voltage that was last read in for this servo.
 
MotorizedJoint * m_lpMotorJoint
 Pointer to an associated motorized joint.
 

Additional Inherited Members

- Static Public Member Functions inherited from AnimatSim::Robotics::RobotPartInterface
static RobotPartInterfaceCastToDerived (AnimatBase *lpBase)
 

Detailed Description

Definition at line 18 of file RbDynamixelUSBServo.h.

Member Function Documentation

bool RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::dxl_read_block ( int  id,
int  address,
int  length,
std::vector< int > &  aryData 
)
virtual

Reads an entire block of data from a dynamixel servo. This is used to allow us to read back a number of params at one time instead of having to seperate them into different packets.

Author
dcofer
Date
5/7/2014
Parameters
idID of the servo to query.
addressaddress in the control block to start reading.
lengthlength of the data to read.
aryDataData that was read.
Returns
True if it succedded in the read.

Definition at line 328 of file RbDynamixelUSBServo.cpp.

Referenced by ReadAllParams(), and ReadKeyParams().

+ Here is the caller graph for this function:

float * RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::GetDataPointer ( const std::string &  strDataType)
virtual

Returns a float pointer to a data item of interest in this object.

This is a generic method used to get a pointer to data variable of interest. It is used by a variety of systems in the simulation. The most prominent are the data charting and stimulus classes. Within this method we associate a variable with a string name. By passing in the name of the data type we are interested in we can recieve back a float pointer to that data type. We can use that to read or set the data item in other classes. For example, the data charting system gets the pointer and then each time it needs to log a data point it reads the value into an array.

Author
dcofer
Date
2/22/2011
Parameters
strDataTypename of the data item for which we are looking.
Returns
float pointer of the data item. If not found then it throws an exception.
Exceptions
IfDataType is not found.

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 93 of file RbDynamixelUSBServo.cpp.

std::string RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::GetErrorCode ( )
virtual

Checks the error code and returns an associated error message.

Author
dcofer
Date
5/7/2014
Returns
Error message.

Definition at line 364 of file RbDynamixelUSBServo.cpp.

void RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::Initialize ( )
virtual

Initializes this object.

After an object is loaded in it must be initialized before it can be used. This allows the object to retrieve any pointers or setup memory that it will need during execution. Each object is responsible for initializing any of its child objects, so you simply need to call this method on the containing class to init all child objects. It also calls VerifySystemPointers to make sure that the system pointers have been setup correctly.

Author
dcofer
Date
3/1/2011

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 165 of file RbDynamixelUSBServo.cpp.

References RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_lpMotorJoint.

virtual bool RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::IsMotorControl ( )
inlinevirtual

Returns true if this part interface is for controlling a motor.

Author
dcofer
Date
6/19/2014
Returns
Pointer to the gain.

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 90 of file RbDynamixelUSBServo.h.

float RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::QuantizeServoPosition ( float  fltPos)
virtual

If this is a servo controller interface then it will take a continuous positon and return back a valid quantized position for that servo.

Servos have discreet positions they can obtain based on the bit resolution of the goal position. So they can only be set to move to those positions. If we are trying to sync the sim to match this behavior then we need to only move the sim to these positions as well. You will need to override this method in your actual motor control part interface and implement for your motor model.

Author
dcofer
Date
6/19/2014
Returns
Quantized position.

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 153 of file RbDynamixelUSBServo.cpp.

float RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::QuantizeServoVelocity ( float  fltVel)
virtual

If this is a servo controller interface then it will take a continuous velocity and return back a valid quantized velocity for that servo.

Servos have discreet velocity they can obtain based on the bit resolution of the goal velocity. So they can only be set to move at those velocity. If we are trying to sync the sim to match this behavior then we need to only move the sim to these velociies as well. You will need to override this method in your actual motor control part interface and implement for your motor model.

Author
dcofer
Date
6/19/2014
Returns
Quantized velocity.

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 158 of file RbDynamixelUSBServo.cpp.

void RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::ReadAllParams ( )
virtual

Reads all major data parameters from the servo in one read packet. This include present position, speed, load, temperature, and voltage. It sets the corresponding internal variables.

Author
dcofer
Date
5/7/2014

Definition at line 263 of file RbDynamixelUSBServo.cpp.

References RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::ConvertFPLoad(), RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::ConvertFPVelocity(), dxl_read_block(), RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_fltLoad, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_fltPresentPos, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_fltPresentVelocity, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_fltReadParamTime, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_fltTemperature, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_fltVoltage, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iLoad, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iPresentPos, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iPresentVelocity, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iServoID, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iTemperature, and RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iVoltage.

Referenced by StepIO().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::ResetSimulation ( )
virtual

Resets the simulation back to time 0.

This method calls the ResetSimulation method on all subitems in order to reset the simulation back to the beginning.

Author
dcofer
Date
3/1/2011

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 239 of file RbDynamixelUSBServo.cpp.

References AnimatSim::Robotics::RobotPartInterface::ResetSimulation().

+ Here is the call graph for this function:

bool RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::SetData ( const std::string &  strDataType,
const std::string &  strValue,
bool  bThrowError = true 
)
virtual

Set a variable based on a string data type name.

This is a generic method that can be used to set any variable in an AnimatBase object by specifying the name of the variable and a string representation of that data. The GUI uses this method to set data into variables in the simulation when the user changes them in the UI. The value string can be as simple as a float or int, or as complex as an xml packet. It is the developers responsibilty to know what type of data is needed and to process it accordingly.

Author
dcofer
Date
2/22/2011
Parameters
strDataTypestring name of the data type to set.
strValueThe string value of the data. It is up to the developer to determine what this should be. For example, in most cases it is simply a float and you just have to convert it to a float and make the appropriate mutator method call. However, it can be any type of string, including an entire xml packet. It is the developers responsibility to know how to set and process the data as required.
bThrowErrortrue to throw error if there is a problem. If false then it will not return an error, just return false.
Returns
true if it succeeds, false if it fails.

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 102 of file RbDynamixelUSBServo.cpp.

References StdUtils::Std_CheckString().

+ Here is the call graph for this function:

void RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::SetupIO ( )
virtual

This method is called after all connections to whatever control board have been made. It is meant to be used to setup connection information specific to this part. For example, We connect to a Firmata microcontroller like an Arduino, and then do a setup that could take some time. We should not attempt to setup any of the pins until after the board itself has been setup. After that we need to loop through and setup all the parts. That is what this method is for.

Author
dcofer
Date
5/1/2014

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 176 of file RbDynamixelUSBServo.cpp.

References RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::InitMotorData(), AnimatSim::Simulator::InSimulation(), RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_fltHiLimit, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_fltLowLimit, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iLastGoalPos, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iLastGoalVelocity, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iNextGoalPos, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_iNextGoalVelocity, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_lpMotorJoint, AnimatSim::AnimatBase::m_lpSim, RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::SetMaxSimPos(), and RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::SetMinSimPos().

+ Here is the call graph for this function:

void RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::ShutdownIO ( )
virtual

This method is called just before the IO thread is closed down. It gives the IO objects a chance to do any required cleanup.

Author
dcofer
Date
5/12/2014

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 225 of file RbDynamixelUSBServo.cpp.

References RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::ShutdownMotor().

+ Here is the call graph for this function:

void RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::StepIO ( int  iPartIdx)
virtual

This method is used to send/recieve the actual IO. This will often be in a seperate thread than the StepSimulation. StepSimulation gets/sets the values in the sim and gets it read for the thread that does the IO. Once that thread is ready to send/receive it uses that value to perform the operation.

Author
dcofer
Date
5/2/2014

Reimplemented from AnimatSim::Robotics::RobotPartInterface.

Definition at line 201 of file RbDynamixelUSBServo.cpp.

References AnimatSim::Simulator::InSimulation(), RoboticsAnimatSim::Robotics::RobotIOControls::RbDynamixelServo::m_bQueryMotorData, m_iUpdateAllParamsCount, m_iUpdateIdx, m_iUpdateQueueIndex, AnimatSim::AnimatBase::m_lpSim, ReadAllParams(), and ReadKeyParams().

+ Here is the call graph for this function:

Member Data Documentation

int RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::m_iUpdateAllParamsCount
protected

The number update cycles till we update all params. Typically we only want to update position and speed of the servo every time. We will only update the other params every now and then. This tells how often to do this.

Definition at line 26 of file RbDynamixelUSBServo.h.

Referenced by StepIO().

int RoboticsAnimatSim::Robotics::RobotIOControls::DynamixelUSB::RbDynamixelUSBServo::m_iUpdateQueueIndex
protected

Keeps track of when to update this motor data from the real motor. If it is is -1 then it will update it every time. If it is set to some other positive value then it will only update it when that cycle comes around. This is for updating the motors in a round robin fashion.

Definition at line 34 of file RbDynamixelUSBServo.h.

Referenced by StepIO().


The documentation for this class was generated from the following files: