Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

PIDMC Class Reference

#include <PIDMC.h>

Inheritance diagram for PIDMC:

Inheritance graph
[legend]
List of all members.

Detailed Description

A nice little MotionCommand for manually manipulating the PID values.

This can be a one shot deal if you set the autoprune flag as you're adding it (which is the default)

Definition at line 11 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.

OutputPIDgetPID (unsigned int i)
 Use this if you want to double check the PID you set.

const OutputPIDgetPID (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 & Destructor Documentation

PIDMC::PIDMC  )  [inline]
 

Constructor, uses default PIDs and 0 weight for all.

Definition at line 14 of file PIDMC.h.

References dirty, and setDefaults().

PIDMC::PIDMC float  powerlevel,
float  w = 1
[inline]
 

Constructor, sets general power level of all.

Definition at line 19 of file PIDMC.h.

References dirty, and setAllPowerLevel().

PIDMC::PIDMC unsigned int  low,
unsigned int  high,
float  powerlevel,
float  w = 1
[inline]
 

Constructor, sets general power level of a range of joints, uses default and 0 weight for others.

Definition at line 23 of file PIDMC.h.

References dirty, ERS210Info::NumPIDJoints, ERS210Info::PIDJointOffset, and setRangePowerLevel().

virtual PIDMC::~PIDMC  )  [inline, virtual]
 

Destructor.

Definition at line 29 of file PIDMC.h.


Member Function Documentation

const OutputPID& PIDMC::getPID unsigned int  i  )  const [inline]
 

Use this if you want to double check the PID you set.

Definition at line 92 of file PIDMC.h.

References ERS210Info::PIDJointOffset, and PIDs.

OutputPID& PIDMC::getPID unsigned int  i  )  [inline]
 

Use this if you want to double check the PID you set.

Definition at line 87 of file PIDMC.h.

References ERS210Info::PIDJointOffset, and PIDs.

virtual int PIDMC::isAlive  )  [inline, virtual]
 

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" ;)

Returns:
zero if the motion is still processing, non-zero otherwise

Implements MotionCommand.

Definition at line 39 of file PIDMC.h.

References dirty.

virtual int PIDMC::isDirty  )  [inline, virtual]
 

not used by MotionManager at the moment, but could be used to reduce recomputation, and you may find it useful

Returns:
zero if none of the commands have changed since last getJointCmd(), else non-zero

Implements MotionCommand.

Definition at line 38 of file PIDMC.h.

References dirty.

bool PIDMC::isPID unsigned int  i  )  [inline, static, protected]
 

returns true if the output i is a PID joint

Definition at line 98 of file PIDMC.h.

References ERS210Info::NumPIDJoints, and ERS210Info::PIDJointOffset.

void PIDMC::setAllPowerLevel float  p,
float  w = 1
[inline]
 

Sets the PIDs to a percentage of default for all joints.

Definition at line 57 of file PIDMC.h.

References ERS210Info::DefaultPIDs, dirty, ERS210Info::NumPIDJoints, OutputPID::pid, PIDs, and OutputPID::weight.

void PIDMC::setDefaults float  weight = 1  )  [inline]
 

Sets the PIDs to the defaults specified in RobotInfo.

Definition at line 43 of file PIDMC.h.

References setAllPowerLevel().

void PIDMC::setJointPowerLevel unsigned int  i,
float  p,
float  w = 1
[inline]
 

Sets the PIDs to a percentage of default for a given joint, and sets weight.

Definition at line 48 of file PIDMC.h.

References ERS210Info::DefaultPIDs, dirty, OutputPID::pid, ERS210Info::PIDJointOffset, PIDs, and OutputPID::weight.

void PIDMC::setPID unsigned int  i,
const OutputPID pid
[inline]
 

Use this to set the PID value and weight.

Definition at line 80 of file PIDMC.h.

References dirty, ERS210Info::PIDJointOffset, and PIDs.

void PIDMC::setRangePowerLevel unsigned int  low,
unsigned int  high,
float  p,
float  w = 1
[inline]
 

Sets a range of joints' PIDs to a given power level and weight.

Definition at line 67 of file PIDMC.h.

References ERS210Info::DefaultPIDs, dirty, OutputPID::pid, ERS210Info::PIDJointOffset, PIDs, and OutputPID::weight.

virtual int PIDMC::updateOutputs  )  [inline, virtual]
 

is called once per update cycle, can do any processing you need to change your priorities or set output commands on the MotionManager

Returns:
zero if no changes were made, non-zero otherwise
See also:
RobotInfo::NumFrames

RobotInfo::FrameTime

Implements MotionCommand.

Definition at line 33 of file PIDMC.h.

References dirty, motman, ERS210Info::NumPIDJoints, ERS210Info::PIDJointOffset, PIDs, and MotionManager::setOutput().


Member Data Documentation

bool PIDMC::dirty [protected]
 

true if there are changes that have not been picked up by Motion

Definition at line 102 of file PIDMC.h.

OutputPID PIDMC::PIDs[NumPIDJoints] [protected]
 

the PIDs being requested

Definition at line 103 of file PIDMC.h.


The documentation for this class was generated from the following file:
Tekkotsu v1.4
Generated Sat Jul 19 00:09:06 2003 by Doxygen 1.3.2