NTRT Simulator
 All Classes Files Functions Variables Typedefs Friends Pages
tgRBString Class Reference
Inheritance diagram for tgRBString:
Collaboration diagram for tgRBString:

Classes

struct  Config
 

Public Member Functions

 tgRBString (const tgTags &tags, tgRBString::Config &config, double restLength)
 
 tgRBString (std::string space_separated_tags, tgRBString::Config &config, double restLength)
 
virtual void setup (tgWorld &world)
 
virtual void step (double dt)
 
void changeMuscles (double lengthPercent, double dt)
 
virtual void teardown ()
 
virtual void moveMotors (double dt)
 
virtual void tensionMinLengthController (const double targetTension, float dt)
 
virtual const double getStartLength () const
 
virtual const double getCurrentLength () const
 
virtual const double getTension () const
 
virtual const double getRestLength () const
 
virtual const double getVelocity () const
 
const int getSegments () const
 
virtual void setRestLength (double newLength, float dt)
 
virtual void onVisit (const tgModelVisitor &r) const
 
void addChild (tgModel *pChild)
 
virtual std::string toString (std::string prefix="") const
 
template<typename T >
std::vector< T * > find (const tgTagSearch &tagSearch)
 
template<typename T >
std::vector< T * > find (const std::string &tagSearch)
 
std::vector< tgModel * > getDescendants () const
 
void addTags (const std::string &space_separated_tags)
 
void addTags (const tgTags &tags)
 
bool hasTag (const std::string tag) const
 
bool hasAllTags (std::string tags)
 
bool hasAnyTags (const std::string tags)
 
bool hasNoTags ()
 
tgTagsgetTags ()
 
const tgTagsgetTags () const
 
void setTags (tgTags tags)
 
std::string getTagStr (std::string delim=" ") const
 

Protected Attributes

BaseStringHistory *const m_pHistory
 
double m_restLength
 
double m_preferredLength
 
double m_startLength
 
double m_prevVelocity
 

Detailed Description

Definition at line 44 of file tgRBString.h.

Member Function Documentation

void tgModel::addChild ( tgModel pChild)
inherited

Add a sub-model to this model. The model takes ownership of the child sub-model and is responsible for deallocating it.

Parameters
[in,out]pChilda pointer to a sub-model
Exceptions
std::invalid_argumentis pChild is NULL, this object, or already a descendant
Todo:
Make sure that every child appears no more than once in the tree.

Definition at line 126 of file tgModel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
std::vector<T*> tgModel::find ( const tgTagSearch tagSearch)
inlineinherited

Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.

Parameters
[in]tagSearch,atagSearch that contains the desired tags
Returns
a std::vector of pointers to members that match the tag search and typename T

Definition at line 129 of file tgModel.h.

Here is the call graph for this function:

template<typename T >
std::vector<T*> tgModel::find ( const std::string &  tagSearch)
inlineinherited

Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.

Parameters
[in]tagSearch,astd::string& that contains the desired tags
Returns
a std::vector of pointers to members that match the tag search and typename T

Definition at line 142 of file tgModel.h.

Here is the call graph for this function:

std::vector< tgModel * > tgModel::getDescendants ( ) const
inherited

Return a std::vector of const pointers to all sub-models.

Todo:
examine whether this should be public, and perhaps create a read only version
Returns
a std::vector of const pointers all sub-models.
Todo:
Unnecessary copying can be avoided by pasing the result collection in the recursive step.

Definition at line 174 of file tgModel.cpp.

Here is the call graph for this function:

void tgRBString::moveMotors ( double  dt)
virtual

Functions for interfacing with muscle2P, and higher level controllers

Implements tgBaseString.

Definition at line 161 of file tgRBString.cpp.

void tgModel::onVisit ( const tgModelVisitor r) const
virtualinherited

Call tgModelVisitor::render() on self and all descendants.

Parameters
[in,out]ra reference to a tgModelVisitor

Reimplemented in ConnectorTestModel, BuildTestModel, tgLinearString, and tgRod.

Definition at line 109 of file tgModel.cpp.

Here is the call graph for this function:

void tgRBString::setup ( tgWorld world)
virtual
Todo:
Get rid of this.

Reimplemented from tgBaseString.

Definition at line 77 of file tgRBString.cpp.

Here is the call graph for this function:

void tgRBString::step ( double  dt)
virtual

Just calls tgModel::step(dt) - steps any children

Reimplemented from tgBaseString.

Definition at line 117 of file tgRBString.cpp.

Here is the call graph for this function:

void tgRBString::teardown ( )
virtual

Deletes the children (undoes setup)

Reimplemented from tgBaseString.

Definition at line 112 of file tgRBString.cpp.

Here is the call graph for this function:

std::string tgModel::toString ( std::string  prefix = "") const
virtualinherited

Returns the tag names of this model and its children

Parameters
[in]prefixa string to append to
Returns
the original string with this model and its children's tags appended

Definition at line 156 of file tgModel.cpp.

Here is the caller graph for this function:

Member Data Documentation

BaseStringHistory* const tgBaseString::m_pHistory
protectedinherited

All history sequences.

Definition at line 226 of file tgBaseString.h.

double tgBaseString::m_prevVelocity
protectedinherited

Tracking the most recent velocity to avoid using deques.

Definition at line 245 of file tgBaseString.h.

double tgBaseString::m_restLength
protectedinherited

Motor Model Parameters

Definition at line 233 of file tgBaseString.h.

double tgBaseString::m_startLength
protectedinherited

Tracking the start length to avoid using deques.

Definition at line 240 of file tgBaseString.h.


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