An abstract class for representing an actuator (e.g., a torque motor, muscle, . More...
#include <Actuator.h>
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 Object * | copy () 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) |
Actuator & | operator= (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. | |
Model & | getModel () 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 Controller & | getController () 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 |
An abstract class for representing an actuator (e.g., a torque motor, muscle, .
..).
Actuator::Actuator | ( | ) |
Construct an actuator that has a specified number of controls and state variables.
aNX | Number of controls. | |
aNY | Number of states. |
Actuator::Actuator | ( | const Actuator & | aAct | ) |
Copy constructor.
aActuator | Actuator to copy. |
Actuator::~Actuator | ( | ) | [virtual] |
Destructor.
void Actuator::bindStateVariable | ( | int | aIndex, | |
const std::string & | aSuffix | |||
) | [protected] |
virtual bool OpenSim::Actuator::check | ( | ) | const [inline, virtual] |
Reimplemented in OpenSim::CoordinateActuator, OpenSim::LinearActuator, OpenSim::PointActuator, and OpenSim::TorqueActuator.
virtual double OpenSim::Actuator::computeActuation | ( | const SimTK::State & | s | ) | const [pure virtual] |
virtual void OpenSim::Actuator::computeEquilibrium | ( | SimTK::State & | s | ) | const [inline, virtual] |
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
virtual void OpenSim::Actuator::computeStateDerivatives | ( | const SimTK::State & | s | ) | [inline, virtual] |
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
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.
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.
aIndex | the index of the control to get. |
int Actuator::getControlIndex | ( | ) | const [virtual] |
Get the index of a 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.
aIndex | the index of the state to get. |
Reimplemented from OpenSim::Force.
double Actuator::getStateVariableDeriv | ( | const SimTK::State & | s, | |
int | aIndex | |||
) | const [virtual] |
Get the derivative of an actuator state, by index.
aIndex | the index of the state to get. |
void Actuator::getStateVariableDerivs | ( | const SimTK::State & | s, | |
double | rY[] | |||
) | const [virtual] |
Get the derivatives of all of the states of the actuator.
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.
aIndex | The index of the state variable to get. |
Reimplemented from OpenSim::Force.
void Actuator::getStateVariables | ( | const SimTK::State & | s, | |
double | rY[] | |||
) | const [virtual] |
Get all of the states of the actuator.
rY | The array of states is returned here. |
double Actuator::getStress | ( | const SimTK::State & | s | ) | const [virtual] |
getStress needs to be overridden by derived classes to be usable
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::CoordinateActuator, OpenSim::Delp1990Muscle, OpenSim::LinearActuator, OpenSim::PointActuator, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::TorqueActuator.
void Actuator::initStateCache | ( | SimTK::State & | s, | |
SimTK::SubsystemIndex | subsystemIndex, | |||
Model & | model | |||
) | [virtual] |
virtual bool OpenSim::Actuator::isControlled | ( | ) | const [inline, virtual] |
Assignment operator.
Reimplemented from OpenSim::Object.
Reimplemented 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::postScale | ( | const SimTK::State & | s, | |
const ScaleSet & | aScaleSet | |||
) | [inline, virtual] |
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::Muscle.
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.
aOldFunction | the function being replaced. | |
aNewFunction | the new function. |
virtual void OpenSim::Actuator::scale | ( | const SimTK::State & | s, | |
const ScaleSet & | aScaleSet | |||
) | [inline, virtual] |
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::Muscle.
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.
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.
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.
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.
aY | The array of states to set. |
void Actuator::setup | ( | Model & | aModel | ) | [virtual] |
Perform set up functions after model has been deserialized or copied.
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
bool OpenSim::Actuator::_appliesForce [protected] |
Model which the actuator actuates.
Flag indicating whether the actuator applies a force or a torque.
int OpenSim::Actuator::_controlIndex [protected] |
const Controller* OpenSim::Actuator::_controller [protected] |
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] |
bool OpenSim::Actuator::_isControlled [protected] |
int OpenSim::Actuator::_numStateVariables [protected] |
SimTK::CacheEntryIndex OpenSim::Actuator::_speedIndex [protected] |
SimTK::CacheEntryIndex OpenSim::Actuator::_stateVariableDerivIndex [protected] |
Array<std::string> OpenSim::Actuator::_stateVariableSuffixes [protected] |
SimTK::SubsystemIndex OpenSim::Actuator::_subsystemIndex [protected] |
SimTK::ZIndex OpenSim::Actuator::_zIndex [mutable, protected] |
const double Actuator::LARGE = 1.0e8 [static] |