19 #ifndef JSON_ACHILLES_HIERARCHY_CONTROL_H
20 #define JSON_ACHILLES_HIERARCHY_CONTROL_H
31 #include "dev/dhustigschultz/BP_SC_NoLegs_Stats/JSONQuadCPGControl.h"
33 #include <json/value.h>
66 double lp = -1 * M_PI,
95 const double freqFeedbackMin;
96 const double freqFeedbackMax;
97 const double ampFeedbackMin;
98 const double ampFeedbackMax;
99 const double phaseFeedbackMin;
100 const double phaseFeedbackMax;
103 const double maxHeight;
104 const double minHeight;
115 int ourAchillesMuscles;
116 int theirAchillesMuscles;
118 int theirHighMuscles;
121 const double highFreq2;
122 const double freqFeedbackMax2;
127 std::string resourcePath =
"");
139 virtual void setupCPGs(
BaseQuadModelLearning& subject, array_2D spineNodeActions, array_2D legNodeActions, array_4D spineEdgeActions, array_4D hipEdgeActions, array_4D legEdgeActions, array_4D achillesEdgeActions);
141 virtual void setupHighCPGs(
BaseQuadModelLearning& subject, array_2D highNodeActions, array_4D highEdgeActions);
146 virtual array_2D scaleNodeActions (Json::Value actions,
double highFreq,
double freqFeedbackMax);
148 virtual array_4D
scaleEdgeActions (Json::Value actions,
int segmentSpan,
int theirMuscles,
int ourMuscles);
154 std::vector<double> transformFeedbackActions(std::vector< std::vector<double> >& actions);
159 std::vector<tgCPGActuatorControl*> m_spineControllers;
161 std::vector<tgCPGActuatorControl*> m_leftShoulderControllers;
162 std::vector<tgCPGActuatorControl*> m_rightShoulderControllers;
164 std::vector<tgCPGActuatorControl*> m_leftHipControllers;
165 std::vector<tgCPGActuatorControl*> m_rightHipControllers;
167 std::vector<tgCPGActuatorControl*> m_leftForelegControllers;
168 std::vector<tgCPGActuatorControl*> m_rightForelegControllers;
170 std::vector<tgCPGActuatorControl*> m_leftHindlegControllers;
171 std::vector<tgCPGActuatorControl*> m_rightHindlegControllers;
173 std::vector<tgCPGActuatorControl*> m_leftFrontAchillesControllers;
174 std::vector<tgCPGActuatorControl*> m_rightFrontAchillesControllers;
176 std::vector<tgCPGActuatorControl*> m_leftRearAchillesControllers;
177 std::vector<tgCPGActuatorControl*> m_rightRearAchillesControllers;
179 std::vector<tgCPGActuatorControl*> m_highControllers;
184 std::vector< std::vector<double> > m_quadCOM;
188 #endif // JSON_ACHILLES_HIERARCHY_CONTROL_H
virtual void onTeardown(BaseQuadModelLearning &subject)
JSONAchillesHierarchyControl(JSONAchillesHierarchyControl::Config config, std::string args, std::string resourcePath="")
virtual void onStep(BaseQuadModelLearning &subject, double dt)
virtual array_4D scaleEdgeActions(Json::Value actions, int segmentSpan, int theirMuscles, int ourMuscles)
Config(int ss, int tm, int om, int param, int segnum=6, double ct=0.1, double la=0, double ha=30, double lp=-1 *M_PI, double hp=M_PI, double kt=0.0, double kp=1000.0, double kv=100.0, bool def=true, double cl=10.0, double lf=0.0, double hf=30.0, double ffMin=0.0, double ffMax=0.0, double afMin=0.0, double afMax=0.0, double pfMin=0.0, double pfMax=0.0, double maxH=60.0, double minH=1.0, int ohm=10, int thm=10, int olm=10, int tlm=10, int oam=2, int tam=2, int ohighm=5, int thighm=5, double hf2=20.0, double ffMax2=0.0)
virtual void onSetup(BaseQuadModelLearning &subject)