19 #ifndef JSON_QUAD_CPG_CONTROL_H
20 #define JSON_QUAD_CPG_CONTROL_H
32 #include "dev/dhustigschultz/BigPuppy_SpineOnly_Stats/BaseQuadModelLearning.h"
35 #include "boost/multi_array.hpp"
41 #include <json/value.h>
51 typedef boost::multi_array<double, 2> array_2D;
52 typedef boost::multi_array<double, 4> array_4D;
80 double lp = -1 * M_PI,
91 const int segmentSpan;
92 const int theirMuscles;
95 const int segmentNumber;
98 const double controlTime;
102 const double highAmp;
103 const double lowFreq;
104 const double highFreq;
105 const double lowPhase;
106 const double highPhase;
109 const double tension;
110 const double kPosition;
111 const double kVelocity;
112 const bool useDefault;
113 const double controlLength;
118 std::string resourcePath =
"");
128 const double getCPGValue(std::size_t i)
const;
130 double getScore()
const;
139 virtual array_2D scaleNodeActions (Json::Value actions);
145 std::vector<tgCPGActuatorControl*> m_allControllers;
149 std::vector<double> initConditions;
151 std::size_t segments;
158 std::vector<double> scores;
159 std::vector<double> metrics;
163 std::string controlFilename;
164 std::string controlFilePath;
167 #endif // BASE_SPINE_CPG_CONTROL_H
virtual void onStep(BaseQuadModelLearning &subject, double dt)
virtual void onSetup(BaseQuadModelLearning &subject)
Definition of tgObserver class.
Definition of tgSubject class.
JSONQuadCPGControl(JSONQuadCPGControl::Config config, std::string args, std::string resourcePath="")
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)
Definition of tgObserver class.
virtual void onTeardown(BaseQuadModelLearning &subject)
virtual void setupCPGs(BaseQuadModelLearning &subject, array_2D nodeActions, array_4D edgeActions)
virtual array_4D scaleEdgeActions(Json::Value edgeParam)