28 #include "T6RestLengthController.h"
42 m_restLengthDiff(restLengthDiff),
43 m_controllerMuscleRatio(subject->muscleRatio())
45 if (restLengthDiff < 0.0)
47 throw std::invalid_argument(
"You tried to push a rope!");
57 const std::vector<tgBasicActuator*> activeMuscles = subject.
getActiveMuscles();
60 for (
size_t i = 0; i < passiveMuscles.size(); ++i)
63 assert(pMuscle != NULL);
67 pMuscle->setRestLengthSingleStep(desiredRestLength);
69 for (
size_t i = 0; i < activeMuscles.size(); ++i)
72 assert(pMuscle != NULL);
76 pMuscle->setRestLengthSingleStep(desiredRestLength);
83 const std::vector<tgBasicActuator*> strings = subject.
getAllMuscles();
89 for(
size_t i=0; i<strings.size(); i++)
91 std::cout << (strings[i]->getTension())/10 <<
"\t";
94 for(
size_t i=0; i<strings.size(); i++)
96 std::cout << (strings[i]->getCurrentLength())/10 <<
"\t";
virtual const double getStartLength() const
T6RestLengthController(T6Model *subject, const double restLengthDiff=4)
const std::vector< tgBasicActuator * > & getAllMuscles() const
const std::vector< tgBasicActuator * > & getPassiveMuscles() const
Contains the definition of class tgBasicActuator.
virtual void onSetup(T6Model &subject)
const std::vector< tgBasicActuator * > & getActiveMuscles() const
Rand seeding simular to the evolution and terrain classes.
Definitions of classes tgBulletSpringCable $Id$.
virtual void onStep(T6Model &subject, double dt)