19 #ifndef BASE_SPINE_CPG_CONTROL_H
20 #define BASE_SPINE_CPG_CONTROL_H
31 #include "boost/multi_array.hpp"
50 typedef boost::multi_array<double, 2> array_2D;
51 typedef boost::multi_array<double, 4> array_4D;
79 double lp = -1 * M_PI,
90 const int segmentSpan;
91 const int theirMuscles;
94 const int segmentNumber;
97 const double controlTime;
101 const double highAmp;
102 const double lowFreq;
103 const double highFreq;
104 const double lowPhase;
105 const double highPhase;
108 const double tension;
109 const double kPosition;
110 const double kVelocity;
111 const bool useDefault;
112 const double controlLength;
117 std::string resourcePath =
"",
118 std::string ec =
"edgeConfig.ini",
119 std::string nc =
"nodeConfig.ini");
129 const double getCPGValue(std::size_t i)
const;
131 double getScore()
const;
139 virtual array_4D
scaleEdgeActions (std::vector< std::vector <double> > actions);
140 virtual array_2D scaleNodeActions (std::vector< std::vector <double> > actions);
146 std::vector<tgCPGActuatorControl*> m_allControllers;
150 std::string edgeConfigFilename;
151 std::string nodeConfigFilename;
165 std::vector<double> initConditions;
167 std::size_t segments;
173 std::vector<double> scores;
178 #endif // BASE_SPINE_CPG_CONTROL_H
virtual void onSetup(BaseSpineModelLearning &subject)
virtual void onStep(BaseSpineModelLearning &subject, double dt)
Definition of tgObserver class.
virtual void onTeardown(BaseSpineModelLearning &subject)
virtual void setupCPGs(BaseSpineModelLearning &subject, array_2D nodeActions, array_4D edgeActions)
Definition of tgSubject class.
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)
BaseSpineCPGControl(BaseSpineCPGControl::Config config, std::string args, std::string resourcePath="", std::string ec="edgeConfig.ini", std::string nc="nodeConfig.ini")
A template base class for a tensegrity spine.
Definition of tgObserver class.
virtual array_4D scaleEdgeActions(std::vector< std::vector< double > > actions)
Defines a class AnnealAdapter to pass parameters from AnnealEvolution to a controller. Adapting NeuroEvolution to do Simulated Annealing.