42 assert(controllable != NULL);
54 throw std::runtime_error (
"Timestep must be positive.");
59 const double stiffness = m_springCable->
getCoefK();
61 assert(stiffness > 0.0);
63 const double currentTension = m_springCable->
getTension();
64 const double delta =
m_setPoint - currentTension;
65 double diff = delta / stiffness;
71 newLength = newLength < 0.0 ? 0.0 : newLength;
80 throw std::runtime_error (
"Timestep must be positive.");
94 throw std::runtime_error (
"Timestep must be positive.");
99 const double stiffness = m_springCable->
getCoefK();
101 assert(stiffness > 0.0);
103 const double currentTension = m_springCable->
getTension();
104 const double delta = setPoint - currentTension;
105 double diff = delta / stiffness;
111 newLength = newLength < 0.1 ? 0.1 : newLength;
Definitions of class tgSpringCable.
Definition of the tgTensionController base class.
virtual ~tgTensionController()
Utility class for class casting and filtering collections by type.
virtual void setControlInput(double input)
virtual void control(double dt)
virtual const double getRestLength() const
virtual void setNewSetPoint(double newSetPoint)
Contains the definition of class tgBasicActuator.
virtual const double getCoefK() const
virtual const double getTension() const =0
tgTensionController(tgBasicActuator *controllable, double setPoint=0.0)
virtual const double getRestLength() const
const tgSpringCable * getSpringCable() const