Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
PostureMC Class Reference#include <PostureMC.h>
Inheritance diagram for PostureMC:
![]() Detailed Descriptiona MotionCommand shell for PostureEngineWill 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, initializes joint positions to the current state of the outputs as defined by state
Definition at line 46 of file PostureMC.h.
Member Function Documentation
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 7 of file PostureMC.cc. Referenced by clear(), 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.
Restores maxSpeeds to default MaxOutputSpeed values from the robot info file (e.g. ERS7Info.h). Neck joints are instead set from the applicable Config::motion_config values.
Definition at line 15 of file PostureMC.cc. Referenced by EmergencyStopMC::EmergencyStopMC(), and init().
Sets maxSpeeds[i] entry, in rad/sec.
Definition at line 98 of file PostureMC.h.
Returns maxSpeeds[i] entry, in rad/sec.
Definition at line 103 of file PostureMC.h.
is called once per update cycle, can do any processing you need to change your priorities or set output commands on the MotionManager
Implements MotionCommand. Reimplemented in EmergencyStopMC. Definition at line 43 of file PostureMC.cc. Referenced by EmergencyStopMC::updateOutputs().
not used by MotionManager at the moment, but could be used to reduce recomputation, and you may find it useful
Implements MotionCommand. Definition at line 111 of file PostureMC.h. Referenced by updateOutputs().
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 80 of file PostureMC.cc.
marks this as dirty each time it is added
Reimplemented from MotionCommand. Definition at line 118 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 123 of file PostureMC.h. Referenced by EmergencyStopMC::EmergencyStopMC().
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 124 of file PostureMC.h.
set the weights of all cmds
Reimplemented from PostureEngine. Definition at line 125 of file PostureMC.h.
the the weights of a range of cmds
Reimplemented from PostureEngine. Definition at line 126 of file PostureMC.h.
sets all joints to unused
Reimplemented from PostureEngine. Definition at line 127 of file PostureMC.h.
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 128 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 129 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 130 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 131 of file PostureMC.h.
sets output i to OutputCmd c, returns
Reimplemented from PostureEngine. Definition at line 132 of file PostureMC.h. Referenced by BatteryMonitorBehavior::setFlipper().
sets saveFormatCondensed and loadSaveSensors (pass state for ws if you want to use current sensor values)
Reimplemented from PostureEngine. Definition at line 133 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.
Reimplemented from PostureEngine. Definition at line 134 of file PostureMC.h.
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.
Reimplemented from PostureEngine. Definition at line 135 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.
Reimplemented from PostureEngine. Definition at line 136 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); if solution found, stores result in this posture and returns true.
Reimplemented from PostureEngine. Definition at line 137 of file PostureMC.h.
initialize curPositions and maxSpeeds
Reimplemented from Kinematics. Definition at line 98 of file PostureMC.cc. Referenced by PostureMC().
Member Data Documentation
true if changes have been made since last updateOutputs()
Definition at line 143 of file PostureMC.h. Referenced by DoStart(), 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 144 of file PostureMC.h. Referenced by getHold(), isAlive(), setHold(), and updateOutputs().
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 145 of file PostureMC.h. Referenced by getTolerance(), isAlive(), and setTolerance().
false if any joint is still moving towards its target
Definition at line 146 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 147 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 148 of file PostureMC.h. Referenced by getTimeout(), isAlive(), and setTimeout().
stores the last commanded value for each joint
Definition at line 149 of file PostureMC.h. Referenced by EmergencyStopMC::freezeJoints(), setDirty(), setOutputCmd(), updateOutputs(), and EmergencyStopMC::updateOutputs().
initialized from Config::motion_config, but can be overridden by setMaxSpeed(); rad per frame
Definition at line 150 of file PostureMC.h. Referenced by defaultMaxSpeed(), getMaxSpeed(), noMaxSpeed(), setMaxSpeed(), and updateOutputs().
The documentation for this class was generated from the following files: |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:36 2007 by Doxygen 1.5.4 |