Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <PIDMC.h>
Inheritance diagram for PIDMC:
This will, by default, autoprune after its PID values have been set.
Although this doesn't handle directly sending PID commands to the system (the MotionManager::updatePIDs() does that) a little documentation on how Tekkotsu ad OPEN-R handle the PIDs might be nice.
In Tekkotsu, each of P,I, and D are a single floating point number. However, OPEN-R has, in essence, a limited precision floating point number. Each value is broken into a gain (mantissa) and shift (exponent). The shifts appear to be 4 bit values, and are inverted. In other words, x = g/(1<<(0x10-s)), or The gain is probably 6-8 bits of resolution.
On the ERS-2xx series, each joint is completely independent. One caveat is that the shift value 0x0A gives a warning (AGRMSDriver::SetGain() : 0x0A IS USED FOR GAIN SHIFT VALUE.) for some unknown reason.
On the ERS-7, all the joints share the last set shift values, so a global set of shifts must be enforced. This of course, pretty much kills the whole point of having the shifts.
To understand the conversion from Tekkotsu format to the OPEN-R format, see MotionManager::updatePIDs().
A final note: the OPENR::SetJointGain function seems to be a rather costly function call. You should probably try to avoid setting PIDs at too high a frequency.
Definition at line 41 of file PIDMC.h.
Public Member Functions | |
PIDMC () | |
Constructor, uses default PIDs and 0 weight for all. | |
PIDMC (float powerlevel, float w=1) | |
Constructor, sets general power level of all. | |
PIDMC (unsigned int low, unsigned int high, float powerlevel, float w=1) | |
Constructor, sets general power level of a range of joints, uses default and 0 weight for others. | |
virtual | ~PIDMC () |
Destructor. | |
void | setDefaults (float weight=1) |
Sets the PIDs to the defaults specified in RobotInfo. | |
void | setJointPowerLevel (unsigned int i, float p, float w=1) |
Sets the PIDs to a percentage of default for a given joint, and sets weight. | |
void | setAllPowerLevel (float p, float w=1) |
Sets the PIDs to a percentage of default for all joints. | |
void | setRangePowerLevel (unsigned int low, unsigned int high, float p, float w=1) |
Sets a range of joints' PIDs to a given power level and weight. | |
void | setPID (unsigned int i, const OutputPID &pid) |
Use this to set the PID value and weight. | |
OutputPID & | getPID (unsigned int i) |
Use this if you want to double check the PID you set. | |
const OutputPID & | getPID (unsigned int i) const |
Use this if you want to double check the PID you set. | |
virtual int | updateOutputs () |
is called once per update cycle, can do any processing you need to change your priorities or set output commands on the MotionManager | |
virtual int | isDirty () |
not used by MotionManager at the moment, but could be used to reduce recomputation, and you may find it useful | |
virtual int | isAlive () |
used to prune "dead" motions from the MotionManager | |
Static Protected Member Functions | |
bool | isPID (unsigned int i) |
returns true if the output i is a PID joint | |
Protected Attributes | |
bool | dirty |
true if there are changes that have not been picked up by Motion | |
OutputPID | PIDs [NumPIDJoints] |
the PIDs being requested |
|
Constructor, uses default PIDs and 0 weight for all.
|
|
Constructor, sets general power level of all.
|
|
Constructor, sets general power level of a range of joints, uses default and 0 weight for others.
|
|
Destructor.
|
|
Use this if you want to double check the PID you set.
|
|
Use this if you want to double check the PID you set.
|
|
used to prune "dead" motions from the MotionManager note that a motion could be "paused" or inactive and therefore not dirty, but still alive, biding its time to "strike" ;)
Implements MotionCommand. |
|
not used by MotionManager at the moment, but could be used to reduce recomputation, and you may find it useful
Implements MotionCommand. |
|
returns true if the output i is a PID joint
|
|
Sets the PIDs to a percentage of default for all joints.
Definition at line 87 of file PIDMC.h. Referenced by PIDMC(), and setDefaults(). |
|
Sets the PIDs to the defaults specified in RobotInfo.
Definition at line 73 of file PIDMC.h. Referenced by PIDMC(). |
|
Sets the PIDs to a percentage of default for a given joint, and sets weight.
|
|
Use this to set the PID value and weight.
|
|
Sets a range of joints' PIDs to a given power level and weight.
Definition at line 97 of file PIDMC.h. Referenced by PIDMC(). |
|
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. |
|
true if there are changes that have not been picked up by Motion
Definition at line 132 of file PIDMC.h. Referenced by isAlive(), isDirty(), PIDMC(), setAllPowerLevel(), setJointPowerLevel(), setPID(), setRangePowerLevel(), and updateOutputs(). |
|
the PIDs being requested
Definition at line 133 of file PIDMC.h. Referenced by getPID(), setAllPowerLevel(), setJointPowerLevel(), setPID(), setRangePowerLevel(), and updateOutputs(). |
Tekkotsu v2.0 |
Generated Wed Jan 21 03:23:20 2004 by Doxygen 1.3.4 |