In file /home/blah/darwin2k/src/d2k/ctrl/jointController.h:

class singleJointController

a controller for a single joint.

Inheritance:


Public Fields

[more]joint* jt
the joint being controlled
[more]int jdim
which dimension of the joint is being controlled
[more]int idx
the index of this controller in the jointController's list
[more]double lastTime
the last time computeTorqueCommand was called
[more] position & velocity mode gains & variables
[more] trajectory mode gains & variables
[more]d2kCtrlStatus status
1 = done, 0 = still going, -1 = timed out
[more]singleJointController* master
the master joint for coordinated motion

Public Methods

[more] singleJointController(void)
constructor
[more]int init(joint* jt)
sets the joint to be controlled
[more]int setMode(motionMode newMode, singleJointController* newMaster = NULL)
sets the motion mode.
[more]int reset(void)
resets internal state (eg.
[more]motionMode getMode(void) const
returns the current mode
[more]double computeTorqueCommand(double t, double dt)
computes a torque command.
[more]double computeAccelerationCommand(double t, double dt)
calls computeTorqueCommand; uses the same gains
[more]int holdPosition(void)
tries to hold current joint value using PID control
[more]int accelerateToVelocity(double newV, double accMagnitude = -1)
tries to accelerate to new velocity, with the indicated acceleration.
[more]int setForceCommand(double f)
exerts constant force/torque
[more]int setPositionCommand(double p, double Timeout)
PID control for position
[more]int setVelocityCommand(double v)
PID control for velocity
[more]int followTrajectory(double goalPosition, double maxVelocity, double timeout)
follows a linear trajectory w/ parabolic blends, moving at the indicated maximum speed
[more]int followTimedTrajectory(double goalPosition, double time, double timeout)
follows a linear trajectory w/ parabolic blends, aiming to complete the motion at the indicated time
[more]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.
[more]int readGains(FILE* fp)
reads gains from a file descriptor
[more]int writeGains(FILE* fp)
writes gains to a file descriptor

Public Members

[more]enum motionMode
the current control mode.


Inherited from synObject:

Public Fields

ostatic int staticClassID
oint objectID
oint verboseLevel

Public Methods

ovirtual const char* className(void) const
ovirtual synObject* copy(void) const
ovirtual int isOfType(int typeNum, int derivedOk)
ostatic int setStaticClassID(void)
ovirtual int classID(void) const


Documentation

a controller for a single joint. This class is used by the jointControllerClass.
oenum motionMode
the current control mode.

ojoint* jt
the joint being controlled

oint jdim
which dimension of the joint is being controlled

oint idx
the index of this controller in the jointController's list

odouble lastTime
the last time computeTorqueCommand was called

o position & velocity mode gains & variables

odouble kp
proportional gain

odouble kv
velocity gain

odouble ki
integral gain

odouble p
desired position

odouble v
desired velocity

odouble kvi
integral gain for velocity commands

odouble errorI
integral of error

odouble thresh
position or velocity error threshold

odouble lastPos
last position; used for smoothing velocity

odouble vfilt
filtered velocity

o trajectory mode gains & variables

odouble kat
acceleration gain for trajectory following

odouble kvt
velocity gain for trajectory following

odouble maxAcc
desired accel for trajectory (magnitude)

odouble acc
commanded acc (signed)

odouble completed
fraction completed

odouble tt
predicted time to complete trajectory

odouble goalP
goal position

odouble startP
starting position

odouble startV
starting velocity

odouble startT
starting time

odouble timeout
max time for motion

odouble accEndT
switch from accel to decel

odouble decBeginT
switch from accel to decel

od2kCtrlStatus status
1 = done, 0 = still going, -1 = timed out

osingleJointController* master
the master joint for coordinated motion

o singleJointController(void)
constructor

oint init(joint* jt)
sets the joint to be controlled

oint setMode(motionMode newMode, singleJointController* newMaster = NULL)
sets the motion mode. newMaster is the master to use for coordinated motion

oint reset(void)
resets internal state (eg. error integral)

omotionMode getMode(void) const
returns the current mode

odouble computeTorqueCommand(double t, double dt)
computes a torque command. t is the current time, and dt is the time since last update

odouble computeAccelerationCommand(double t, double dt)
calls computeTorqueCommand; uses the same gains

oint holdPosition(void)
tries to hold current joint value using PID control

oint accelerateToVelocity(double newV, double accMagnitude = -1)
tries to accelerate to new velocity, with the indicated acceleration. accMagnitude < 0 indicates that maxAcc should be used.

oint setForceCommand(double f)
exerts constant force/torque

oint setPositionCommand(double p, double Timeout)
PID control for position

oint setVelocityCommand(double v)
PID control for velocity

oint followTrajectory(double goalPosition, double maxVelocity, double timeout)
follows a linear trajectory w/ parabolic blends, moving at the indicated maximum speed

oint followTimedTrajectory(double goalPosition, double time, double timeout)
follows a linear trajectory w/ parabolic blends, aiming to complete the motion at the indicated time

oint 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.

oint readGains(FILE* fp)
reads gains from a file descriptor

oint 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++.