OpenSim::Controller Class Reference

#include <Controller.h>

Inheritance diagram for OpenSim::Controller:
OpenSim::ModelComponent OpenSim::Object OpenSim::ConstantController OpenSim::ControlSetController OpenSim::PrescribedController OpenSim::TrackingController OpenSim::CMC OpenSim::CorrectionController

List of all members.

Public Member Functions

 Controller ()
 Default constructor.
 Controller (Model &aModel)
 Another constructor.
 Controller (const std::string &aFileName, bool aUpdateFromXMLNode=true)
 Constructor from an XML Document.
 Controller (const Controller &aController)
 Copy constructor.
virtual ~Controller ()
 Destructor.
Controlleroperator= (const Controller &aController)
 Assignment operator.
bool getIsEnabled () const
 Get whether or not this controller is on.
void setIsEnabled (bool aTrueFalse)
 Turn this controller on or off.
virtual double computeControl (const SimTK::State &s, int index) const =0
 Note that this method is "pure virtual", which means that the Controller class does not implement it, and that subclasses must implement it.
virtual void setActuators (Set< Actuator > &actuators)
virtual void setupSystem (SimTK::MultibodySystem &system)
virtual void setup (Model &model)
virtual void createSystem (SimTK::MultibodySystem &system)
virtual void initState (SimTK::State &s)
virtual double getFirstTime () const
 return the min an max times that a controller knows how to supply controlls for
virtual double getLastTime () const
virtual Set< Actuator > & updActuators ()
virtual const Set< Actuator > & getActuatorSet () const
virtual const Array
< std::string > & 
getActuatorList () const

Protected Member Functions

virtual void setupProperties ()
 Connect properties to local pointers.
void copyData (const Controller &aController)
 Copy the member variables of the specified controller.

Protected Attributes

OpenSim::PropertyBool _isControllerEnabledProp
bool _isControllerEnabled
int _numControls
 number of controls this controller has
PropertyStrArray _actuatorNameListProp
 list of actuator names
Array< std::string > & _actuatorNameList
Set< Actuator_actuatorSet
 set of actuators that the controller controls

Friends

class ControlSet
class ControllerSet

Constructor & Destructor Documentation

Controller::Controller (  ) 

Default constructor.

Controller::Controller ( Model aModel  ) 

Another constructor.

Constructor.

Parameters:
aModel The model that is to be controlled by this Controller.
Controller::Controller ( const std::string &  aFileName,
bool  aUpdateFromXMLNode = true 
)

Constructor from an XML Document.

Parameters:
aFileName The name of the XML file in which this Controller is defined.
aUpdateFromXMLNode A flag indicating whether or not to call updateFromXMLNode() from this constructor. If true, the method will be called from this class. Typically, the flag should be true for this class, but in the member initializer list for this constructor, this class's parent class's constructor with the same parameters will be called, but with aUpdateFromXMLNode set to false.
Controller::Controller ( const Controller aController  ) 

Copy constructor.

This constructor is called by any code that contains a command of the form "Controller newController(oldController);".

Parameters:
aController The controller to be copied.
Controller::~Controller (  )  [virtual]

Destructor.

This method should be a member of any subclass of the Controller class. It will be called automatically whenever an instance of the subclass is deleted from memory.


Member Function Documentation

virtual double OpenSim::Controller::computeControl ( const SimTK::State &  s,
int  index 
) const [pure virtual]

Note that this method is "pure virtual", which means that the Controller class does not implement it, and that subclasses must implement it.

Parameters:
s system state
rControlSet Control set used for the simulation. This method alters the control set in order to control the simulation.

Implemented in OpenSim::ConstantController, OpenSim::ControlSetController, OpenSim::PrescribedController, OpenSim::TrackingController, OpenSim::CMC, and OpenSim::CorrectionController.

void Controller::copyData ( const Controller aController  )  [protected]

Copy the member variables of the specified controller.

This method is called by the copy constructor of the Controller class.

Parameters:
aController The controller whose data is to be copied.

Reimplemented in OpenSim::ConstantController, OpenSim::ControlSetController, OpenSim::PrescribedController, OpenSim::TrackingController, OpenSim::CMC, and OpenSim::CorrectionController.

void Controller::createSystem ( SimTK::MultibodySystem &  system  )  [virtual]
virtual const Array<std::string>& OpenSim::Controller::getActuatorList (  )  const [inline, virtual]
const Set< Actuator > & Controller::getActuatorSet (  )  const [virtual]
double Controller::getFirstTime (  )  const [virtual]

return the min an max times that a controller knows how to supply controlls for

Reimplemented in OpenSim::ControlSetController.

bool Controller::getIsEnabled (  )  const

Get whether or not this controller is on.

Returns:
true if on, false if off.
double Controller::getLastTime (  )  const [virtual]

Reimplemented in OpenSim::ControlSetController.

void Controller::initState ( SimTK::State &  s  )  [virtual]
Controller & Controller::operator= ( const Controller aController  ) 

Assignment operator.

This method is called automatically whenever a command of the form "controller1 = controller2;" is made, where both controller1 and controller2 are both of type Controller. Although Controller cannot be instantiated directly, a subclass of Controller could implement its own operator= method that calls Controller's operator= method. If the subclass does not implement its own operator= method, then when a command of the form "controller1 = controller2" is made, where both controller1 and controller2 are instants of the subclass, the Controller class's operator= method will be called automatically.

Parameters:
aController The controller to be copied.
Returns:
Reference to the altered object.

Reimplemented from OpenSim::Object.

Reimplemented in OpenSim::ConstantController, OpenSim::ControlSetController, OpenSim::PrescribedController, OpenSim::TrackingController, OpenSim::CMC, and OpenSim::CorrectionController.

void Controller::setActuators ( Set< Actuator > &  actuators  )  [virtual]
void Controller::setIsEnabled ( bool  aTrueFalse  ) 

Turn this controller on or off.

Parameters:
aTrueFalse Turns controller on if "true" and off if "false".
void Controller::setup ( Model model  )  [virtual]
void Controller::setupProperties ( void   )  [protected, virtual]

Connect properties to local pointers.

Currently, the Controller class has no properties, so this method does nothing. However, a subclass of Controller (e.g., ControlSetController) can contain member variables that are properties, which should be defined in the setupProperties() method of the subclass.

Reimplemented from OpenSim::Object.

Reimplemented in OpenSim::ConstantController, OpenSim::ControlSetController, OpenSim::PrescribedController, OpenSim::TrackingController, OpenSim::CMC, and OpenSim::CorrectionController.

void Controller::setupSystem ( SimTK::MultibodySystem &  system  )  [virtual]
Set< Actuator > & Controller::updActuators (  )  [virtual]

Friends And Related Function Documentation

friend class ControllerSet [friend]

Reimplemented in OpenSim::TrackingController.

friend class ControlSet [friend]

Member Data Documentation

Array<std::string>& OpenSim::Controller::_actuatorNameList [protected]

list of actuator names

set of actuators that the controller controls

number of controls this controller has


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

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