NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgBasicController Class Reference

#include <tgBasicController.h>

Inheritance diagram for tgBasicController:
Collaboration diagram for tgBasicController:

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
 
tgControllablem_controllable
 

Detailed Description

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.

Constructor & Destructor Documentation

tgBasicController::tgBasicController ( tgControllable controllable,
double  setPoint = 0.0 
)

The only constructor with two inputs

Parameters
[in]controllable.The system to be controlled.
[in]setPoint.The initial setPoint for the system

Definition at line 36 of file tgBasicController.cpp.

tgBasicController::~tgBasicController ( )
virtual

The destructor. Sets m_controllable to NULL.

Definition at line 43 of file tgBasicController.cpp.

Member Function Documentation

void tgBasicController::control ( double  dt)
virtual

The control step. In this version it passes the setPoint directly to m_controllable

Parameters
[in]dt- the timestep. Must be positive.

Reimplemented in tgPIDController, and tgTensionController.

Definition at line 48 of file tgBasicController.cpp.

Here is the call graph for this function:

void tgBasicController::control ( double  dt,
double  setPoint,
double  sensorData = 0 
)
virtual

Calls setNewSetPoint on the setPoint parameter, then calls control(dt)

Parameters
[in]dt- the elapsed time. Must be positive.
[in]setPoint- the setpoint to be used at this step.
[in]sensorDataunused in this version. Unifies the API with PIDController

Reimplemented in tgPIDController, and tgTensionController.

Definition at line 58 of file tgBasicController.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const tgControllable* const tgBasicController::getControllable ( ) const
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.

void tgBasicController::setNewSetPoint ( double  newSetPoint)
virtual

Updates m_setPoint to newSetpoint

Parameters
[in]newSetPoint,thenext desired setpoint for the controllable

Definition at line 72 of file tgBasicController.cpp.

Member Data Documentation

tgControllable* tgBasicController::m_controllable
protected

The system being controlled. We don't own this

Definition at line 97 of file tgBasicController.h.

double tgBasicController::m_setPoint
protected

The control setpoint. Updated via control or setNewSetPoint

Definition at line 92 of file tgBasicController.h.


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