38 #include "LinearMath/btVector3.h"
69 double targetVelocity;
70 bool moveCablePointAToEdge;
71 bool moveCablePointBToEdge;
109 void tgBoxAnchorDebugModel::addNodes(
tgStructure& s)
113 s.
addNode(0, 2 * c.rodLength, 0);
114 s.
addNode(0, 3 * c.rodLength, 0);
117 void tgBoxAnchorDebugModel::addRods(
tgStructure& s)
123 void tgBoxAnchorDebugModel::addActuators(
tgStructure& s)
131 const tgRod::Config rodConfig(c.radius, c.density, c.friction,
132 c.rollFriction, c.restitution);
136 c.hist, c.maxTens, c.targetVelocity);
141 muscleConfig.moveCablePointBToEdge = c.moveCablePointBToEdge;
174 s.move(btVector3(0, 5, 0));
203 spec.addBuilder(
"rod",
new tgRodInfo(rodConfig));
214 allActuators = tgCast::filter<tgModel, tgBasicActuator> (
getDescendants());
220 std::vector<tgRod*> allRods = tgCast::filter<tgModel, tgRod>(all_children);
222 std::cout <<
"tgBoxAnchorDebugDemo tgRods: " << std::endl;
223 for (
size_t i = 0; i < allRods.size(); i++)
225 std::cout <<
"rod number " << i <<
": " << std::endl;
226 std::cout <<
"tags: " << allRods[i]->getTags() << std::endl;
227 std::cout << allRods[i]->toString() << std::endl;
231 for (
size_t i = 0; i < allRods.size(); i++)
234 allRodSensors.push_back(rodsensor_i);
257 throw std::invalid_argument(
"dt is not positive");
virtual void setup(tgWorld &world)
virtual void setup(tgWorld &world)
Definition of class tgRodInfo.
virtual void step(double dt)
bool moveCablePointAToEdge
virtual ~tgBoxAnchorDebugModel()
virtual void step(double dt)
const std::vector< tgBasicActuator * > & getAllActuators() const
Definition of class tgBasicActuatorInfo.
virtual void onVisit(const tgModelVisitor &r) const
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
Constains definition of concrete class tgRodSensor.
Contains the definition of class tgBasicActuator.
Definition of class tgStructure.
Definition of class tgStructureInfo.
Contains the definition of class tgBoxAnchorDebugModel. $Id$.
Contains the definition of class tgRod.
Definition of class tgBuildSpec.
void notifyStep(double dt)
virtual void onVisit(tgModelVisitor &r)
std::vector< tgModel * > getDescendants() const
void buildInto(tgModel &model, tgWorld &world)
void addNode(double x, double y, double z, std::string tags="")