NTRT Simulator
Version: Master
|
#include <JSONHierarchyFeedbackControl.h>
Classes | |
struct | Config |
Public Member Functions | |
JSONHierarchyFeedbackControl (JSONHierarchyFeedbackControl::Config config, std::string args, std::string resourcePath="") | |
virtual void | onSetup (BaseQuadModelLearning &subject) |
virtual void | onStep (BaseQuadModelLearning &subject, double dt) |
virtual void | onTeardown (BaseQuadModelLearning &subject) |
const double | getCPGValue (std::size_t i) const |
double | getScore () const |
virtual void | onAttach (BaseQuadModelLearning &subject) |
void | attach (tgObserver< JSONQuadCPGControl > *pObserver) |
void | notifyStep (double dt) |
void | notifySetup () |
void | notifyTeardown () |
Protected Member Functions | |
virtual void | setupCPGs (BaseQuadModelLearning &subject, array_2D spineNodeActions, array_2D legNodeActions, array_4D spineEdgeActions, array_4D hipEdgeActions, array_4D legEdgeActions) |
virtual void | setupHighCPGs (BaseQuadModelLearning &subject, array_2D highNodeActions, array_4D highEdgeActions) |
virtual void | setupHighLowCouplings (BaseQuadModelLearning &subject, Json::Value highLowEdgeActions) |
virtual array_2D | scaleNodeActions (Json::Value actions, double highFreq, double freqFeedbackMax) |
virtual array_4D | scaleEdgeActions (Json::Value actions, int segmentSpan, int theirMuscles, int ourMuscles) |
std::vector< double > | getFeedback (BaseQuadModelLearning &subject) |
std::vector< double > | getCableState (const tgSpringCableActuator &cable) |
std::vector< double > | transformFeedbackActions (std::vector< std::vector< double > > &actions) |
virtual array_4D | scaleEdgeActions (Json::Value edgeParam) |
virtual array_2D | scaleNodeActions (Json::Value actions) |
virtual void | setupCPGs (BaseQuadModelLearning &subject, array_2D nodeActions, array_4D edgeActions) |
Protected Attributes | |
JSONHierarchyFeedbackControl::Config | m_config |
std::vector < tgCPGActuatorControl * > | m_spineControllers |
std::vector < tgCPGActuatorControl * > | m_leftShoulderControllers |
std::vector < tgCPGActuatorControl * > | m_rightShoulderControllers |
std::vector < tgCPGActuatorControl * > | m_leftHipControllers |
std::vector < tgCPGActuatorControl * > | m_rightHipControllers |
std::vector < tgCPGActuatorControl * > | m_leftForelegControllers |
std::vector < tgCPGActuatorControl * > | m_rightForelegControllers |
std::vector < tgCPGActuatorControl * > | m_leftHindlegControllers |
std::vector < tgCPGActuatorControl * > | m_rightHindlegControllers |
std::vector < tgCPGActuatorControl * > | m_highControllers |
neuralNetwork * | nn |
std::vector< std::vector < double > > | m_quadCOM |
CPGEquations * | m_pCPGSys |
std::vector < tgCPGActuatorControl * > | m_allControllers |
std::vector< double > | initConditions |
std::size_t | segments |
tgDataObserver | m_dataObserver |
double | m_updateTime |
double | m_totalTime |
std::vector< double > | scores |
std::vector< double > | metrics |
bool | bogus |
std::string | controlFilename |
std::string | controlFilePath |
JSONMetricsFeedbackControl 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 48 of file JSONHierarchyFeedbackControl.h.
JSONHierarchyFeedbackControl::JSONHierarchyFeedbackControl | ( | JSONHierarchyFeedbackControl::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 122 of file JSONHierarchyFeedbackControl.cpp.
|
inherited |
Attach an observer to the subject of the observer.
[in,out] | pObserver | a pointer to an observer for the subject; do nothing if the pointer is NULL |
|
inherited |
Call tgObserver<T>::onSetup() on all observers in the order in which they were attached.
|
inherited |
Call tgObserver<T>::onStep() on all observers in the order in which they were attached.
[in] | dt | the number of seconds since the previous call; do nothing if not positive |
|
inherited |
Call tgObserver<T>::onTeardown() on all observers in the order in which they were attached.
|
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 55 of file tgObserver.h.
|
virtual |
Notify the observers when a setup action has occurred.
[in,out] | subject | the subject being observed |
Reimplemented from JSONQuadCPGControl.
Definition at line 137 of file JSONHierarchyFeedbackControl.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 |
Max and min heights added to config
Reimplemented from JSONQuadCPGControl.
Definition at line 260 of file JSONHierarchyFeedbackControl.cpp.
|
virtual |
Notify the observers when a teardown action has occurred.
[in,out] | subject | the subject being observed |
Reimplemented from JSONQuadCPGControl.
Definition at line 305 of file JSONHierarchyFeedbackControl.cpp.
|
protectedvirtualinherited |
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 389 of file JSONQuadCPGControl.cpp.
|
protectedvirtual |
Definition at line 1099 of file JSONHierarchyFeedbackControl.cpp.
|
protectedvirtualinherited |
Definition at line 205 of file JSONQuadCPGControl.cpp.