NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgSpringCable Class Referenceabstract

#include <tgSpringCable.h>

Inheritance diagram for tgSpringCable:

Public Member Functions

 tgSpringCable (const std::vector< tgSpringCableAnchor * > &anchors, double coefK, double dampingCoefficient, double pretension=0.0)
 
virtual ~tgSpringCable ()
 
virtual void step (double dt)=0
 
virtual const double getRestLength () const
 
virtual void setRestLength (const double newRestLength)
 
virtual const double getActualLength () const =0
 
virtual const double getTension () const =0
 
virtual const double getCoefK () const
 
virtual const double getCoefD () const
 
virtual const double getVelocity () const
 
virtual const double getDamping () const
 
virtual const std::vector
< const tgSpringCableAnchor * > 
getAnchors () const =0
 

Protected Attributes

double m_damping
 
double m_velocity
 
const double m_coefK
 
const double m_dampingCoefficient
 
double m_restLength
 
double m_prevLength
 

Detailed Description

An abstract base class defining the interface for a spring cable model. This either represents a long elastic member, or a stiff cable connected to a more flexible spring.

Definition at line 40 of file tgSpringCable.h.

Constructor & Destructor Documentation

tgSpringCable::tgSpringCable ( const std::vector< tgSpringCableAnchor * > &  anchors,
double  coefK,
double  dampingCoefficient,
double  pretension = 0.0 
)

The only constructor. Takes a list of anchors, a coefficient of stiffness, a coefficent of damping, and optionally the amount of pretension in the cable

Parameters
[in]anchors- a list of this spring cable's attachements
[in]coefK- the stiffness of the spring. Must be positive
[in]dampingCoefficient- the damping in the spring. Must be non-negative
[in]pretension- must be small enough to keep the rest length positive

Definition at line 33 of file tgSpringCable.cpp.

tgSpringCable::~tgSpringCable ( )
virtual

The virtual destructor. Does nothing

Definition at line 62 of file tgSpringCable.cpp.

Member Function Documentation

virtual const double tgSpringCable::getActualLength ( ) const
pure virtual

Pure virtual funciton, returns the actual length of the spring cable

Implemented in tgBulletContactSpringCable, and tgBulletSpringCable.

Here is the caller graph for this function:

virtual const std::vector<const tgSpringCableAnchor*> tgSpringCable::getAnchors ( ) const
pure virtual

Child classes will store their type of anchors, but should always define a way to return a vector of base anchors

Implemented in tgBulletSpringCable.

virtual const double tgSpringCable::getCoefD ( ) const
inlinevirtual

Get the coefficent of damping

Definition at line 103 of file tgSpringCable.h.

virtual const double tgSpringCable::getCoefK ( ) const
inlinevirtual

Get the coefficent of stiffness

Definition at line 95 of file tgSpringCable.h.

Here is the caller graph for this function:

virtual const double tgSpringCable::getDamping ( ) const
inlinevirtual

Get the last value of the damping force

Definition at line 119 of file tgSpringCable.h.

const double tgSpringCable::getRestLength ( ) const
virtual

Returns m_restLength

Definition at line 66 of file tgSpringCable.cpp.

virtual const double tgSpringCable::getTension ( ) const
pure virtual

Pure virtual function, returns the current tension

Implemented in tgBulletSpringCable.

Here is the caller graph for this function:

virtual const double tgSpringCable::getVelocity ( ) const
inlinevirtual

Get the last change in length / time

Definition at line 111 of file tgSpringCable.h.

Here is the caller graph for this function:

void tgSpringCable::setRestLength ( const double  newRestLength)
virtual

Sets m_restLength to newRestLength.

Parameters
[in]newRestLength,mustbe non-negative

Definition at line 71 of file tgSpringCable.cpp.

Here is the caller graph for this function:

virtual void tgSpringCable::step ( double  dt)
pure virtual

The function called by model classes to update this class for a given step

Parameters
[in]dt- elapsed time since the last step

Implemented in tgBulletContactSpringCable, and tgBulletSpringCable.

Here is the caller graph for this function:

Member Data Documentation

const double tgSpringCable::m_coefK
protected

The stiffness coefficient Units of mass / sec ^2 Must be positive

Definition at line 149 of file tgSpringCable.h.

double tgSpringCable::m_damping
protected

The previous value of the damping force. Stored so we can get it without passing a dt

Definition at line 136 of file tgSpringCable.h.

const double tgSpringCable::m_dampingCoefficient
protected

The damping coefficient. Units of mass / sec. Must be non-negative

Definition at line 156 of file tgSpringCable.h.

double tgSpringCable::m_prevLength
protected

The previous actual length of the string. Used when calculating force and velocity

Definition at line 168 of file tgSpringCable.h.

double tgSpringCable::m_restLength
protected

The rest length of the string. Must be non negative

Definition at line 162 of file tgSpringCable.h.

double tgSpringCable::m_velocity
protected

The velocity of the string at the last update step. Stored so we can get it without passing a dt

Definition at line 142 of file tgSpringCable.h.


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