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

#include <SpineKinematicsTestController.h>

Inheritance diagram for SpineKinematicsTestController:
Collaboration diagram for SpineKinematicsTestController:

Public Member Functions

 SpineKinematicsTestController (double startTime, double minLength, double rate, std::vector< std::string > tagsToControl)
 
virtual ~SpineKinematicsTestController ()
 
virtual void onSetup (TensegrityModel &subject)
 
virtual void onStep (TensegrityModel &subject, double dt)
 
virtual void onAttach (TensegrityModel &subject)
 
virtual void onTeardown (TensegrityModel &subject)
 
void attach (tgObserver< SpineKinematicsTestController > *pObserver)
 
void notifyStep (double dt)
 
void notifySetup ()
 
void notifyTeardown ()
 

Protected Member Functions

void initializeActuators (TensegrityModel &subject, std::string tag)
 

Detailed Description

A controller to apply the length change in the cables of the HorizontalSpine model. This is used for the ICRA 2016 ULTRA Spine paper results.

Definition at line 47 of file SpineKinematicsTestController.h.

Constructor & Destructor Documentation

SpineKinematicsTestController::SpineKinematicsTestController ( double  startTime,
double  minLength,
double  rate,
std::vector< std::string >  tagsToControl 
)

Construct a SpineKinematicsTestController.

Parameters
[in]startTime,adouble that determines when the controller begins its motion, how many seconds after the simulation starts.
[in]minLength,adouble that is the percent of the initial length that this controller will reduce down to. E.g., if minLength = 0.25, controller will act until the rest length of the cables is 25% of initial.
[in]rate,therate at which the rest length of the cables will be changed. Expressed in meters/sec.
[in]tagsToControl,avector (array) of strings, which is a list of the tags of all the cables upon which to act. All the cables which have a tag in this list of tags will be acted upon by this controller.

Definition at line 47 of file SpineKinematicsTestController.cpp.

virtual SpineKinematicsTestController::~SpineKinematicsTestController ( )
inlinevirtual

Nothing to delete, destructor must be virtual

Definition at line 71 of file SpineKinematicsTestController.h.

Member Function Documentation

Attach an observer to the subject of the observer.

Parameters
[in,out]pObservera pointer to an observer for the subject; do nothing if the pointer is NULL
void SpineKinematicsTestController::initializeActuators ( TensegrityModel subject,
std::string  tag 
)
protected

A helper function to find and initialize the actuators that this class will control.

Parameters
[in]tag,astring of the tag for which to search in the list of actuators in this model.

The initializeActuators method is call in onSetup to put pointers to specific actuators in the cablesWithTags array, as well as store the initial rest lengths in the initialRL map.

Definition at line 80 of file SpineKinematicsTestController.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void tgSubject< SpineKinematicsTestController >::notifySetup ( )
inherited

Call tgObserver<T>::onSetup() on all observers in the order in which they were attached.

void tgSubject< SpineKinematicsTestController >::notifyStep ( double  dt)
inherited

Call tgObserver<T>::onStep() on all observers in the order in which they were attached.

Parameters
[in]dtthe number of seconds since the previous call; do nothing if not positive
void tgSubject< SpineKinematicsTestController >::notifyTeardown ( )
inherited

Call tgObserver<T>::onTeardown() on all observers in the order in which they were attached.

virtual void tgObserver< TensegrityModel >::onAttach ( TensegrityModel subject)
inlinevirtualinherited

Notify the observers when an attach action has occurred. Will only occur once, typically before setup

Parameters
[in,out]subjectthe subject being observed

Definition at line 55 of file tgObserver.h.

void SpineKinematicsTestController::onSetup ( TensegrityModel subject)
virtual

Apply the controller. On setup, adjust the cable lengths one time.

Parameters
[in]subject- the TensegrityModel that is being controlled. Must have a list of allMuscles populated

For this controller, the onSetup method initializes the actuators, which means just store pointers to them and record their rest lengths. This method calls the helper initializeActuators.

Reimplemented from tgObserver< TensegrityModel >.

Definition at line 109 of file SpineKinematicsTestController.cpp.

Here is the call graph for this function:

void SpineKinematicsTestController::onStep ( TensegrityModel subject,
double  dt 
)
virtual

The onStep method is not used for this controller.

Parameters
[in]subject- the TensegrityModel that is being controlled. Must have a list of allMuscles populated
[in]dt,currenttimestep must be positive

Implements tgObserver< TensegrityModel >.

Definition at line 124 of file SpineKinematicsTestController.cpp.

virtual void tgObserver< TensegrityModel >::onTeardown ( TensegrityModel subject)
inlinevirtualinherited

Notify the observers when a teardown action has occurred.

Parameters
[in,out]subjectthe subject being observed

Definition at line 67 of file tgObserver.h.


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