36 #include "LinearMath/btVector3.h"
61 double stiffness_passive;
62 double stiffness_active;
72 double targetVelocity;
89 #if (0) // Removed 12/10/14
110 const double half_length = c.rod_length / 2;
112 s.
addNode(-c.rod_space, -half_length, 0);
113 s.
addNode(-c.rod_space, half_length, 0);
114 s.
addNode( c.rod_space, -half_length, 0);
115 s.
addNode( c.rod_space, half_length, 0);
116 s.
addNode(0, -c.rod_space, -half_length);
117 s.
addNode(0, -c.rod_space, half_length);
118 s.
addNode(0, c.rod_space, -half_length);
119 s.
addNode(0, c.rod_space, half_length);
120 s.
addNode(-half_length, 0, c.rod_space);
121 s.
addNode( half_length, 0, c.rod_space);
122 s.
addNode(-half_length, 0, -c.rod_space);
123 s.
addNode( half_length, 0, -c.rod_space);
140 s.
addPair(0, 4,
"muscle_active");
141 s.
addPair(0, 5,
"muscle_passive");
142 s.
addPair(0, 8,
"muscle_active");
143 s.
addPair(0, 10,
"muscle_passive");
145 s.
addPair(1, 6,
"muscle_active");
146 s.
addPair(1, 7,
"muscle_passive");
147 s.
addPair(1, 8,
"muscle_passive");
148 s.
addPair(1, 10,
"muscle_active");
150 s.
addPair(2, 4,
"muscle_passive");
151 s.
addPair(2, 5,
"muscle_active");
152 s.
addPair(2, 9,
"muscle_active");
153 s.
addPair(2, 11,
"muscle_passive");
155 s.
addPair(3, 7,
"muscle_active");
156 s.
addPair(3, 6,
"muscle_passive");
157 s.
addPair(3, 9,
"muscle_passive");
158 s.
addPair(3, 11,
"muscle_active");
160 s.
addPair(4, 10,
"muscle_active");
161 s.
addPair(4, 11,
"muscle_passive");
163 s.
addPair(5, 8,
"muscle_active");
164 s.
addPair(5, 9,
"muscle_passive");
166 s.
addPair(6, 10,
"muscle_passive");
167 s.
addPair(6, 11,
"muscle_active");
169 s.
addPair(7, 8,
"muscle_passive");
170 s.
addPair(7, 9,
"muscle_active");
177 const tgRod::Config rodConfig(c.radius, c.density, c.friction,
178 c.rollFriction, c.restitution);
182 c.maxTens, c.targetVelocity);
185 c.maxTens, c.targetVelocity);
192 s.move(btVector3(0, 10, 0));
196 btVector3 rotationPoint = btVector3(0, 0, 0);
197 btVector3 rotationAxis = btVector3(0, 1, 0);
198 double rotationAngle = M_PI/2;
199 s.
addRotation(rotationPoint, rotationAxis, rotationAngle);
203 spec.addBuilder(
"rod",
new tgRodInfo(rodConfig));
215 allMuscles = tgCast::filter<tgModel, tgBasicActuator> (
getDescendants());
232 throw std::invalid_argument(
"dt is not positive");
254 return passiveMuscles;
259 return activeMuscles;
264 return (c.stiffness_passive/c.stiffness_active);
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
const std::vector< tgBasicActuator * > & getPassiveMuscles() 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="")
void addRotation(const btVector3 &fixedPoint, const btVector3 &axis, double angle)
Contains the definition of class tgBasicActuator.
virtual void step(double dt)
Definition of class tgStructure.
Definition of class tgStructureInfo.
const std::vector< tgBasicActuator * > & getActiveMuscles() const
virtual const double muscleRatio()
Contains the definition of class tgRod.
Definition of class tgBuildSpec.
void notifyStep(double dt)
std::vector< tgModel * > getDescendants() const
void buildInto(tgModel &model, tgWorld &world)
void addNode(double x, double y, double z, std::string tags="")