19 #ifndef JSON_HIERARCHY_FEEDBACK_CONTROL_H
20 #define JSON_HIERARCHY_FEEDBACK_CONTROL_H
31 #include "dev/dhustigschultz/BP_SC_NoLegs_Stats/JSONQuadCPGControl.h"
33 #include <json/value.h>
66 double lp = -1 * M_PI,
93 const double freqFeedbackMin;
94 const double freqFeedbackMax;
95 const double ampFeedbackMin;
96 const double ampFeedbackMax;
97 const double phaseFeedbackMin;
98 const double phaseFeedbackMax;
101 const double maxHeight;
102 const double minHeight;
114 int theirHighMuscles;
117 const double highFreq2;
118 const double freqFeedbackMax2;
123 std::string resourcePath =
"");
135 virtual void setupCPGs(
BaseQuadModelLearning& subject, array_2D spineNodeActions, array_2D legNodeActions, array_4D spineEdgeActions, array_4D hipEdgeActions, array_4D legEdgeActions);
137 virtual void setupHighCPGs(
BaseQuadModelLearning& subject, array_2D highNodeActions, array_4D highEdgeActions);
142 virtual array_2D scaleNodeActions (Json::Value actions,
double highFreq,
double freqFeedbackMax);
144 virtual array_4D
scaleEdgeActions (Json::Value actions,
int segmentSpan,
int theirMuscles,
int ourMuscles);
150 std::vector<double> transformFeedbackActions(std::vector< std::vector<double> >& actions);
155 std::vector<tgCPGActuatorControl*> m_spineControllers;
157 std::vector<tgCPGActuatorControl*> m_leftShoulderControllers;
158 std::vector<tgCPGActuatorControl*> m_rightShoulderControllers;
160 std::vector<tgCPGActuatorControl*> m_leftHipControllers;
161 std::vector<tgCPGActuatorControl*> m_rightHipControllers;
163 std::vector<tgCPGActuatorControl*> m_leftForelegControllers;
164 std::vector<tgCPGActuatorControl*> m_rightForelegControllers;
166 std::vector<tgCPGActuatorControl*> m_leftHindlegControllers;
167 std::vector<tgCPGActuatorControl*> m_rightHindlegControllers;
172 std::vector<tgCPGActuatorControl*> m_highControllers;
177 std::vector< std::vector<double> > m_quadCOM;
181 #endif // JSON_HIERARCHY_FEEDBACK_CONTROL_H
JSONHierarchyFeedbackControl(JSONHierarchyFeedbackControl::Config config, std::string args, std::string resourcePath="")
virtual void onTeardown(BaseQuadModelLearning &subject)
virtual void onStep(BaseQuadModelLearning &subject, double dt)
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 ohighm=5, int thighm=5, double hf2=20.0, double ffMax2=0.0)
virtual void onSetup(BaseQuadModelLearning &subject)
virtual array_4D scaleEdgeActions(Json::Value actions, int segmentSpan, int theirMuscles, int ourMuscles)