NTRT Simulator
Version: Master
|
#include <tgSpringCableActuator.h>
Inherits tgModel, tgControllable, and tgSubject< tgSpringCableActuator >.
Inherited by tgBasicActuator, and tgKinematicActuator.
Classes | |
struct | Config |
struct | SpringCableActuatorHistory |
Public Member Functions | |
virtual | ~tgSpringCableActuator () |
virtual void | setup (tgWorld &world) |
virtual void | teardown () |
virtual void | step (double 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 |
virtual const tgSpringCableActuator::SpringCableActuatorHistory & | getHistory () const |
const tgSpringCable * | getSpringCable () const |
const Config & | getConfig () const |
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 |
const std::vector < abstractMarker > & | getMarkers () const |
void | addMarker (abstractMarker a) |
virtual std::vector < tgSenseable * > | getSenseableDescendants () 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 () |
tgTags & | getTags () |
const tgTags & | getTags () const |
void | setTags (tgTags tags) |
std::string | getTagStr (std::string delim=" ") const |
virtual void | setControlInput (double input)=0 |
virtual void | setControlInput (double input, double dt) |
void | attach (tgObserver< tgSpringCableActuator > *pObserver) |
void | notifyStep (double dt) |
void | notifySetup () |
void | notifyTeardown () |
Protected Member Functions | |
tgSpringCableActuator (tgSpringCable *springCable, const tgTags &tags, tgSpringCableActuator::Config &config) | |
Protected Attributes | |
tgSpringCable * | m_springCable |
Config | m_config |
SpringCableActuatorHistory *const | m_pHistory |
double | m_restLength |
double | m_startLength |
double | m_prevVelocity |
Sets a basic API for spring cable actuator models, so controllers can interface with all of them the same way. Abstract since it doesn not define tgControllable's setControlInput.
Definition at line 46 of file tgSpringCableActuator.h.
|
virtual |
Deletes history and spring cable instantiation
Definition at line 134 of file tgSpringCableActuator.cpp.
|
protected |
Need to pass tags down to tgModel, but these should only be called by sub classes
Definition at line 116 of file tgSpringCableActuator.cpp.
|
inherited |
Add a sub-model to this model. The model takes ownership of the child sub-model and is responsible for deallocating it.
[in,out] | pChild | a pointer to a sub-model |
std::invalid_argument | is pChild is NULL, this object, or already a descendant |
Definition at line 122 of file tgModel.cpp.
|
inherited |
Attach an observer to the subject of the observer.
[in,out] | pObserver | a pointer to an observer for the subject; do nothing if the pointer is NULL |
|
inlineinherited |
Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.
[in] | tagSearch,a | tagSearch that contains the desired tags |
Definition at line 128 of file tgModel.h.
|
inlineinherited |
Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.
[in] | tagSearch,a | std::string& that contains the desired tags |
Definition at line 141 of file tgModel.h.
|
inline |
Return a const reference to m_config for scaling values in neural networks
Definition at line 263 of file tgSpringCableActuator.h.
|
virtual |
Returns the current length of the spring cable
Definition at line 167 of file tgSpringCableActuator.cpp.
|
inherited |
Return a std::vector of const pointers to all sub-models.
Definition at line 170 of file tgModel.cpp.
|
virtual |
Return a const reference to the history struct
Reimplemented in tgKinematicActuator.
Definition at line 187 of file tgSpringCableActuator.cpp.
|
virtual |
Returns the rest length of the spring-cable
Definition at line 177 of file tgSpringCableActuator.cpp.
|
virtualinherited |
From tgSenseable: need to return all the children of this class. Since tgModels are tgSenseables, just return getDescendants().
For tgSenseable: just return the results of getDescendants here. This should be OK, since a vector of tgModel* is also a vector of tgSenseable*.
Reimplemented from tgSenseable.
Definition at line 191 of file tgModel.cpp.
|
inline |
Returns a pointer the string's tgBulletSpringCable. Used for rendering in tgBulletRenderer
Definition at line 254 of file tgSpringCableActuator.h.
|
virtual |
Functions for interfacing with tgSpringCable Returns the length of the spring cable when the simulation started
Definition at line 162 of file tgSpringCableActuator.cpp.
|
virtual |
Returns the current tension in the spring. Equal to stiffness * (current length - rest length)
Definition at line 172 of file tgSpringCableActuator.cpp.
|
virtual |
In the default implementation returns the change in actual length / time of the spring cable. Some child classes return the actuator velocity
Reimplemented in tgKinematicActuator.
Definition at line 182 of file tgSpringCableActuator.cpp.
|
inherited |
Call tgObserver<T>::onSetup() on all observers in the order in which they were attached.
|
inherited |
Call tgObserver<T>::onStep() on all observers in the order in which they were attached.
[in] | dt | the number of seconds since the previous call; do nothing if not positive |
|
inherited |
Call tgObserver<T>::onTeardown() on all observers in the order in which they were attached.
|
virtualinherited |
Call tgModelVisitor::render() on self and all descendants.
[in,out] | r | a reference to a tgModelVisitor |
Reimplemented in tgCompressionSpringActuator, tgUnidirComprSprActuator, ConnectorTestModel, BuildTestModel, tgKinematicActuator, tgSphere, tgBox, tgRod, ContactCableDemo, tgBasicActuator, hillyMuscleNP, simpleMuscleNP, tgBoxMoreAnchors, tgBaseRigid, and tgGhostModel.
Definition at line 107 of file tgModel.cpp.
|
pure virtualinherited |
Set the relevant control variable for this class, such as commanded position or torque
[in] | input,the | control input, units are application dependent |
Implemented in tgCompressionSpringActuator, tgKinematicActuator, and tgBasicActuator.
|
inlinevirtualinherited |
Secondary function for those classes which need to know how much time has elapsed since they last recieved input (such as tgBasicActuator's moveMotors(dt) function) This will silently fail if it is called erroneously
[in] | input,the | desired control input |
[in] | dt,the | time elapsed since the last call. Must be positive (typically enforced in child class) |
Reimplemented in tgCompressionSpringActuator, and tgBasicActuator.
Definition at line 65 of file tgControllable.h.
|
virtual |
Just calls tgModel::setup(world) - sets up any children
Reimplemented from tgModel.
Reimplemented in tgKinematicActuator, and tgBasicActuator.
Definition at line 140 of file tgSpringCableActuator.cpp.
|
virtual |
Just calls tgModel::step(dt) - steps any children
Reimplemented from tgModel.
Reimplemented in tgKinematicActuator, and tgBasicActuator.
Definition at line 150 of file tgSpringCableActuator.cpp.
|
virtual |
Just calls tgModel::teardown(world) - sets up any children
Reimplemented from tgModel.
Reimplemented in tgKinematicActuator, and tgBasicActuator.
Definition at line 145 of file tgSpringCableActuator.cpp.
|
virtualinherited |
Returns the tag names of this model and its children
[in] | prefix | a string to append to |
Definition at line 152 of file tgModel.cpp.
|
protected |
A copy of the configuration POD supplied at constuction. This is not const.
Definition at line 286 of file tgSpringCableActuator.h.
|
protected |
All history sequences.
Definition at line 289 of file tgSpringCableActuator.h.
|
protected |
Tracking the most recent velocity to avoid using deques when history is off.
Definition at line 314 of file tgSpringCableActuator.h.
|
protected |
Motor Model Parameters The current rest length of the spring cable. Directly sets the m_restLength parameter of m_springCable in the appropreate child class functions
Definition at line 301 of file tgSpringCableActuator.h.
|
protected |
The tgSpringCable system this actuator acts upon
Definition at line 280 of file tgSpringCableActuator.h.
|
protected |
Tracking the start length to avoid using deques when history is off.
Definition at line 308 of file tgSpringCableActuator.h.