#include <JSONCPGControl.h>
Inherits tgObserver< BaseSpineModelLearning >, and tgSubject< JSONCPGControl >.
Inherited by JSONFeedbackControl, JSONGoalControl, JSONMixedLearningControl, JSONQuadFeedbackControl, JSONQuadFeedbackControl, and JSONQuadFeedbackControl.
JSONCPGControl 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. tgImpedanceController 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 58 of file JSONCPGControl.h.
JSONCPGControl::JSONCPGControl |
( |
JSONCPGControl::Config |
config, |
|
|
std::string |
args, |
|
|
std::string |
resourcePath = "" |
|
) |
| |
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 138 of file JSONCPGControl.cpp.
Attach an observer to the subject of the observer.
- Parameters
-
[in,out] | pObserver | a pointer to an observer for the subject; do nothing if the pointer is NULL |
Call tgObserver<T>::onStep() on all observers in the order in which they were attached.
- Parameters
-
[in] | dt | the number of seconds since the previous call; do nothing if not positive |
Notify the observers when an attach action has occurred. Will only occur once, typically before setup
- Parameters
-
[in,out] | subject | the subject being observed |
Definition at line 55 of file tgObserver.h.
Notify the observers when a setup action has occurred.
- Parameters
-
[in,out] | subject | the subject being observed |
Reimplemented from tgObserver< BaseSpineModelLearning >.
Reimplemented in JSONGoalControl, JSONQuadFeedbackControl, JSONMixedLearningControl, JSONQuadFeedbackControl, JSONQuadFeedbackControl, JSONFeedbackControl, OctahedralGoalControl, OctahedralTensionControl, JSONGoalTensionNNW, and JSONGoalTension.
Definition at line 164 of file JSONCPGControl.cpp.
Notify the observers when a step action has occurred.
- Parameters
-
[in,out] | subject | the subject being observed |
[in] | the | number of seconds since the previous call; must be positive |
- Todo:
- add to config
- Todo:
- if bogus, stop trial (reset simulation)
Implements tgObserver< BaseSpineModelLearning >.
Reimplemented in JSONGoalControl, JSONQuadFeedbackControl, JSONMixedLearningControl, JSONQuadFeedbackControl, JSONQuadFeedbackControl, JSONFeedbackControl, OctahedralGoalControl, OctahedralTensionControl, JSONGoalTensionNNW, and JSONGoalTension.
Definition at line 254 of file JSONCPGControl.cpp.
Notify the observers when a teardown action has occurred.
- Parameters
-
[in,out] | subject | the subject being observed |
- Todo:
- consolidate with other controller classes.
- Todo:
- return length scale as a parameter
Reimplemented from tgObserver< BaseSpineModelLearning >.
Reimplemented in JSONGoalControl, JSONQuadFeedbackControl, JSONMixedLearningControl, JSONQuadFeedbackControl, JSONQuadFeedbackControl, JSONFeedbackControl, OctahedralGoalControl, OctahedralTensionControl, JSONGoalTensionNNW, and JSONGoalTension.
Definition at line 282 of file JSONCPGControl.cpp.
array_4D JSONCPGControl::scaleEdgeActions |
( |
Json::Value |
edgeParam | ) |
|
|
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
- Todo:
- consider adding exception here
Reimplemented in JSONQuadFeedbackControl.
Definition at line 390 of file JSONCPGControl.cpp.
void JSONCPGControl::setupCPGs |
( |
BaseSpineModelLearning & |
subject, |
|
|
array_2D |
nodeActions, |
|
|
array_4D |
edgeActions |
|
) |
| |
|
protectedvirtual |
The documentation for this class was generated from the following files: