This is a simple feedback controller to be used in generating a forward dynamic simulation. More...
#include <CorrectionController.h>
Public Member Functions | |
CorrectionController () | |
Default constructor. | |
CorrectionController (const std::string &aFileName, bool aUpdateFromXMLNode=true) | |
CorrectionController (const CorrectionController &aController) | |
Copy constructor. | |
virtual | ~CorrectionController () |
Destructor. | |
virtual Object * | copy () const |
Copy this CorrectionController and return a pointer to the copy. | |
CorrectionController & | operator= (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 | setActuators (Set< Actuator > &actuators) |
virtual double | computeControl (const SimTK::State &s, int index) const |
Compute the controls for a simulation. | |
virtual void | setup (Model &model) |
virtual void | setupSystem (SimTK::MultibodySystem &system) |
virtual void | initState (SimTK::State &s) |
Protected Member Functions | |
void | setupProperties () |
Connect properties to local pointers. | |
void | copyData (const CorrectionController &aController) |
Copy the member variables of the specified 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. |
This is a simple feedback controller to be used in generating a forward dynamic simulation.
CorrectionController::CorrectionController | ( | ) |
Default constructor.
OpenSim::CorrectionController::CorrectionController | ( | const std::string & | aFileName, | |
bool | aUpdateFromXMLNode = true | |||
) |
CorrectionController::CorrectionController | ( | const CorrectionController & | aController | ) |
Copy constructor.
aController | Controller to copy. |
CorrectionController::~CorrectionController | ( | ) | [virtual] |
Destructor.
double CorrectionController::computeControl | ( | const SimTK::State & | s, | |
int | index | |||
) | const [virtual] |
Compute the controls for a simulation.
The caller should send in an initial guess.
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.
Reimplemented from OpenSim::Object.
void CorrectionController::copyData | ( | const CorrectionController & | aController | ) | [protected] |
Copy the member variables of the specified controller.
Reimplemented from OpenSim::TrackingController.
double CorrectionController::getKp | ( | ) | const |
Get the gain for position errors.
double CorrectionController::getKv | ( | ) | const |
Get the gain for velocity errors.
void CorrectionController::initState | ( | SimTK::State & | s | ) | [virtual] |
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.
aController | The controller to be copied. |
Reimplemented from OpenSim::TrackingController.
Reimplemented from OpenSim::Controller.
void CorrectionController::setKp | ( | double | aKp | ) |
Set the gain for position errors.
aKp | Position error gain for controller will be set to aKp. |
void CorrectionController::setKv | ( | double | aKv | ) |
Set the gain for velocity errors.
aKv | Velocity error gain for controller will be set to aKv. |
void CorrectionController::setup | ( | Model & | model | ) | [virtual] |
Reimplemented from OpenSim::Controller.
void CorrectionController::setupProperties | ( | void | ) | [protected, virtual] |
Connect properties to local pointers.
Reimplemented from OpenSim::TrackingController.
void CorrectionController::setupSystem | ( | SimTK::MultibodySystem & | system | ) | [virtual] |
Reimplemented from OpenSim::Controller.
double& OpenSim::CorrectionController::_kp [protected] |
PropertyDbl OpenSim::CorrectionController::_kpProp [protected] |
Gain for position errors.
This property can be specified in a setup file.
double& OpenSim::CorrectionController::_kv [protected] |
PropertyDbl OpenSim::CorrectionController::_kvProp [protected] |
Gain for velocity errors.
This property can be specified in a setup file.
Storage* OpenSim::CorrectionController::_yDesStore [protected] |
States for the simulation.