36 #include "LinearMath/btVector3.h"
73 double targetVelocity;
96 #endif // removed 12/10/14
112 const double half_length = c.rod_length / 2;
115 s.
addNode(-c.rod_space, -half_length, 0);
116 s.
addNode(-c.rod_space, half_length, 0);
117 s.
addNode( c.rod_space, -half_length, 0);
118 s.
addNode( c.rod_space, half_length, 0);
119 s.
addNode(0, -c.rod_space, -half_length);
120 s.
addNode(0, -c.rod_space, half_length);
121 s.
addNode(0, c.rod_space, -half_length);
122 s.
addNode(0, c.rod_space, half_length);
123 s.
addNode(-half_length, 0, c.rod_space);
124 s.
addNode( half_length, 0, c.rod_space);
125 s.
addNode(-half_length, 0, -c.rod_space);
126 s.
addNode( half_length, 0, -c.rod_space);
144 s.
addPair(12, 13,
"payload_rod");
195 s.
addPair(10, 13,
"muscle_in");
196 s.
addPair(11, 12,
"muscle_in");
204 const tgRod::Config rodConfig(c.radius, c.density, c.friction,
205 c.rollFriction, c.restitution);
207 const tgRod::Config payConfig(c.radius_pay, c.density_pay, c.friction,
208 c.rollFriction, c.restitution);
212 c.maxTens, c.targetVelocity);
215 c.maxTens, c.targetVelocity);
222 s.move(btVector3(0, 30, 0));
225 btVector3 rotationPoint1 = btVector3(0, 0, 0);
226 btVector3 rotationAxis1 = btVector3(1, 0, 0);
227 double rotationAngle1 = 0.4636;
228 s.
addRotation(rotationPoint1, rotationAxis1, rotationAngle1);
230 btVector3 rotationPoint2 = btVector3(0, 0, 0);
231 btVector3 rotationAxis2 = btVector3(0, 1, 0);
232 double rotationAngle2 = 1.991;
233 s.
addRotation(rotationPoint2, rotationAxis2, rotationAngle2);
235 btVector3 rotationPoint3 = btVector3(0, 0, 0);
236 btVector3 rotationAxis3 = btVector3(-1, 0, 0);
237 double rotationAngle3 = 0.58895;
238 s.
addRotation(rotationPoint3, rotationAxis3, rotationAngle3);
242 spec.addBuilder(
"rod",
new tgRodInfo(rodConfig));
243 spec.addBuilder(
"payload_rod",
new tgRodInfo(payConfig));
251 structureInfo.buildInto(*
this, world);
255 allMuscles = tgCast::filter<tgModel, tgSpringCableActuator> (
getDescendants());
269 throw std::invalid_argument(
"dt is not positive");
virtual void setup(tgWorld &world)
Definition of class tgRodInfo.
virtual void step(double dt)
virtual void onVisit(tgModelVisitor &r)
const std::vector< tgBasicActuator * > & getAllMuscles() const
Definition of class tgBasicActuatorInfo.
virtual void onVisit(const tgModelVisitor &r) const
virtual void setup(tgWorld &world)
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
void addRotation(const btVector3 &fixedPoint, const btVector3 &axis, double angle)
virtual void step(double dt)
Definition of class tgStructure.
Definition of class tgStructureInfo.
Contains the definition of class tgRod.
Definition of class tgBuildSpec.
void notifyStep(double dt)
std::vector< tgModel * > getDescendants() const
void addNode(double x, double y, double z, std::string tags="")