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

class controller

controller - abstract base class for robot controllers.

Inheritance:


Public Fields

[more]vector accCmd
the acceleration command vector for the robot's DOFs
[more]vector Tcmd
the torque command vector for the robot's DOFs
[more]mechanism* mech
convenience variable - cfg->mech
[more]dynoTimer* timer
a dynoTimer used to call computeAccelerationCommand or computeTorqueCommand at regular intervals, determined by maxDt()
[more]dofInfluence* inf
a dofInfluece that applies the computed torque command to the mechanism
[more]int alwaysUpdate
if non-zero, indicates that the controller's dynoTimer should be activated after each simulation time step.

Public Methods

[more] ~controller(void)
destructor
[more]virtual double maxDt(void)
returns the maximum allowable time between commands
[more]virtual int computeTorqueCommand(double currentTime, int &computedAcc) = 0
computes a torque command.
[more]virtual int computeAccelerationCommand(double currentTime) = 0
computes an acceleration command; the current simulation time is supplied in currentTime
[more]virtual int madeProgress(double currentTime) = 0
returns 1 if the mechanism was able to "make progress" towards whatever its goal was.
[more]virtual int reset(void)
resets any internal controller state for a new simulation of the same configuration.

Public Members

[more] inherited from d2kComponent
[more] not currently used

Protected Fields

[more]double _maxDt
maximum time between command calculations

Protected Methods

[more] controller(void)
protected constructor


Inherited from d2kComponent:

Public Fields

od2kSimulator* sim
oconfiguration* cfg
oconst char* label
oint active

Public Methods

ovirtual int minCfgs(void) const
ovirtual int maxCfgs(void) const
ovirtual const char* getCfgName(int i)
ovirtual int readParams(paramParser* parser)
ovirtual int setVariables(const ptrList* taskParamRecs)
ovirtual int simInit(d2kSimulator* Sim)
ovirtual int init(ptrList* Cfgs)
ovirtual int forceCfgResolution(void)
ovirtual int cleanup(void)
ovirtual int update(int &violated)
ovirtual const cfgLabelRecord* getLabelRec(int i) const


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

controller - abstract base class for robot controllers. Controllers can generate either acceleration or torque commands depending on whether the dynamicSystem is using kinematic or dynamic simulation, respectively. Controllers use a dynoTimer to ensure that computeTorqueCommand (or computeAcclerationCommand) get called at regular intervals by the dynamicSystem; the interval is determined by maxDt. When dynamic simulation is used, a dofInfluce adds the torque command Tcmd to the mechanism's joint torque vector. Note that Tcmd will be added at *every* simulation time step, while commands will be computed only every maxDt() seconds. Controllers can change their scheduling rate by returning different values from maxDt(); the new value will be used after computeAccelerationCommand() or computeTorqueCommand(). Note that very small values for maxDt() (say, < 0.005 seconds) may slow the simulation since the numeric integrator will be forced to take steps < maxDt() in length.

File variables and defaults

o controller(void)
protected constructor

odouble _maxDt
maximum time between command calculations

ovector accCmd
the acceleration command vector for the robot's DOFs

ovector Tcmd
the torque command vector for the robot's DOFs

omechanism* mech
convenience variable - cfg->mech

odynoTimer* timer
a dynoTimer used to call computeAccelerationCommand or computeTorqueCommand at regular intervals, determined by maxDt()

odofInfluence* inf
a dofInfluece that applies the computed torque command to the mechanism

oint alwaysUpdate
if non-zero, indicates that the controller's dynoTimer should be activated after each simulation time step. maxDt() still provides an upper bound on the time between calls.

o ~controller(void)
destructor

ovirtual double maxDt(void)
returns the maximum allowable time between commands

o inherited from d2kComponent
inherited from d2kComponent

ovirtual int computeTorqueCommand(double currentTime, int &computedAcc) = 0
computes a torque command. The current simulation time is supplied in currentTime. If the controller has also computed the acceleration caused by the torque command and has stored it in accCmd, computeAcc should be set to 1 by the method.

ovirtual int computeAccelerationCommand(double currentTime) = 0
computes an acceleration command; the current simulation time is supplied in currentTime

ovirtual int madeProgress(double currentTime) = 0
returns 1 if the mechanism was able to "make progress" towards whatever its goal was. used by the d2kSimulator to determine whether the simulation should be terminated

ovirtual int reset(void)
resets any internal controller state for a new simulation of the same configuration. For example, reset() might set the error integral of a PID controller to 0. Derived classes should typically call their parent class's reset() method: for instance, controller::reset sets Tcmd and accCmd to 0, which is probably desirable for derived classes as well.

o not currently used
not currently used


Direct child classes:
sriController
pidController
jointController

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.