NTRT Simulator
|
#include <BaseSpineCPGControl.h>
Classes | |
struct | Config |
Public Member Functions | |
BaseSpineCPGControl (BaseSpineCPGControl::Config config, std::string args, std::string ec="edgeConfig.ini", std::string nc="nodeConfig.ini") | |
virtual void | onStep (BaseSpineModelLearning &subject, double dt) |
virtual void | onSetup (BaseSpineModelLearning &subject) |
virtual void | onTeardown (BaseSpineModelLearning &subject) |
virtual void | onAttach (BaseSpineModelLearning &subject) |
Protected Member Functions | |
virtual array_4D | scaleEdgeActions (std::vector< std::vector< double > > actions) |
virtual array_2D | scaleNodeActions (std::vector< std::vector< double > > actions) |
virtual void | setupCPGs (BaseSpineModelLearning &subject, array_2D nodeActions, array_4D edgeActions) |
Protected Attributes | |
CPGEquations * | m_pCPGSys |
std::vector< tgCPGStringControl * > | m_allControllers |
BaseSpineCPGControl learns the parameters for a CPG system on a spine like tensegrity structure specified as a BaseSpineModelLearning. Parameters are generated by AnnealEvolution and used in the CPGEquations family of classes. ImpedanceControl controllers are used for the detailed muscle control. Due to the number of parameters, the learned parameters are split into one config file for the nodes and another for the CPG's "edges"
Definition at line 59 of file BaseSpineCPGControl.h.
BaseSpineCPGControl::BaseSpineCPGControl | ( | BaseSpineCPGControl::Config | config, |
std::string | args, | ||
std::string | ec = "edgeConfig.ini" , |
||
std::string | nc = "nodeConfig.ini" |
||
) |
Defining the adapters here assumes the controller is around and attached for the lifecycle of the learning runs. I.E. that the setup and teardown functions are used for tgModel
Definition at line 124 of file BaseSpineCPGControl.cpp.
|
inlinevirtualinherited |
Notify the observers when an attach action has occurred. Will only occur once, typically before setup
[in,out] | subject | the subject being observed |
Definition at line 54 of file tgObserver.h.
|
virtual |
Notify the observers when a setup action has occurred.
[in,out] | subject | the subject being observed |
Reimplemented from tgObserver< BaseSpineModelLearning >.
Definition at line 148 of file BaseSpineCPGControl.cpp.
|
virtual |
Notify the observers when a step action has occurred.
[in,out] | subject | the subject being observed |
[in] | the | number of seconds since the previous call; must be positive |
Implements tgObserver< BaseSpineModelLearning >.
Definition at line 223 of file BaseSpineCPGControl.cpp.
|
virtual |
Notify the observers when a teardown action has occurred.
[in,out] | subject | the subject being observed |
Reimplemented from tgObserver< BaseSpineModelLearning >.
Definition at line 241 of file BaseSpineCPGControl.cpp.
|
protectedvirtual |
Takes a vector of parameters reported by learning, and then converts it into a format used to assign to the CPGEdges Note that if the CPG edges change, this will need to change
Definition at line 297 of file BaseSpineCPGControl.cpp.
|
protectedvirtual |
Reimplemented in TetraSpineCPGControl.
Definition at line 181 of file BaseSpineCPGControl.cpp.