19 #include "tgCPGInfo.h"
32 assert(m_nodeNum == -1);
38 std::vector<double> params (7);
39 params[0] = nodeParams[0][0];
40 params[1] = nodeParams[0][1];
41 params[2] = nodeParams[0][2];
42 params[3] = nodeParams[0][3];
47 m_nodeNum = p_CPGSys->addNode(params);
51 std::vector<tgConnectorInfo*> allStrings,
54 assert(m_nodeNum >= 0);
56 int muscleSize = edgeParams.shape()[1];
58 tgRigidInfo* fromGroup = thisString->getFromRigidInfo();
59 tgRigidInfo* toGroup = thisString->getToRigidInfo();
61 std::vector<int> connectivityList;
62 std::vector<double> weights;
63 std::vector<double> phases;
72 for (
int i = 0; i < allStrings.size(); i++)
74 if (thisString != allStrings[i])
76 tgRigidInfo* theirFromGroup = allStrings[i]->getFromRigidInfo()
78 tgRigidInfo* theirToGroup = allStrings[i]->getToRigidInfo()
82 if(fromGroup == theirFromGroup ||
83 toGroup == theirToGroup ||
84 fromGroup == theirToGroup ||
85 toGroup == theirFromGroup)
87 int theirMuscle = allStrings[i]->getNodeNumber();
89 int rp = ((m_nodeNum - theirMuscle) / muscleSize) + 1;
90 int j = m_nodeNum % muscleSize;
91 int k = theirMuscle % muscleSize;
92 connectivityList.push_back(theirMuscle);
95 weights.push_back(edgeParams[rp][k][j][0]);
96 phases.push_back(edgeParams[rp][k][j][1]);
100 weights.push_back(edgeParams[rp][j][k][0]);
101 phases.push_back(edgeParams[rp][j][k][1]);
107 p_CPGSys->defineConnections(m_nodeNum, connectivityList, weights, phases);
116 string->setupControl(m_nodeNum, p_CPGSys, p_ipc);
Definition of abstract class tgRigidInfo.
void addControlInfo(tgBaseCPGNode *string)
virtual tgRigidInfo * getRigidInfoGroup()
void setConnectivity(tgConnectorInfo *thisString, std::vector< tgConnectorInfo * > allStrings, array_4D edgeParams)
Definition of class tgConnectorInfo.
Contains the definition of class ImpedanceControl. $Id$.
tgCPGInfo(CPGEquations *CPGSys, array_2D nodeParams)
Definition of class CPGEquations.
Definition of class tgBaseCPGNode.