30 #include "dev/btietz/kinematicString/tgSCASineControl.h"
44 #include "LinearMath/btVector3.h"
64 double triangle_length;
65 double triangle_height;
82 useKinematic(kinematic),
90 for(std::size_t i = 0; i < m_tgSCASineControllers.size(); i++)
92 delete m_tgSCASineControllers[i];
94 m_tgSCASineControllers.clear();
120 void pidTestRig::setupControl()
123 assert(allMuscles.size() > 0);
125 const double controlStep = 0.01;
128 const double amplitude = 5.0;
129 const double frequency = 0.2;
130 const double phase = 0.0;
131 const double offset = 0.0;
134 for (std::size_t i = 0; i < allMuscles.size(); i++)
136 tgKinematicActuator* kinString = tgCast::cast<tgSpringCableActuator, tgKinematicActuator>(allMuscles[i]);
147 kinString->
attach(sineController);
149 m_tgSCASineControllers.push_back(sineController);
173 s.move(btVector3(0, 5, 0));
178 spec.addBuilder(
"rod",
new tgRodInfo(rodConfig));
179 spec.addBuilder(
"rod2",
new tgRodInfo(rodConfig2));
197 structureInfo.buildInto(*
this, world);
201 allMuscles = tgCast::filter<tgModel, tgSpringCableActuator> (
getDescendants());
222 throw std::invalid_argument(
"dt is not positive");
231 if (allMuscles[0]->getRestLength() <= 5.0 && !reached)
233 std::cout <<
"Rest length below 5.0 at: " << totalTime << std::endl;
Contains the definition of class ImpedanceControl. $Id$.
pidTestRig(bool kinematic=true)
virtual void setup(tgWorld &world)
Definition of class tgRodInfo.
const std::vector< tgSpringCableActuator * > & getAllMuscles() const
virtual void onVisit(tgModelVisitor &r)
virtual void step(double dt)
Definition of class tgBasicActuatorInfo.
virtual void onVisit(const tgModelVisitor &r) const
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
virtual void setup(tgWorld &world)
Contains the definition of class tgBasicActuator.
Definition of class tgStructure.
Definition of class tgStructureInfo.
Defines a 3 strut 9 string tensegrity model.
Contains the definition of class tgKinematicActuator.
Definition of class tgKinematicActuatorInfo.
virtual void step(double dt)
Contains the definition of class tgRod.
void attach(tgObserver< T > *pObserver)
Definition of class tgBuildSpec.
Definition of the tgPIDController class.
void notifyStep(double dt)
std::vector< tgModel * > getDescendants() const
void addNode(double x, double y, double z, std::string tags="")