54 m_dataObserver(
"logs/vertspine_1-2-3-4_")
66 m_dataObserver.
onSetup(subject);
76 throw std::invalid_argument(
"dt is not positive");
81 if (updateTime >= 1.0/100)
87 m_dataObserver.
onStep(subject, m_updateTime);
90 if(verticalRLA1 <= 2.0 && state == -1.0)
94 else if (verticalRLA1 >= 4.0 && state == 1.0)
104 else if (state == 1.0)
112 const std::vector<tgSpringCableActuator*> muscles = subject.
getAllMuscles();
115 const std::vector<tgSpringCableActuator*> v_musclesA = subject.
getMuscles(
"vertical a");
116 const std::vector<tgSpringCableActuator*> v_musclesB = subject.
getMuscles(
"vertical b");
117 const std::vector<tgSpringCableActuator*> v_musclesC = subject.
getMuscles(
"vertical c");
118 const std::vector<tgSpringCableActuator*> v_musclesD = subject.
getMuscles(
"vertical d");
122 for (
size_t i = 0; i < v_musclesA.size(); ++ i)
126 assert(pMuscleA != NULL);
137 assert(pMuscleB != NULL);
VerticalSpineBendingController()
const std::vector< tgSpringCableActuator * > & getMuscles(const std::string &key) const
virtual void setControlInput(double input)=0
Convenience function for combining strings with ints, mostly for naming structures.
Contains the definition of class VerticalSpineModel.
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
A series of functions to assist with file input/output.
Definition of tgObserver class.
virtual void onStep(VerticalSpineModel &subject, double dt)
virtual void onSetup(VerticalSpineModel &subject)
Contains the definition of class VerticalSpineBendingController.
virtual void onStep(tgModel &model, double dt)
virtual void onSetup(tgModel &model)
void notifyStep(double dt)
const std::vector< tgSpringCableActuator * > & getAllMuscles() const