39 static const double kDefaultOffsetTension = 0.001;
46 static const double kDefaultLengthStiffness = 0.0;
53 static const double kDefaultVelocityStiffness = 0.0;
56 m_offsetTension(kDefaultOffsetTension),
57 m_lengthStiffness(kDefaultLengthStiffness),
58 m_velStiffness(kDefaultVelocityStiffness)
68 double lengthStiffness,
69 double velStiffness) :
70 m_offsetTension(offsetTension),
71 m_lengthStiffness(lengthStiffness),
72 m_velStiffness(velStiffness)
75 assert(offsetTension >= 0.0);
76 assert(lengthStiffness >= 0.0);
77 assert(velStiffness >= 0.0);
98 static inline double determineSetTension(
double offset,
102 return std::max(static_cast<double>(0.0), offset + displacement + velocity);
107 double deltaTimeSeconds,
111 return controlTension( mLocalController,
120 double deltaTimeSeconds,
122 double offsetTension,
134 const double setTension =
135 determineSetTension(offsetTension,
139 const double currentTension = mString->
getTension();
141 mLocalController.
control(deltaTimeSeconds, setTension, currentTension);
146 assert(setTension >= 0.0);
153 double deltaTimeSeconds,
157 return controlTension( mBasicActuator,
166 double deltaTimeSeconds,
168 double offsetTension,
174 const double setTension =
175 determineSetTension(offsetTension,
182 assert(setTension >= 0.0);
190 assert(offsetTension >= 0.0);
202 assert(lengthStiffness >= 0.0);
214 assert(velStiffness >= 0.0);
223 bool tgImpedanceController::invariant()
const
Contains the definition of class ImpedanceControl. $Id$.
void setLengthStiffness(double lengthStiffness)
Definition of the tgTensionController base class.
virtual const double getTension() const
Utility class for class casting and filtering collections by type.
virtual void control(double dt)
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
virtual const double getVelocity() const
const tgControllable *const getControllable() const
Contains the definition of class tgBasicActuator.
tgImpedanceController()
Constructors.
void setVelStiffness(double velStiffness)
virtual void control(double dt)
Definition of the tgBasicController base class.
double control(tgBasicController &mLocalController, double deltaTimeSeconds, double newPosition, double offsetVel=0)
Control Functions.
void setOffsetTension(double offsetTension)
virtual const double getCurrentLength() const