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 | 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. |
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.
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.
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.
double CorrectionController::getKv | ( | ) | const |
Get the gain for velocity errors.
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.
aController | The controller to be copied. |
Reimplemented from OpenSim::TrackingController.
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 | ) | [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.
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.