#include <DebugMotionControl.h>
Inheritance diagram for DebugMotionControl:
Public Member Functions | |
DebugMotionControl (const MotionControlInterfaces &interfaces) | |
virtual void | execute () |
virtual bool | handleMessage (InMessage &message) |
Protected Member Functions | |
void | executeStayAsForced (const SensorData &sensorData, JointData &jointData) |
void | setStayAsForcedValue (const SensorData &sensorData, JointData &jointData, SensorData::sensors sensor, JointData::JointID joint, long tolerance) |
void | clip () |
Protected Attributes | |
JointDataSequencer | sequencer |
JointData | stayAsForcedOldValue |
It ignores MotionRequest but processes and executes JointDataSequence debug messages.
Definition at line 26 of file DebugMotionControl.h.
DebugMotionControl::DebugMotionControl | ( | const MotionControlInterfaces & | interfaces | ) | [inline] |
Constructor
interfaces | The paramters of the MotionControl module. |
Definition at line 33 of file DebugMotionControl.h.
void DebugMotionControl::clip | ( | ) | [protected] |
Clips the set joint values to allowed values
Definition at line 63 of file DebugMotionControl.cpp.
References CLIP, JointData::data, JointDataBuffer::frame, JointData::headPan, JointData::headTilt, MotionControlInterfaces::jointDataBuffer, jointDataBufferNumOfFrames, RobotDimensions::jointLimitHeadPanN, RobotDimensions::jointLimitHeadPanP, RobotDimensions::jointLimitHeadTiltN, RobotDimensions::jointLimitHeadTiltP, RobotDimensions::jointLimitLeg1FN, RobotDimensions::jointLimitLeg1FP, RobotDimensions::jointLimitLeg1HN, RobotDimensions::jointLimitLeg1HP, RobotDimensions::jointLimitLeg2N, RobotDimensions::jointLimitLeg2P, RobotDimensions::jointLimitLeg3N, RobotDimensions::jointLimitLeg3P, RobotDimensions::jointLimitNeckTiltN, RobotDimensions::jointLimitNeckTiltP, JointData::legFL1, JointData::legFL2, JointData::legFL3, JointData::legFR1, JointData::legFR2, JointData::legFR3, JointData::legHL1, JointData::legHL2, JointData::legHL3, JointData::legHR1, JointData::legHR2, JointData::legHR3, JointData::neckTilt, and toMicroRad().
Referenced by execute().
void DebugMotionControl::execute | ( | ) | [virtual] |
Executes the module
Implements Module.
Definition at line 11 of file DebugMotionControl.cpp.
References clip(), executeStayAsForced(), JointDataBuffer::frame, JointDataSequencer::isRunning(), MotionControlInterfaces::jointDataBuffer, jointDataBufferNumOfFrames, jointDataInvalidValue, SensorDataBuffer::lastFrame(), JointDataSequencer::nextSequenceData(), MotionControlInterfaces::sensorDataBuffer, sequencer, JointData::tailPan, and JointData::tailTilt.
void DebugMotionControl::executeStayAsForced | ( | const SensorData & | sensorData, | |
JointData & | jointData | |||
) | [protected] |
write sensorData back to jointData for joints with invalidValue to disable any motion (=stay as forced)
Definition at line 89 of file DebugMotionControl.cpp.
References SET_STAYASFORCED.
Referenced by execute().
bool DebugMotionControl::handleMessage | ( | InMessage & | message | ) | [virtual] |
Called from a MessageQueue to distribute messages. Use message.getMessageID to decide if the message is relavant for the MesssageHandler derivate. Use message.bin, message.text or message.config as In streams to get the data from.
message | The message that can be read. |
Reimplemented from Module.
Definition at line 46 of file DebugMotionControl.cpp.
References InMessage::bin, InMessage::getMessageID(), idJointDataSequence, sequencer, and JointDataSequencer::start().
void DebugMotionControl::setStayAsForcedValue | ( | const SensorData & | sensorData, | |
JointData & | jointData, | |||
SensorData::sensors | sensor, | |||
JointData::JointID | joint, | |||
long | tolerance | |||
) | [protected] |
Definition at line 112 of file DebugMotionControl.cpp.
References SensorData::data, JointData::data, jointDataInvalidValue, and stayAsForcedOldValue.
JointDataSequencer DebugMotionControl::sequencer [protected] |
Definition at line 53 of file DebugMotionControl.h.
Referenced by execute(), and handleMessage().
JointData DebugMotionControl::stayAsForcedOldValue [protected] |
old values for stay as forced mode
Definition at line 72 of file DebugMotionControl.h.
Referenced by setStayAsForcedValue().