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

#include <tgTensionController.h>

Inheritance diagram for tgTensionController:
Collaboration diagram for tgTensionController:

Public Member Functions

 tgTensionController (tgBasicActuator *controllable, double setPoint=0.0)
 
virtual ~tgTensionController ()
 
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
 

Static Public Member Functions

static void control (tgBasicActuator &sca, double dt, double setPoint)
 

Protected Attributes

double m_setPoint
 
tgControllablem_controllable
 

Detailed Description

Provides control of rest length based on a tension setpoint for tgBasicActuators.

Definition at line 40 of file tgTensionController.h.

Constructor & Destructor Documentation

tgTensionController::tgTensionController ( tgBasicActuator controllable,
double  setPoint = 0.0 
)

The only constructor with two inputs

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

Definition at line 38 of file tgTensionController.cpp.

tgTensionController::~tgTensionController ( )
virtual

The destructor. Sets m_controllable to NULL.

Definition at line 45 of file tgTensionController.cpp.

Member Function Documentation

void tgTensionController::control ( double  dt)
virtual

The control step. This version calculates the necessary rest length change in order to produce the desired tension set point in the actuator

Parameters
[in]dt- the elapsed time since the last call. Must be positive.

Reimplemented from tgBasicController.

Definition at line 50 of file tgTensionController.cpp.

Here is the caller graph for this function:

void tgTensionController::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 since the last call. Must be positive.
[in]setPoint- the setpoint to be used at this step.
[in]sensorDataunused in this version. Unifies the API with PIDController

Reimplemented from tgBasicController.

Definition at line 76 of file tgTensionController.cpp.

Here is the call graph for this function:

void tgTensionController::control ( tgBasicActuator sca,
double  dt,
double  setPoint 
)
static

A static version which directly calls setControlInput(input, dt) on the tgBasicActuator. Calculates correct control input based on the setpoint and properties of the Basic Actuator, performs the same calculation as control(dt)

Parameters
[in]sca,areference the tgBasicActuator to be controlled
[in]dt,thetime elapsed since the last call. Is passed through to tgBasicActuator.moveMotors(dt)
[in]setPoint,thedesired tension.

Definition at line 90 of file tgTensionController.cpp.

const tgControllable* const tgBasicController::getControllable ( ) const
inlineinherited

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)
virtualinherited

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
protectedinherited

The system being controlled. We don't own this

Definition at line 97 of file tgBasicController.h.

double tgBasicController::m_setPoint
protectedinherited

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: