OpenSim::Actuator Class Reference

An abstract class for representing an actuator (e.g., a torque motor, muscle, . More...

#include <Actuator.h>

Inheritance diagram for OpenSim::Actuator:
OpenSim::Force OpenSim::ModelComponent OpenSim::Object OpenSim::CustomActuator OpenSim::CoordinateActuator OpenSim::LinearActuator OpenSim::Muscle OpenSim::PointActuator OpenSim::TorqueActuator OpenSim::PassiveJointTorque OpenSim::ContDerivMuscle OpenSim::Delp1990Muscle OpenSim::Schutte1993Muscle OpenSim::Thelen2003Muscle

List of all members.

Public Member Functions

 Actuator ()
 Construct an actuator that has a specified number of controls and state variables.
 Actuator (const Actuator &aActuator)
 Copy constructor.
virtual ~Actuator ()
 Destructor.
virtual Objectcopy () const =0
 Construct and return a copy of this object.
virtual void copyPropertyValues (Actuator &aActuator)
virtual void initStateCache (SimTK::State &s, SimTK::SubsystemIndex subsystemIndex, Model &model)
Actuatoroperator= (const Actuator &aActuator)
 Assignment operator.
virtual void setup (Model &aModel)
 Perform set up functions after model has been deserialized or copied.
void setModel (Model &aModel)
 Set the Model this object is part of.
ModelgetModel () const
 Get the Model this object is part of.
virtual int getControlIndex () const
 Get the index of a control .
virtual void setControlIndex (int index)
virtual void setController (const Controller *)
virtual const ControllergetController () const
virtual double getControl (const SimTK::State &s) const
 Get an actuator control, by index.
double getForceMultiplier (const SimTK::State &s) const
void setForceMultiplier (const SimTK::State &s, double forceMultiplier) const
double getForceDelta (const SimTK::State &s) const
void setForceDelta (const SimTK::State &s, double forceDelta) const
virtual std::string getStateVariableName (int aIndex) const
 Get the name of a state variable, given its index.
virtual int getStateVariableIndex (const std::string &aName) const
virtual void setStateVariable (SimTK::State &s, int aIndex, double aValue) const
 Set an actuator state, specified by index.
virtual void setStateVariables (SimTK::State &s, const double aY[]) const
 Set all of the states of an actuator.
virtual double getStateVariable (const SimTK::State &s, int aIndex) const
 Get an actuator state, by index.
virtual void getStateVariables (const SimTK::State &s, double rY[]) const
 Get all of the states of the actuator.
virtual int getNumStateVariables () const
 Get the number of state variables allocated by this force.
virtual void setStateVariableDeriv (const SimTK::State &s, int aIndex, double aValue) const
 Set the derivative of an actuator state, specified by index.
virtual void setStateVariableDerivs (const SimTK::State &s, const double aY[]) const
 Set the derivatives of all of the states of an actuator.
virtual double getStateVariableDeriv (const SimTK::State &s, int aIndex) const
 Get the derivative of an actuator state, by index.
virtual void getStateVariableDerivs (const SimTK::State &s, double rY[]) const
 Get the derivatives of all of the states of the actuator.
virtual void updateDisplayer (const SimTK::State &s)
virtual void replacePropertyFunction (Function *aOldFunction, Function *aNewFunction)
 Replace one of the actuator's functions in the property array.
 OPENSIM_DECLARE_DERIVED (Actuator, Object)
bool getAppliesForce () const
virtual void setForce (const SimTK::State &s, double aForce) const
virtual double getForce (const SimTK::State &s) const
virtual double getAppliedForce (const SimTK::State &s) const
virtual void setSpeed (const SimTK::State &s, double aspeed) const
virtual double getSpeed (const SimTK::State &s) const
virtual double getPower (const SimTK::State &s) const
virtual double getStress (const SimTK::State &s) const
 getStress needs to be overridden by derived classes to be usable
virtual double getOptimalForce () const
 getOptimalForce needs to be overridden by derived classes to be usable
virtual void setIsControlled (bool flag)
virtual bool isControlled () const
virtual void promoteControlsToStates (const SimTK::State &s, int index)
virtual double computeActuation (const SimTK::State &s) const =0
virtual void computeStateDerivatives (const SimTK::State &s)
virtual void computeEquilibrium (SimTK::State &s) const
virtual bool check () const
virtual void preScale (const SimTK::State &s, const ScaleSet &aScaleSet)
virtual void scale (const SimTK::State &s, const ScaleSet &aScaleSet)
virtual void postScale (const SimTK::State &s, const ScaleSet &aScaleSet)
int getNumControls ()

Static Public Member Functions

static void deleteActuator (Actuator *aActuator)

Static Public Attributes

static const double LARGE = 1.0e8

Protected Member Functions

void setNumStateVariables (int aNumStateVariables)
void bindStateVariable (int aIndex, const std::string &aSuffix)
void setAppliesForce (bool aTrueFalse)
virtual void updateGeometry ()
 Update the geometric representation of the Actuator if any.

Protected Attributes

bool _appliesForce
 Model which the actuator actuates.
Array< std::string > _controlSuffixes
 Name suffixes.
Array< std::string > _stateVariableSuffixes
SimTK::SubsystemIndex _subsystemIndex
int _numStateVariables
const Controller_controller
int _controlIndex
bool _isControlled
SimTK::CacheEntryIndex _forceIndex
SimTK::CacheEntryIndex _speedIndex
SimTK::CacheEntryIndex _forceMultiplierIndex
SimTK::CacheEntryIndex _forceDeltaIndex
SimTK::ZIndex _zIndex
SimTK::CacheEntryIndex _stateVariableDerivIndex

Detailed Description

An abstract class for representing an actuator (e.g., a torque motor, muscle, .

..).

Author:
Frank C. Anderson
Version:
1.0

Constructor & Destructor Documentation

Actuator::Actuator (  ) 

Construct an actuator that has a specified number of controls and state variables.

Parameters:
aNX Number of controls.
aNY Number of states.
Actuator::Actuator ( const Actuator aAct  ) 

Copy constructor.

Parameters:
aActuator Actuator to copy.
Actuator::~Actuator (  )  [virtual]

Destructor.


Member Function Documentation

void Actuator::bindStateVariable ( int  aIndex,
const std::string &  aSuffix 
) [protected]
virtual bool OpenSim::Actuator::check (  )  const [inline, virtual]
virtual double OpenSim::Actuator::computeActuation ( const SimTK::State &  s  )  const [pure virtual]
virtual void OpenSim::Actuator::computeEquilibrium ( SimTK::State &  s  )  const [inline, virtual]
virtual void OpenSim::Actuator::computeStateDerivatives ( const SimTK::State &  s  )  [inline, virtual]
virtual Object* OpenSim::Actuator::copy (  )  const [pure virtual]

Construct and return a copy of this object.

The object is allocated using the new operator, so the caller is responsible for deleting the returned object.

Returns:
Copy of this object.

Reimplemented from OpenSim::Object.

Implemented in OpenSim::ContDerivMuscle, OpenSim::CoordinateActuator, OpenSim::Delp1990Muscle, OpenSim::LinearActuator, OpenSim::PassiveJointTorque, OpenSim::PointActuator, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, OpenSim::TorqueActuator, and OpenSim::Muscle.

virtual void OpenSim::Actuator::copyPropertyValues ( Actuator aActuator  )  [inline, virtual]
static void OpenSim::Actuator::deleteActuator ( Actuator aActuator  )  [inline, static]
virtual double OpenSim::Actuator::getAppliedForce ( const SimTK::State &  s  )  const [virtual]
bool OpenSim::Actuator::getAppliesForce (  )  const [inline]
double Actuator::getControl ( const SimTK::State &  s  )  const [virtual]

Get an actuator control, by index.

Parameters:
aIndex the index of the control to get.
Returns:
The value of the control.
int Actuator::getControlIndex (  )  const [virtual]

Get the index of a control .

Returns:
The index of the control.
const Controller & Actuator::getController (  )  const [virtual]
virtual double OpenSim::Actuator::getForce ( const SimTK::State &  s  )  const [virtual]
double OpenSim::Actuator::getForceDelta ( const SimTK::State &  s  )  const
double OpenSim::Actuator::getForceMultiplier ( const SimTK::State &  s  )  const
Model& OpenSim::Actuator::getModel (  )  const [inline]

Get the Model this object is part of.

Reimplemented from OpenSim::ModelComponent.

int OpenSim::Actuator::getNumControls (  )  [inline]
int Actuator::getNumStateVariables (  )  const [virtual]

Get the number of state variables allocated by this force.

The default implementation returns 0. Subclasses that allocate state variables must override it.

Reimplemented from OpenSim::Force.

double Actuator::getOptimalForce (  )  const [virtual]

getOptimalForce needs to be overridden by derived classes to be usable

Reimplemented in OpenSim::CoordinateActuator, OpenSim::LinearActuator, OpenSim::PointActuator, and OpenSim::TorqueActuator.

virtual double OpenSim::Actuator::getPower ( const SimTK::State &  s  )  const [inline, virtual]
virtual double OpenSim::Actuator::getSpeed ( const SimTK::State &  s  )  const [virtual]
double Actuator::getStateVariable ( const SimTK::State &  s,
int  aIndex 
) const [virtual]

Get an actuator state, by index.

Parameters:
aIndex the index of the state to get.
Returns:
The value of the state.

Reimplemented from OpenSim::Force.

double Actuator::getStateVariableDeriv ( const SimTK::State &  s,
int  aIndex 
) const [virtual]

Get the derivative of an actuator state, by index.

Parameters:
aIndex the index of the state to get.
Returns:
The value of the state.
void Actuator::getStateVariableDerivs ( const SimTK::State &  s,
double  rY[] 
) const [virtual]

Get the derivatives of all of the states of the actuator.

Parameters:
rY The array of states is returned here.
virtual int OpenSim::Actuator::getStateVariableIndex ( const std::string &  aName  )  const [virtual]
string Actuator::getStateVariableName ( int  aIndex  )  const [virtual]

Get the name of a state variable, given its index.

Parameters:
aIndex The index of the state variable to get.
Returns:
The name of the state variable.

Reimplemented from OpenSim::Force.

void Actuator::getStateVariables ( const SimTK::State &  s,
double  rY[] 
) const [virtual]

Get all of the states of the actuator.

Parameters:
rY The array of states is returned here.
double Actuator::getStress ( const SimTK::State &  s  )  const [virtual]
void Actuator::initStateCache ( SimTK::State &  s,
SimTK::SubsystemIndex  subsystemIndex,
Model model 
) [virtual]
virtual bool OpenSim::Actuator::isControlled (  )  const [inline, virtual]
OpenSim::Actuator::OPENSIM_DECLARE_DERIVED ( Actuator  ,
Object   
)
Actuator & Actuator::operator= ( const Actuator aAct  ) 
virtual void OpenSim::Actuator::postScale ( const SimTK::State &  s,
const ScaleSet aScaleSet 
) [inline, virtual]
virtual void OpenSim::Actuator::preScale ( const SimTK::State &  s,
const ScaleSet aScaleSet 
) [inline, virtual]

Reimplemented in OpenSim::Muscle.

virtual void OpenSim::Actuator::promoteControlsToStates ( const SimTK::State &  s,
int  index 
) [inline, virtual]
void Actuator::replacePropertyFunction ( OpenSim::Function aOldFunction,
OpenSim::Function aNewFunction 
) [virtual]

Replace one of the actuator's functions in the property array.

Parameters:
aOldFunction the function being replaced.
aNewFunction the new function.
virtual void OpenSim::Actuator::scale ( const SimTK::State &  s,
const ScaleSet aScaleSet 
) [inline, virtual]
void OpenSim::Actuator::setAppliesForce ( bool  aTrueFalse  )  [inline, protected]
void Actuator::setControlIndex ( int  index  )  [virtual]
void Actuator::setController ( const Controller controller  )  [virtual]
virtual void OpenSim::Actuator::setForce ( const SimTK::State &  s,
double  aForce 
) const [virtual]
void OpenSim::Actuator::setForceDelta ( const SimTK::State &  s,
double  forceDelta 
) const
void OpenSim::Actuator::setForceMultiplier ( const SimTK::State &  s,
double  forceMultiplier 
) const
virtual void OpenSim::Actuator::setIsControlled ( bool  flag  )  [inline, virtual]
void OpenSim::Actuator::setModel ( Model model  )  [inline]

Set the Model this object is part of.

Reimplemented from OpenSim::ModelComponent.

void Actuator::setNumStateVariables ( int  aNumStateVariables  )  [protected]
virtual void OpenSim::Actuator::setSpeed ( const SimTK::State &  s,
double  aspeed 
) const [virtual]
void Actuator::setStateVariable ( SimTK::State &  s,
int  aIndex,
double  aValue 
) const [virtual]

Set an actuator state, specified by index.

Parameters:
aIndex The index of the state to set.
aValue The value to set the state to.

Reimplemented from OpenSim::Force.

void Actuator::setStateVariableDeriv ( const SimTK::State &  s,
int  aIndex,
double  aValue 
) const [virtual]

Set the derivative of an actuator state, specified by index.

Parameters:
aIndex The index of the state to set.
aValue The value to set the state to.
void Actuator::setStateVariableDerivs ( const SimTK::State &  s,
const double  aY[] 
) const [virtual]

Set the derivatives of all of the states of an actuator.

Parameters:
aY The array of states to set.
void Actuator::setStateVariables ( SimTK::State &  s,
const double  aY[] 
) const [virtual]

Set all of the states of an actuator.

Parameters:
aY The array of states to set.
void Actuator::setup ( Model aModel  )  [virtual]

Perform set up functions after model has been deserialized or copied.

Parameters:
aModel model containing this actuator.

Reimplemented from OpenSim::Force.

Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::LinearActuator, OpenSim::PointActuator, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, OpenSim::TorqueActuator, and OpenSim::Muscle.

virtual void OpenSim::Actuator::updateDisplayer ( const SimTK::State &  s  )  [inline, virtual]

Reimplemented in OpenSim::Muscle.

void Actuator::updateGeometry (  )  [protected, virtual]

Update the geometric representation of the Actuator if any.

The resulting geometry is maintained at the VisibleObject layer


Member Data Documentation

Model which the actuator actuates.

Flag indicating whether the actuator applies a force or a torque.

Array<std::string> OpenSim::Actuator::_controlSuffixes [protected]

Name suffixes.

SimTK::CacheEntryIndex OpenSim::Actuator::_forceDeltaIndex [protected]
SimTK::CacheEntryIndex OpenSim::Actuator::_forceIndex [protected]
SimTK::CacheEntryIndex OpenSim::Actuator::_forceMultiplierIndex [protected]
SimTK::CacheEntryIndex OpenSim::Actuator::_speedIndex [protected]
SimTK::CacheEntryIndex OpenSim::Actuator::_stateVariableDerivIndex [protected]
SimTK::SubsystemIndex OpenSim::Actuator::_subsystemIndex [protected]
SimTK::ZIndex OpenSim::Actuator::_zIndex [mutable, protected]
const double Actuator::LARGE = 1.0e8 [static]

The documentation for this class was generated from the following files:

Generated on Wed Dec 16 15:03:44 2009 for OpenSim by  doxygen 1.6.1