NTRT Simulator
v1.1
|
#include <tgBasicController.h>
Public Member Functions | |
tgBasicController (tgControllable *controllable, double setPoint=0.0) | |
virtual | ~tgBasicController () |
virtual void | control (double dt) |
virtual void | control (double dt, double setPoint, double sensorData=0) |
virtual void | setNewSetPoint (double newSetPoint) |
const tgControllable *const | getControllable () const |
Protected Attributes | |
double | m_setPoint |
tgControllable * | m_controllable |
The simplest possible controller. Naively passes its setpoint straight through as the control input. Functional for rest length control for a tgBasicActuator.
Definition at line 38 of file tgBasicController.h.
tgBasicController::tgBasicController | ( | tgControllable * | controllable, |
double | setPoint = 0.0 |
||
) |
The only constructor with two inputs
[in] | controllable. | The system to be controlled. |
[in] | setPoint. | The initial setPoint for the system |
Definition at line 36 of file tgBasicController.cpp.
|
virtual |
The destructor. Sets m_controllable to NULL.
Definition at line 43 of file tgBasicController.cpp.
|
virtual |
The control step. In this version it passes the setPoint directly to m_controllable
[in] | dt | - the timestep. Must be positive. |
Reimplemented in tgPIDController, and tgTensionController.
Definition at line 48 of file tgBasicController.cpp.
|
virtual |
Calls setNewSetPoint on the setPoint parameter, then calls control(dt)
[in] | dt | - the elapsed time. Must be positive. |
[in] | setPoint | - the setpoint to be used at this step. |
[in] | sensorData | unused in this version. Unifies the API with PIDController |
Reimplemented in tgPIDController, and tgTensionController.
Definition at line 58 of file tgBasicController.cpp.
|
inline |
Return a const pointer to a const tgControllable. Current solution to obtaining sensor data (requires casting at a higher level)
Definition at line 82 of file tgBasicController.h.
|
virtual |
Updates m_setPoint to newSetpoint
[in] | newSetPoint,the | next desired setpoint for the controllable |
Definition at line 72 of file tgBasicController.cpp.
|
protected |
The system being controlled. We don't own this
Definition at line 97 of file tgBasicController.h.
|
protected |
The control setpoint. Updated via control or setNewSetPoint
Definition at line 92 of file tgBasicController.h.