OpenSim::ConstantController Class Reference

#include <ConstantController.h>

Inheritance diagram for OpenSim::ConstantController:
OpenSim::Controller OpenSim::ModelComponent OpenSim::Object

List of all members.

Public Member Functions

 ConstantController ()
 Default constructor.
 ConstantController (const std::string &aFileName, bool aUpdateFromXMLNode=true)
 Constructor from an XML Document.
 ConstantController (const ConstantController &aController)
 Copy constructor.
virtual ~ConstantController ()
 Destructor.
virtual Objectcopy () const
 Copy this ConstantController and return a pointer to the copy.
ConstantControlleroperator= (const ConstantController &aController)
 Assignment operator.
virtual void computeControls (const SimTK::State &s, SimTK::Vector &controls) const
 Compute the control values for all actuators under the control of this Controller.
virtual void setActuators (Set< Actuator > &actuators)
 replace the current set of actuators with the provided set

Protected Member Functions

virtual void setupProperties ()
 Connect properties to local pointers.
void copyData (const ConstantController &aController)
 Copy the member variables of the specified controller.
virtual void setup (Model &model)
 Model component interface that permits the controller to be "wired" up to its actuators.
virtual void createSystem (SimTK::MultibodySystem &system) const
 Model component interface that creates underlying computational components in the SimTK::MultibodySystem.
virtual void initState (SimTK::State &s) const
 Model component interface to initialize states introduced by the controller.

Protected Attributes

OpenSim::PropertyDbl _controlConstantProp
 control value .
double & _controlConstant

Constructor & Destructor Documentation

ConstantController::ConstantController (  ) 

Default constructor.

ConstantController::ConstantController ( 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.
ConstantController::ConstantController ( const ConstantController 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.
ConstantController::~ConstantController (  )  [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

void ConstantController::computeControls ( const SimTK::State &  s,
SimTK::Vector &  controls 
) const [virtual]

Compute the control values for all actuators under the control of this Controller.

Parameters:
s system state
model controls

Implements OpenSim::Controller.

Object * ConstantController::copy (  )  const [virtual]

Copy this ConstantController and return a pointer to the copy.

The copy constructor for this class is used. This method is called when a description of this controller is read in from an XML file.

Returns:
Pointer to a copy of this ConstantController.

Reimplemented from OpenSim::Object.

void ConstantController::copyData ( const ConstantController 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 from OpenSim::Controller.

void ConstantController::createSystem ( SimTK::MultibodySystem &  system  )  const [protected, virtual]

Model component interface that creates underlying computational components in the SimTK::MultibodySystem.

Create a Controller in the SimTK::System.

This includes adding states, creating measures, etc... required by the controller.

Reimplemented from OpenSim::Controller.

void ConstantController::initState ( SimTK::State &  s  )  const [protected, virtual]

Model component interface to initialize states introduced by the controller.

Reimplemented from OpenSim::Controller.

ConstantController & ConstantController::operator= ( const ConstantController 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::Controller.

void ConstantController::setActuators ( Set< Actuator > &  actuators  )  [virtual]

replace the current set of actuators with the provided set

Reimplemented from OpenSim::Controller.

void ConstantController::setup ( Model model  )  [protected, virtual]

Model component interface that permits the controller to be "wired" up to its actuators.

Subclasses can override to perform additional setup.

Reimplemented from OpenSim::Controller.

void ConstantController::setupProperties ( void   )  [protected, virtual]

Connect properties to local pointers.

Reimplemented from OpenSim::Controller.


Member Data Documentation

control value .


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

Generated on Sun Sep 25 00:19:53 2011 for OpenSim by  doxygen 1.6.1