In file /home/blah/darwin2k/src/d2k/ctrl/jointController.h:a controller for a single joint.
Inheritance:
Public Fields
-
joint* jt
- the joint being controlled
-
int jdim
- which dimension of the joint is being controlled
-
int idx
- the index of this controller in the jointController's list
-
double lastTime
- the last time computeTorqueCommand was called
-
position & velocity mode gains & variables
-
trajectory mode gains & variables
-
d2kCtrlStatus status
- 1 = done, 0 = still going, -1 = timed out
-
singleJointController* master
- the master joint for coordinated motion
Public Methods
-
singleJointController(void)
- constructor
-
int init(joint* jt)
- sets the joint to be controlled
-
int setMode(motionMode newMode, singleJointController* newMaster = NULL)
- sets the motion mode.
-
int reset(void)
- resets internal state (eg.
-
motionMode getMode(void) const
- returns the current mode
-
double computeTorqueCommand(double t, double dt)
- computes a torque command.
-
double computeAccelerationCommand(double t, double dt)
- calls computeTorqueCommand; uses the same gains
-
int holdPosition(void)
- tries to hold current joint value using PID control
-
int accelerateToVelocity(double newV, double accMagnitude = -1)
- tries to accelerate to new velocity, with the indicated acceleration.
-
int setForceCommand(double f)
- exerts constant force/torque
-
int setPositionCommand(double p, double Timeout)
- PID control for position
-
int setVelocityCommand(double v)
- PID control for velocity
-
int followTrajectory(double goalPosition, double maxVelocity, double timeout)
- follows a linear trajectory w/ parabolic blends, moving at the indicated maximum speed
-
int followTimedTrajectory(double goalPosition, double time, double timeout)
- follows a linear trajectory w/ parabolic blends, aiming to complete the motion at the indicated time
-
int coordinatedMove(double goalPosition, singleJointController* master, double timeout)
- [not tested] moves to the indicated position, trying to keep percent of path complete the same as that of the master controller.
-
int readGains(FILE* fp)
- reads gains from a file descriptor
-
int writeGains(FILE* fp)
- writes gains to a file descriptor
Public Members
-
enum motionMode
- the current control mode.
Public Fields
-
static int staticClassID
-
int objectID
-
int verboseLevel
Public Methods
-
virtual const char* className(void) const
-
virtual synObject* copy(void) const
-
virtual int isOfType(int typeNum, int derivedOk)
-
static int setStaticClassID(void)
-
virtual int classID(void) const
Documentation
a controller for a single joint. This class is used by the
jointControllerClass.
enum motionMode
- the current control mode.
- DISABLED - not supplying torque commands
- POSITION - PID control
- VELOCITY - PID on velocity
- FORCE - exerting constant force
- ACCEL - constant acceleration to a desired velocity
- TRAJECTORY - linear with parabolic blends
- COORDINATED - coordinating motion with another joint [not tested]
- VELOCITY_SYNC - synchronizing velocity to another joint [not tested]
joint* jt
- the joint being controlled
int jdim
- which dimension of the joint is being controlled
int idx
- the index of this controller in the jointController's list
double lastTime
- the last time computeTorqueCommand was called
position & velocity mode gains & variables
double kp
- proportional gain
double kv
- velocity gain
double ki
- integral gain
double p
- desired position
double v
- desired velocity
double kvi
- integral gain for velocity commands
double errorI
- integral of error
double thresh
- position or velocity error threshold
double lastPos
- last position; used for smoothing velocity
double vfilt
- filtered velocity
trajectory mode gains & variables
double kat
- acceleration gain for trajectory following
double kvt
- velocity gain for trajectory following
double maxAcc
- desired accel for trajectory (magnitude)
double acc
- commanded acc (signed)
double completed
- fraction completed
double tt
- predicted time to complete trajectory
double goalP
- goal position
double startP
- starting position
double startV
- starting velocity
double startT
- starting time
double timeout
- max time for motion
double accEndT
- switch from accel to decel
double decBeginT
- switch from accel to decel
d2kCtrlStatus status
- 1 = done, 0 = still going, -1 = timed out
singleJointController* master
- the master joint for coordinated motion
singleJointController(void)
- constructor
int init(joint* jt)
- sets the joint to be controlled
int setMode(motionMode newMode, singleJointController* newMaster = NULL)
- sets the motion mode. newMaster is the master to use for
coordinated motion
int reset(void)
- resets internal state (eg. error integral)
motionMode getMode(void) const
- returns the current mode
double computeTorqueCommand(double t, double dt)
- computes a torque command. t is the current time, and dt is
the time since last update
double computeAccelerationCommand(double t, double dt)
- calls computeTorqueCommand; uses the same gains
int holdPosition(void)
- tries to hold current joint value using PID control
int accelerateToVelocity(double newV, double accMagnitude = -1)
- tries to accelerate to new velocity, with the indicated acceleration.
accMagnitude < 0 indicates that maxAcc should be used.
int setForceCommand(double f)
- exerts constant force/torque
int setPositionCommand(double p, double Timeout)
- PID control for position
int setVelocityCommand(double v)
- PID control for velocity
int followTrajectory(double goalPosition, double maxVelocity, double timeout)
- follows a linear trajectory w/ parabolic blends, moving at
the indicated maximum speed
int followTimedTrajectory(double goalPosition, double time, double timeout)
- follows a linear trajectory w/ parabolic blends, aiming to
complete the motion at the indicated time
int coordinatedMove(double goalPosition, singleJointController* master, double timeout)
- [not tested] moves to the indicated position, trying to keep
percent of path complete the same as that of the master controller.
int readGains(FILE* fp)
- reads gains from a file descriptor
int writeGains(FILE* fp)
- writes gains to a file descriptor
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.