Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
PostureMC Class Referencea MotionCommand shell for PostureEngine More...
Inheritance diagram for PostureMC:
Detailed Descriptiona MotionCommand shell for PostureEngine Will autoprune by default once it reaches the target pose. If you want to keep it alive so your behavior can repeatedly use the posture to move around, either call setAutoPrune( This class will throw a status event when the sensors confirm the robot has reached a specified target posture, within a configurable range of tolerance. The class will keep trying to reach a target position for timeout milliseconds before giving up. By default, this class will adhere to the values of MaxOutputSpeed, except for head joints which use Config::motion_config values. Definition at line 28 of file PostureMC.h.
Constructor & Destructor Documentation
constructor Definition at line 34 of file PostureMC.h.
constructor, loads from filename Definition at line 40 of file PostureMC.h.
constructor, initializes joint positions to the current state of the outputs as defined by state Definition at line 46 of file PostureMC.h.
destructor Definition at line 52 of file PostureMC.h. Member Function Documentation
sets all joints to unused Reimplemented from PostureEngine. Definition at line 131 of file PostureMC.h.
Sets maxSpeeds to x% of the default MaxOutputSpeed values from the robot info file (e.g. CalliopeInfo.h). Neck joints are instead set from the applicable Config::motion_config values.
Definition at line 18 of file PostureMC.cc. Referenced by EmergencyStopMC::EmergencyStopMC(), and init().
marks this as dirty each time it is added Reimplemented from MotionCommand. Definition at line 122 of file PostureMC.h.
returns curPositions[i], which indicates the last commanded position This is particularly useful when a maximum speed is set, and you want to know progress towards the target (cmds) Definition at line 107 of file PostureMC.h.
return hold Definition at line 79 of file PostureMC.h.
Returns maxSpeeds[i] entry, in rad/sec.
Definition at line 103 of file PostureMC.h.
returns timeout Definition at line 84 of file PostureMC.h.
returns tolerance Definition at line 82 of file PostureMC.h.
initialize curPositions and maxSpeeds Reimplemented from Kinematics. Definition at line 101 of file PostureMC.cc. Referenced by PostureMC().
returns non-zero (true) if PostureEngine::maxdiff() between this and the current position is over tolerance This is handy so you can set to have the robot go to a position and then automatically remove the MotionCommand when it gets there - but beware fighting Postures which average out and neither succeeds Implements MotionCommand. Definition at line 83 of file PostureMC.cc.
returns non-zero (true) if PostureEngine::maxdiff() between this and the current position is over tolerance This is handy so you can set to have the robot go to a position and then automatically remove the MotionCommand when it gets there - but beware fighting Postures which average out and neither succeeds Implements MotionCommand. Definition at line 115 of file PostureMC.h. Referenced by updateOutputs().
sets saveFormatCondensed and loadSaveSensors (pass state for ws if you want to use current sensor values) Reimplemented from PostureEngine. Definition at line 140 of file PostureMC.h.
Sets maxSpeeds to 0 (no maximum). Definition at line 87 of file PostureMC.h.
computes a weighted average of this vs. pe, w being the weight towards pe (so w==1 just copies pe) joints being averaged with unused joints have their weights averaged, but not their values (so an output can crossfade properly)
Reimplemented from PostureEngine. Definition at line 134 of file PostureMC.h.
computes a weighted average of this vs. pe, using the weight values of the joints, storing the total weight in the result's weight value Reimplemented from PostureEngine. Definition at line 135 of file PostureMC.h.
Call this if you call PostureEngine::setOutputCmd(), or set values through getOutputCmd()'s reference, since neither will know to set the PostureMC dirty flag. This is the downside of making setOutputCmd() not virtual - if you pass this around as just a PostureEngine, calls made to that won't be able to update the dirty flag automatically. However, if the object is typed as a PostureMC at the time the call is made, then you don't have to worry.
MotionManager::getOutputCmd() is called instead of WorldState::outputs[] because if this is being called rapidly (i.e. after every sensor reading) using the sensor values will cause problems with very slow acceleration due to sensor lag continually resetting the current position. Using the last value sent by the MotionManager fixes this.
Definition at line 10 of file PostureMC.cc. Referenced by clear(), doStart(), init(), loadBuffer(), setAverage(), setCombine(), setOverlay(), setUnderlay(), setWeights(), solveLinkPosition(), solveLinkVector(), and takeSnapshot().
Sets hold - if this is set to false, it will allow a persistent motion to behave the same as a pruned motion, without being pruned. Definition at line 78 of file PostureMC.h.
Sets maxSpeeds[i] entry, in rad/sec.
Definition at line 98 of file PostureMC.h.
sets output i to OutputCmd c, returns Reimplemented from PostureEngine. Definition at line 137 of file PostureMC.h. Referenced by BatteryMonitorBehavior::setFlipper().
sets joints of this to all joints of pe which are not equal to unused (layers pe over this) stores into this Reimplemented from PostureEngine. Definition at line 132 of file PostureMC.h.
sets timeout, returns Definition at line 83 of file PostureMC.h. sets tolerance, returns Definition at line 81 of file PostureMC.h.
sets joints of this which are equal to unused to pe, (layers this over pe) stores into this Reimplemented from PostureEngine. Definition at line 133 of file PostureMC.h.
the the weights of a range of cmds Reimplemented from PostureEngine. Definition at line 130 of file PostureMC.h.
set the weights of all cmds Reimplemented from PostureEngine. Definition at line 129 of file PostureMC.h. Referenced by setWeights().
Performs inverse kinematics to solve for positioning Peff on link j as close as possible to Ptgt (base coordinates); if solution found, stores result in this posture and returns true.
The difference between solveLinkPosition() and solveLinkVector() is typically small, but critical when you're trying to look at something -- the solution obtained by simplying trying to solve for the position may not align the vector with the target -- solveLinkVector() tries to ensure the vector is aligned with the target, even if that isn't the closest solution position-wise. Reimplemented from PostureEngine. Definition at line 146 of file PostureMC.h.
Performs inverse kinematics to solve for positioning Peff on link j as close as possible to Ptgt (base coordinates in homogenous form); if solution found, stores result in this posture and returns true.
The difference between solveLinkPosition() and solveLinkVector() is typically small, but critical when you're trying to look at something -- the solution obtained by simplying trying to solve for the position may not align the vector with the target -- solveLinkVector() tries to ensure the vector is aligned with the target, even if that isn't the closest solution position-wise. Reimplemented from PostureEngine. Definition at line 143 of file PostureMC.h. Referenced by solveLinkPosition().
Performs inverse kinematics to solve for aligning the vector through Peff on link j and the link's origin to point at Ptgt (base coordinates); if solution found, stores result in this posture and returns true.
The difference between solveLinkPosition() and solveLinkVector() is typically small, but critical when you're trying to look at something -- the solution obtained by simplying trying to solve for the position may not align the vector with the target -- solveLinkVector() tries to ensure the vector is aligned with the target, even if that isn't the closest solution position-wise. Reimplemented from PostureEngine. Definition at line 151 of file PostureMC.h.
Performs inverse kinematics to solve for aligning the vector through Peff on link j and the link's origin to point at Ptgt (base coordinates in homogenous form); if solution found, stores result in this posture and returns true.
The difference between solveLinkPosition() and solveLinkVector() is typically small, but critical when you're trying to look at something -- the solution obtained by simplying trying to solve for the position may not align the vector with the target -- solveLinkVector() tries to ensure the vector is aligned with the target, even if that isn't the closest solution position-wise. Reimplemented from PostureEngine. Definition at line 148 of file PostureMC.h. Referenced by solveLinkVector().
sets the values of cmds to the current state of the outputs as defined by state (doesn't change the weights) Reimplemented from PostureEngine. Definition at line 128 of file PostureMC.h.
sets the values of cmds to the current state of the outputs (doesn't change the weights) Reimplemented from PostureEngine. Definition at line 127 of file PostureMC.h. Referenced by EmergencyStopMC::EmergencyStopMC(), and takeSnapshot().
returns non-zero (true) if PostureEngine::maxdiff() between this and the current position is over tolerance This is handy so you can set to have the robot go to a position and then automatically remove the MotionCommand when it gets there - but beware fighting Postures which average out and neither succeeds Implements MotionCommand. Reimplemented in EmergencyStopMC. Definition at line 46 of file PostureMC.cc. Member Data Documentation
stores the last commanded value for each joint Definition at line 164 of file PostureMC.h. Referenced by EmergencyStopMC::freezeJoints(), getCurrentValue(), setDirty(), setOutputCmd(), updateOutputs(), and EmergencyStopMC::updateOutputs().
true if changes have been made since last updateOutputs() Definition at line 158 of file PostureMC.h. Referenced by EmergencyStopMC::freezeJoints(), isAlive(), isDirty(), EmergencyStopMC::releaseJoints(), setDirty(), setOutputCmd(), updateOutputs(), and EmergencyStopMC::updateOutputs().
if set to true, the posture will be kept active; otherwise joints will be marked unused after each posture is achieved (as if the posture was pruned); set through setHold() Definition at line 159 of file PostureMC.h. Referenced by getHold(), isAlive(), setHold(), and updateOutputs().
radians per frame. Initialized from Config::motion_config, but can be overridden by setMaxSpeed() Definition at line 165 of file PostureMC.h. Referenced by defaultMaxSpeed(), getMaxSpeed(), noMaxSpeed(), setMaxSpeed(), and updateOutputs().
false if any joint is still moving towards its target Definition at line 161 of file PostureMC.h. Referenced by EmergencyStopMC::freezeJoints(), isAlive(), isDirty(), EmergencyStopMC::releaseJoints(), setDirty(), setOutputCmd(), updateOutputs(), and EmergencyStopMC::updateOutputs().
time at which the targetReached flag was set Definition at line 162 of file PostureMC.h. Referenced by isAlive(), and updateOutputs().
number of milliseconds to wait before giving up on a target that should have already been reached, a value of -1U will try forever Definition at line 163 of file PostureMC.h. Referenced by getTimeout(), isAlive(), and setTimeout().
when autopruning, if the maxdiff() of this posture and the robot's current position is below this value, isAlive() will be false, defaults to 0.01 (5.7 degree error) Definition at line 160 of file PostureMC.h. Referenced by getTolerance(), isAlive(), and setTolerance(). The documentation for this class was generated from the following files: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:14 2016 by Doxygen 1.6.3 |