OpenSim::CorrectionController Class Reference

This is a simple feedback controller to be used in generating a forward dynamic simulation. More...

#include <CorrectionController.h>

Inheritance diagram for OpenSim::CorrectionController:
OpenSim::TrackingController OpenSim::Controller OpenSim::ModelComponent OpenSim::Object

List of all members.

Public Member Functions

 CorrectionController ()
 Default constructor.
 CorrectionController (const std::string &aFileName, bool aUpdateFromXMLNode=true)
 CorrectionController (const CorrectionController &aController)
 Copy constructor.
virtual ~CorrectionController ()
 Destructor.
virtual Objectcopy () const
 Copy this CorrectionController and return a pointer to the copy.
CorrectionControlleroperator= (const CorrectionController &aController)
 Assignment operator.
double getKp () const
 Get the gain for position errors.
void setKp (double aKp)
 Set the gain for position errors.
double getKv () const
 Get the gain for velocity errors.
void setKv (double aKv)
 Set the gain for velocity errors.
virtual void computeControls (const SimTK::State &s, SimTK::Vector &controls) const
 Compute the controls for Actuator's that this Controller is charge of.

Protected Member Functions

void setupProperties ()
 Connect properties to local pointers.
void copyData (const CorrectionController &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

PropertyDbl _kpProp
 Gain for position errors.
double & _kp
PropertyDbl _kvProp
 Gain for velocity errors.
double & _kv
Storage_yDesStore
 States for the simulation.

Detailed Description

This is a simple feedback controller to be used in generating a forward dynamic simulation.

Author:
Chand T. John, Samuel R. Hamner, Ajay Seth
Version:
1.0

Constructor & Destructor Documentation

CorrectionController::CorrectionController (  ) 

Default constructor.

OpenSim::CorrectionController::CorrectionController ( const std::string &  aFileName,
bool  aUpdateFromXMLNode = true 
)
CorrectionController::CorrectionController ( const CorrectionController aController  ) 

Copy constructor.

Parameters:
aController Controller to copy.
CorrectionController::~CorrectionController (  )  [virtual]

Destructor.


Member Function Documentation

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

Compute the controls for Actuator's that this Controller is charge of.

Implements OpenSim::TrackingController.

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

Copy this CorrectionController 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 CorrectionController.

Reimplemented from OpenSim::Object.

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

Copy the member variables of the specified controller.

Reimplemented from OpenSim::TrackingController.

void CorrectionController::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.

double CorrectionController::getKp (  )  const

Get the gain for position errors.

Returns:
Current position error gain value.
double CorrectionController::getKv (  )  const

Get the gain for velocity errors.

Returns:
Current velocity error gain value.
void CorrectionController::initState ( SimTK::State &  s  )  const [protected, virtual]

Model component interface to initialize states introduced by the controller.

Reimplemented from OpenSim::Controller.

CorrectionController & CorrectionController::operator= ( const CorrectionController 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.
Reference to this object.

Reimplemented from OpenSim::TrackingController.

void CorrectionController::setKp ( double  aKp  ) 

Set the gain for position errors.

Parameters:
aKp Position error gain for controller will be set to aKp.
void CorrectionController::setKv ( double  aKv  ) 

Set the gain for velocity errors.

Parameters:
aKv Velocity error gain for controller will be set to aKv.
void CorrectionController::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 CorrectionController::setupProperties ( void   )  [protected, virtual]

Connect properties to local pointers.

Reimplemented from OpenSim::TrackingController.


Member Data Documentation

Gain for position errors.

This property can be specified in a setup file.

Gain for velocity errors.

This property can be specified in a setup file.

States for the simulation.


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

Generated on Sun Sep 25 00:20:06 2011 for OpenSim by  doxygen 1.6.1