52 minActualLength(mnAL),
58 throw std::invalid_argument(
"stiffness is negative.");
62 throw std::invalid_argument(
"damping is negative.");
66 throw std::invalid_argument(
"max tension is negative.");
70 throw std::invalid_argument(
"max acceleration is negative.");
74 throw std::invalid_argument(
"min Actual Length is negative.");
78 throw std::invalid_argument(
"min Rest Length is negative.");
87 minActualLength *= sf;
93 void tgBaseString::constructorAux()
97 throw std::invalid_argument(
"Target velocity is negative.");
101 throw std::invalid_argument(
"Maximum acceleration is negative.");
105 throw std::invalid_argument(
"Minimum length is negative.");
109 throw std::invalid_argument(
"Starting rest length is negative.");
115 double actualLength) :
134 double actualLength) :
136 m_pHistory(new BaseStringHistory()),
138 m_restLength(restLength),
139 m_preferredLength(m_restLength),
140 m_startLength(actualLength),
169 throw std::invalid_argument(
"dt is not positive.");
177 void tgBaseString::setRestLength(
double newLength,
float dt)
181 throw std::invalid_argument(
"Rest length is negative.");
185 m_preferredLength = newLength;
191 assert(m_preferredLength == newLength);
194 bool tgBaseString::invariant()
const
203 (m_preferredLength >= 0.0) &&
virtual void setup(tgWorld &world)
Contains the definition of abstract base class tgBaseString. Assumes that the string is linear (F = -...
virtual void step(double dt)
virtual void step(double dt)
virtual void setup(tgWorld &wdorld)
virtual void moveMotors(double dt)=0
Contains the definition of class tgWorld $Id$.
Config(double s=1000.0, double d=10.0, bool h=false, double rot=0, double mf=1000.0, double tVel=100.0, double mxAcc=10000.0, double mnAL=0.1, double mnRL=0.1)
BaseStringHistory *const m_pHistory
tgBaseString(const tgTags &tags, tgBaseString::Config &config, double restLength, double actualLength)