1 #ifndef SimTK_SIMBODY_MOBILIZED_BODY_H_ 2 #define SimTK_SIMBODY_MOBILIZED_BODY_H_ 48 class SimbodyMatterSubsystem;
51 class MobilizedBodyImpl;
56 #ifndef SimTK_SIMBODY_DEFINING_MOBILIZED_BODY 57 extern template class PIMPLHandle<MobilizedBody, MobilizedBodyImpl, true>;
259 void unlock(
State& state)
const;
272 Vector getLockValueAsVector(
const State& state)
const;
326 return getBodyTransform(state).
R();
333 return getBodyTransform(state).
p();
354 return getBodyVelocity(state)[0];
361 return getBodyVelocity(state)[1];
383 return getBodyAcceleration(state)[0];
391 return getBodyAcceleration(state)[1];
401 "MobilizedBody::getMobilizerAcceleration() not yet implemented -- volunteers?");
417 return getBodyMassProperties(state).
getMass();
467 int getNumQ(
const State& state)
const;
470 int getNumU(
const State& state)
const;
494 Real getOneQ(
const State& state,
int which)
const;
499 Real getOneU(
const State& state,
int which)
const;
514 Real getOneQDot (
const State& state,
int which)
const;
524 Real getOneUDot(
const State& state,
int which)
const;
529 Real getOneQDotDot(
const State& state,
int which)
const;
538 Vector getQDotDotAsVector(
const State& state)
const;
561 void setOneQ(
State& state,
int which,
Real v)
const;
566 void setOneU(
State& state,
int which,
Real v)
const;
571 void setQFromVector(
State& state,
const Vector& v)
const;
575 void setUFromVector(
State& state,
const Vector& v)
const;
610 void setQToFitTransform(
State& state,
const Transform& X_FM)
const;
616 void setQToFitRotation(
State& state,
const Rotation& R_FM)
const;
623 void setQToFitTranslation(
State& state,
const Vec3& p_FM)
const;
637 void setUToFitAngularVelocity(
State& state,
const Vec3& w_FM)
const;
644 void setUToFitLinearVelocity(
State& state,
const Vec3& v_FM)
const;
720 const Transform& X_GB = this->getBodyTransform(state);
734 const Rotation& R_GB = this->getBodyRotation(state);
745 Vec3 findBodyOriginLocationInAnotherBody
748 getBodyOriginLocation(state));
759 const SpatialVec& V_GB = this->getBodyVelocity(state);
762 const Vec3 w_AB_G = V_GB[0]-V_GA[0];
766 const Transform& X_GB = getBodyTransform(state);
769 const Vec3 p_AB_G = X_GB.
p() - X_GA.
p();
771 const Vec3 p_AB_G_dot = V_GB[1] - V_GA[1];
774 const Vec3 v_AB_G = p_AB_G_dot - V_GA[0] % p_AB_G;
788 const Vec3& w_GB = getBodyAngularVelocity(state);
791 const Vec3 w_AB_G = w_GB-w_GA;
806 return findBodyVelocityInAnotherBody(state,inBodyA)[1];
821 const Transform& X_GB = this->getBodyTransform(state);
822 const SpatialVec& V_GB = this->getBodyVelocity(state);
823 const SpatialVec& A_GB = this->getBodyAcceleration(state);
834 Vec3 findBodyAngularAccelerationInAnotherBody
839 const Vec3& w_GB = this->getBodyAngularVelocity(state);
841 const Vec3& b_GB = this->getBodyAngularAcceleration(state);
844 const Vec3 w_AB_G = w_GB - w_GA;
845 const Vec3 w_AB_G_dot = b_GB - b_GA;
850 const Vec3 b_AB_G = w_AB_G_dot - w_GA % w_AB_G;
853 return ~R_GA * b_AB_G;
867 return findBodyAccelerationInAnotherBody(state,inBodyA)[1];
877 SpatialVec findMobilizerReactionOnBodyAtMInGround(
const State& state)
const;
885 SpatialVec findMobilizerReactionOnBodyAtOriginInGround
886 (
const State& state)
const;
896 SpatialVec findMobilizerReactionOnParentAtFInGround(
const State& state)
const;
905 SpatialVec findMobilizerReactionOnParentAtOriginInGround
906 (
const State& state)
const;
914 Vec3 findStationLocationInGround
916 return getBodyTransform(state) * stationOnB;
928 Vec3 findStationLocationInAnotherBody
933 findStationLocationInGround(state,stationOnB));
942 Vec3 findStationVelocityInGround
944 const Vec3& w = getBodyAngularVelocity(state);
945 const Vec3& v = getBodyOriginVelocity(state);
946 const Vec3 r = expressVectorInGroundFrame(state,stationOnB);
957 const Vec3& stationOnBodyB,
961 findBodyVelocityInAnotherBody(state, inBodyA);
964 expressVectorInAnotherBodyFrame(state, stationOnBodyB, inBodyA);
965 return V_AB[1] + (V_AB[0] % p_BS_A);
976 Vec3 findStationAccelerationInGround
978 const Vec3& w = getBodyAngularVelocity(state);
979 const Vec3& b = getBodyAngularAcceleration(state);
980 const Vec3& a = getBodyOriginAcceleration(state);
982 const Vec3 r = expressVectorInGroundFrame(state,stationOnB);
983 return a + b % r + w % (w % r);
992 const Vec3& stationOnBodyB,
996 findBodyAngularVelocityInAnotherBody(state,inBodyA);
998 findBodyAccelerationInAnotherBody(state,inBodyA);
1001 expressVectorInAnotherBodyFrame(state, stationOnBodyB, inBodyA);
1003 return A_AB[1] + (A_AB[0] % p_BS_A) + w_AB % (w_AB % p_BS_A);
1009 void findStationLocationAndVelocityInGround
1011 Vec3& locationOnGround,
Vec3& velocityInGround)
const 1013 const Vec3& p_GB = getBodyOriginLocation(state);
1014 const Vec3 p_BS_G = expressVectorInGroundFrame(state,locationOnB);
1015 locationOnGround = p_GB + p_BS_G;
1017 const Vec3& w_GB = getBodyAngularVelocity(state);
1018 const Vec3& v_GB = getBodyOriginVelocity(state);
1019 velocityInGround = v_GB + w_GB % p_BS_G;
1027 void findStationLocationVelocityAndAccelerationInGround
1029 Vec3& locationOnGround,
Vec3& velocityInGround,
Vec3& accelerationInGround)
1032 const Rotation& R_GB = getBodyRotation(state);
1033 const Vec3& p_GB = getBodyOriginLocation(state);
1036 const Vec3 r = R_GB*locationOnB;
1037 locationOnGround = p_GB + r;
1039 const Vec3& w = getBodyAngularVelocity(state);
1040 const Vec3& v = getBodyOriginVelocity(state);
1041 const Vec3& b = getBodyAngularAcceleration(state);
1042 const Vec3& a = getBodyOriginAcceleration(state);
1044 const Vec3 wXr = w % r;
1045 velocityInGround = v + wXr;
1046 accelerationInGround = a + b % r + w % wXr;
1052 return findStationLocationInGround(state,getBodyMassCenterStation(state));
1058 Vec3 findMassCenterLocationInAnotherBody
1060 return findStationLocationInAnotherBody(state,
1061 getBodyMassCenterStation(state),toBodyA);
1070 Vec3 findStationAtGroundPoint
1072 return ~getBodyTransform(state) * locationInG;
1080 Vec3 findStationAtAnotherBodyStation
1082 const Vec3& stationOnA)
const {
1089 Vec3 findStationAtAnotherBodyOrigin
1091 return findStationAtGroundPoint(state,
1098 Vec3 findStationAtAnotherBodyMassCenter
1101 getBodyMassCenterStation(state),*
this);
1109 return getBodyTransform(state) * frameOnB;
1119 return SpatialVec(getBodyAngularVelocity(state),
1120 findStationVelocityInGround(state,frameOnB.
p()));
1130 return SpatialVec(getBodyAngularAcceleration(state),
1131 findStationAccelerationInGround(state,frameOnB.
p()));
1137 Vec3 expressVectorInGroundFrame
1139 return getBodyRotation(state)*vectorInB;
1146 Vec3 expressGroundVectorInBodyFrame
1148 return ~getBodyRotation(state)*vectorInG;
1156 Vec3 expressVectorInAnotherBodyFrame
1161 expressVectorInGroundFrame(state,vectorInB));
1170 const Rotation& R_GB = getBodyRotation(state);
1181 const Rotation R_AB = findBodyRotationInAnotherBody(state,inBodyA);
1217 const Rotation& R_GB = getBodyRotation(state);
1236 Inertia calcBodyInertiaAboutAnotherBodyStation
1238 const Vec3& aboutLocationOnBodyA)
const 1245 const Vec3 p_Bo_PA =
1246 findStationAtAnotherBodyStation(state, inBodyA, aboutLocationOnBodyA);
1263 const MassProperties M_Bo_G = expressMassPropertiesInGroundFrame(state);
1264 const SpatialVec& V_GB = getBodyVelocity(state);
1270 SpatialVec calcBodyMomentumAboutBodyMassCenterInGround
1273 const Rotation& R_GB = getBodyRotation(state);
1280 const Vec3& w_GB = getBodyAngularVelocity(state);
1291 const Vec3& locationOnBodyB,
1293 const Vec3& locationOnBodyA)
const 1295 if (isSameMobilizedBody(bodyA))
1296 return (locationOnBodyA-locationOnBodyB).norm();
1298 const Vec3 r_Go_PB =
1299 this->findStationLocationInGround(state,locationOnBodyB);
1300 const Vec3 r_Go_PA =
1302 return (r_Go_PA - r_Go_PB).
norm();
1310 Real calcStationToStationDistanceTimeDerivative
1312 const Vec3& locationOnBodyB,
1314 const Vec3& locationOnBodyA)
const 1316 if (isSameMobilizedBody(bodyA))
1319 Vec3 rB, rA, vB, vA;
1320 this->findStationLocationAndVelocityInGround(state,locationOnBodyB,rB,vB);
1322 const Vec3 r = rA-rB, v = vA-vB;
1328 if (d==0)
return v.
norm();
1329 else return dot(v, r/d);
1338 Real calcStationToStationDistance2ndTimeDerivative
1340 const Vec3& locationOnBodyB,
1342 const Vec3& locationOnBodyA)
const 1344 if (isSameMobilizedBody(bodyA))
1347 Vec3 rB, rA, vB, vA, aB, aA;
1348 this->findStationLocationVelocityAndAccelerationInGround
1349 (state,locationOnBodyB,rB,vB,aB);
1351 (state,locationOnBodyA,rA,vA,aA);
1353 const Vec3 r = rA-rB, v = vA-vB, a = aA-aB;
1368 if (s==0)
return a.
norm();
1369 else return dot(a, v/s);
1374 const Vec3 vp = v -
dot(v,u)*u;
1375 return dot(a,u) +
dot(vp,v)/d;
1381 Vec3 calcBodyMovingPointVelocityInBody
1383 const Vec3& locationOnBodyB,
1384 const Vec3& velocityOnBodyB,
1388 "MobilizedBody::calcBodyMovingPointVelocityInBody()" 1389 " is not yet implemented -- any volunteers?");
1397 Vec3 calcBodyMovingPointAccelerationInBody
1399 const Vec3& locationOnBodyB,
1400 const Vec3& velocityOnBodyB,
1401 const Vec3& accelerationOnBodyB,
1405 "MobilizedBody::calcBodyMovingPointAccelerationInBody()" 1406 " is not yet implemented -- any volunteers?");
1416 Real calcMovingPointToPointDistanceTimeDerivative
1418 const Vec3& locationOnBodyB,
1419 const Vec3& velocityOnBodyB,
1421 const Vec3& locationOnBodyA,
1422 const Vec3& velocityOnBodyA)
const 1425 "MobilizedBody::calcMovingPointToPointDistanceTimeDerivative()" 1426 " is not yet implemented -- any volunteers?");
1437 Real calcMovingPointToPointDistance2ndTimeDerivative
1439 const Vec3& locationOnBodyB,
1440 const Vec3& velocityOnBodyB,
1441 const Vec3& accelerationOnBodyB,
1443 const Vec3& locationOnBodyA,
1444 const Vec3& velocityOnBodyA,
1445 const Vec3& accelerationOnBodyA)
const 1448 "MobilizedBody::calcMovingPointToPointDistance2ndTimeDerivative()" 1449 " is not yet implemented -- any volunteers?");
1479 const Body& getBody()
const;
1517 int addOutboardDecoration(
const Transform& X_MD,
1520 int getNumOutboardDecorations()
const;
1532 int addInboardDecoration(
const Transform& X_FD,
1535 int getNumInboardDecorations()
const;
1565 void adoptMotion(
Motion& ownerHandle);
1575 bool hasMotion()
const;
1583 const Motion& getMotion()
const;
1602 const Transform& getDefaultInboardFrame()
const;
1606 const Transform& getDefaultOutboardFrame()
const;
1643 bool isInSubsystem()
const;
1658 bool isGround()
const;
1664 int getLevelInMultibodyTree()
const;
1677 Real getOneFromQPartition
1678 (
const State& state,
int which,
const Vector& qlike)
const;
1684 Real& updOneFromQPartition
1685 (
const State& state,
int which,
Vector& qlike)
const;
1690 Real getOneFromUPartition
1691 (
const State& state,
int which,
const Vector& ulike)
const;
1697 Real& updOneFromUPartition(
const State& state,
int which,
Vector& ulike)
const;
1705 Vector& mobilityForces)
const 1707 updOneFromUPartition(state,which,mobilityForces) += f;
1746 void convertQForceToUForce(
const State& state,
1756 void applyBodyForce(
const State& state,
const SpatialVec& spatialForceInG,
1764 void applyBodyTorque(
const State& state,
const Vec3& torqueInG,
1777 void applyForceToBodyPoint
1778 (
const State& state,
const Vec3& pointInB,
const Vec3& forceInG,
1859 class UniversalImpl;
1861 class BendStretchImpl;
1866 class TranslationImpl;
1867 class SphericalCoordsImpl;
1869 class LineOrientationImpl;
1873 class EllipsoidImpl;
1876 class FunctionBasedImpl;
1881 #endif // SimTK_SIMBODY_MOBILIZED_BODY_H_ Three translational mobilities describing the Cartesian motion of a point.
Definition: MobilizedBody_Translation.h:38
Vec< 2, Vec3 > SpatialVec
Spatial vectors are used for (rotation,translation) quantities and consist of a pair of Vec3 objects...
Definition: MassProperties.h:50
const MassProperties & getDefaultMassProperties() const
Return the mass properties of the Body stored within this MobilizedBody.
Definition: MobilizedBody.h:1553
void findStationLocationVelocityAndAccelerationInGround(const State &state, const Vec3 &locationOnB, Vec3 &locationOnGround, Vec3 &velocityInGround, Vec3 &accelerationInGround) const
It is cheaper to calculate a station's ground location, velocity, and acceleration together than to d...
Definition: MobilizedBody.h:1028
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
static Vec< M, ELT, 1 > getNaN()
Return a Vec of the same length and element type as this one but with all elements set to NaN...
Definition: Vec.h:913
Vec3 findStationLocationInAnotherBody(const State &state, const Vec3 &stationOnB, const MobilizedBody &toBodyA) const
Given a station S on this body B, return the location on another body A which is at the same location...
Definition: MobilizedBody.h:929
InertiaP calcCentralInertia() const
Return the inertia of this MassProperties object, but measured about the mass center rather than abou...
Definition: MassProperties.h:1433
Vec3 findStationLocationInGround(const State &state, const Vec3 &stationOnB) const
Return the Cartesian (ground) location that is currently coincident with a station (point) S fixed on...
Definition: MobilizedBody.h:915
const Vec3P & getMassCenter() const
Return the mass center currently stored in this MassProperties object; this is expressed in an implic...
Definition: MassProperties.h:1412
Three mobilities – z rotation and x,y translation.
Definition: MobilizedBody_Planar.h:38
This is a special type of "mobilized" body generated automatically by Simbody as a placeholder for Gr...
Definition: MobilizedBody_Ground.h:45
we know q, u, and udot
Definition: Motion.h:116
MobilizedBody Mobod
Mobod is the approved abbreviation for MobilizedBody. Feel free to use it if you get tired of typing ...
Definition: MobilizedBody.h:63
Vec3 findBodyOriginAccelerationInAnotherBody(const State &state, const MobilizedBody &inBodyA) const
Return the acceleration of body B's origin point in body A's frame, expressed in body A...
Definition: MobilizedBody.h:862
Five mobilities, representing unrestricted motion for a body which is inertialess along its own z axi...
Definition: MobilizedBody_FreeLine.h:58
The Body class represents a reference frame that can be used to describe mass properties and geometry...
Definition: Body.h:55
Unique integer type for Subsystem-local u indexing.
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
One mobility – coordinated rotation and translation along the common z axis of the inboard and outbo...
Definition: MobilizedBody_Screw.h:39
Two mobilities, representing unrestricted orientation for a body which is inertialess along its own z...
Definition: MobilizedBody_LineOrientation.h:59
#define SimTK_ASSERT_ALWAYS(cond, msg)
Definition: ExceptionMacros.h:349
int addDecoration(const Transform &X_BD, const DecorativeGeometry &geometry)
Add a piece of decorative geometry fixed at some pose on this Body.
const Vec3 & getBodyAngularVelocity(const State &state) const
Extract from the state cache the already-calculated inertial angular velocity vector w_GB of this bod...
Definition: MobilizedBody.h:353
This defines the API for the Body base class and concrete Body types like Body::Rigid that are derive...
SpatialMatP toSpatialMat() const
Convert this MassProperties object to a spatial inertia matrix and return it as a SpatialMat...
Definition: MassProperties.h:1532
const SpatialVec & getMobilizerAcceleration(const State &state) const
TODO: Not implemented yet – any volunteers? At stage Acceleration, return the cross-mobilizer accele...
Definition: MobilizedBody.h:399
A Motion object belongs to a particular MobilizedBody and prescribes how the associated motion is to ...
Definition: Motion.h:107
const UnitInertia & getBodyUnitInertiaAboutBodyOrigin(const State &state) const
Return a reference to this body's unit inertia matrix in the State cache, taken about the body origin...
Definition: MobilizedBody.h:430
Slider Prismatic
Synonym for Slider mobilizer.
Definition: MobilizedBody.h:1827
Two mobilities – rotation and translation along the common z axis of the inboard and outboard mobili...
Definition: MobilizedBody_Cylinder.h:42
Vec3 findMassCenterLocationInGround(const State &state) const
Return the Cartesian (ground) location of this body B's mass center.
Definition: MobilizedBody.h:1051
const Vec3 & getBodyMassCenterStation(const State &state) const
Return this body's center of mass station (i.e., the vector fixed in the body, going from body origin...
Definition: MobilizedBody.h:423
Three mobilities – coordinated rotation and translation along the surface of an ellipsoid fixed to t...
Definition: MobilizedBody_Ellipsoid.h:45
SpatialVec findBodyAccelerationInAnotherBody(const State &state, const MobilizedBody &inBodyA) const
Return the angular and linear acceleration of body B's frame in body A's frame, expressed in body A...
Definition: MobilizedBody.h:815
Translation Cartesian
Synonym for Translation mobilizer.
Definition: MobilizedBody.h:1830
const RealP & getMass() const
Return the mass currently stored in this MassProperties object.
Definition: MassProperties.h:1407
Every Simbody header and source file should include this header before any other Simbody header...
This class contains the mass, center of mass, and unit inertia matrix of a rigid body B...
Definition: MassProperties.h:85
const MassProperties & getDefaultRigidBodyMassProperties() const
Get the default (that is, Topology stage) mass properties for this Body.
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:593
const UnitInertiaP & getUnitInertia() const
Return the unit inertia currently stored in this MassProperties object; this is expressed in an impli...
Definition: MassProperties.h:1417
Ball Spherical
Synonym for Ball mobilizer.
Definition: MobilizedBody.h:1846
Vec3 expressGroundVectorInBodyFrame(const State &state, const Vec3 &vectorInG) const
Re-express a vector expressed in Ground into the same vector expressed in this body B...
Definition: MobilizedBody.h:1147
MassProperties expressMassPropertiesInGroundFrame(const State &state) const
Re-express this body B's mass properties in Ground by applying only a rotation, not a shift of refere...
Definition: MobilizedBody.h:1168
Vec3 findBodyAngularVelocityInAnotherBody(const State &state, const MobilizedBody &inBodyA) const
Return the angular velocity w_AB of body B's frame in body A's frame, expressed in body A...
Definition: MobilizedBody.h:785
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:276
const Real NaN
This is the IEEE "not a number" constant for this implementation of the default-precision Real type; ...
Inertia calcBodyCentralInertia(const State &state, MobilizedBodyIndex objectBodyB) const
Return the central inertia for body B, that is, the inertia taken about body B's mass center Bc...
Definition: MobilizedBody.h:1227
int addBodyDecoration(const Transform &X_BD, const DecorativeGeometry &geometry)
Add decorative geometry specified relative to the new (outboard) body's reference frame B...
Definition: MobilizedBody.h:1501
Three mobilities – unrestricted orientation modeled as a 1-2-3 body-fixed Euler angle sequence...
Definition: MobilizedBody_Gimbal.h:69
SpatialMat calcBodySpatialInertiaMatrixInGround(const State &state) const
Return the mass properties of body B, measured from and about the B origin Bo, but expressed in Groun...
Definition: MobilizedBody.h:1211
const Vec3 & getBodyOriginAcceleration(const State &state) const
Extract from the state cache the already-calculated inertial linear acceleration vector a_GB (more ex...
Definition: MobilizedBody.h:390
const Vec3 & getBodyOriginLocation(const State &state) const
Extract from the state cache the already-calculated spatial location of body B's body frame origin Bo...
Definition: MobilizedBody.h:332
Level
What is the highest level of motion that is driven? Lower levels are also driven; higher levels are d...
Definition: Motion.h:112
The SimTK::Array_<T> container class is a plug-compatible replacement for the C++ standard template l...
Definition: Array.h:50
Pin Torsion
Synonym for Pin mobilizer.
Definition: MobilizedBody.h:1819
Real getBodyMass(const State &state) const
Return the mass of this body.
Definition: MobilizedBody.h:416
SpatialVec calcBodyMomentumAboutBodyOriginInGround(const State &state)
Calculate body B's momentum (angular, linear) measured and expressed in Ground, but taken about the b...
Definition: MobilizedBody.h:1262
MassProperties_ reexpress(const RotationP &R_BC) const
Re-express these mass properties from the current frame "B" to a new frame "C", given the orientation...
Definition: MassProperties.h:1481
Vec3 findBodyOriginVelocityInAnotherBody(const State &state, const MobilizedBody &inBodyA) const
Return the velocity of body B's origin point in body A's frame, expressed in body A...
Definition: MobilizedBody.h:802
Three mobilities – unrestricted orientation modeled with a quaternion which is never singular...
Definition: MobilizedBody_Ball.h:44
Mat< 3, 3 > Mat33
This is the most common 3x3 matrix type: three packed columns of 3 Real values each.
Definition: SmallMatrix.h:142
Rotation findBodyRotationInAnotherBody(const State &state, const MobilizedBody &inBodyA) const
Return R_AB, the rotation matrix giving this body B's axes in body A's frame.
Definition: MobilizedBody.h:730
int addBodyDecoration(const DecorativeGeometry &geometry)
Convenience method for use when the geometry is supplied in the body frame.
Definition: MobilizedBody.h:1507
MobilizedBody()
The default constructor provides an empty MobilizedBody handle that can be assigned to reference any ...
Definition: MobilizedBody.h:1464
Unique integer type for Subsystem-local q indexing.
Vec3 findStationAtGroundPoint(const State &state, const Vec3 &locationInG) const
Return the station (point) S of this body B that is coincident with the given Ground location...
Definition: MobilizedBody.h:1071
const Vec3 & getBodyOriginVelocity(const State &state) const
Extract from the state cache the already-calculated inertial linear velocity vector v_GB (more explic...
Definition: MobilizedBody.h:360
Pin Revolute
Synonym for Pin mobilizer.
Definition: MobilizedBody.h:1821
InertiaP calcShiftedInertia(const Vec3P &newOriginB) const
Return the inertia of this MassProperties object, but with the "measured about" point shifted from th...
Definition: MassProperties.h:1440
Provides one rotational mobility about the common z axis of the F and M frames of the mobilizer...
Definition: MobilizedBody_Pin.h:46
Body & setDefaultRigidBodyMassProperties(const MassProperties &)
Every type of Body should provide an initial set of rigid body mass properties defined at Topology st...
invalid level
Definition: Motion.h:113
One mobility – translation along the common x axis of the F (inboard) and M (outboard) mobilizer fra...
Definition: MobilizedBody_Slider.h:46
Direction
Constructors can take an argument of this type to indicate that the mobilizer is being defined in the...
Definition: MobilizedBody.h:180
This is a subclass of MobilizedBody::Custom which uses a set of Function objects to define the behavi...
Definition: MobilizedBody_FunctionBased.h:46
Mat< 2, 2, Mat33 > SpatialMat
Spatial matrices are used to hold 6x6 matrices that are best viewed as 2x2 matrices of 3x3 matrices; ...
Definition: MassProperties.h:72
This defines the Motion class, which is used to specify how the mobilities associated with a particul...
const Real Infinity
This is the IEEE positive infinity constant for this implementation of the default-precision Real typ...
The physical meaning of an inertia is the distribution of a rigid body's mass about a particular poin...
Definition: MassProperties.h:82
This is the client-side interface to an implementation-independent representation of "Decorations" su...
Definition: DecorativeGeometry.h:86
CNT< typename CNT< E1 >::THerm >::template Result< E2 >::Mul dot(const Vec< M, E1, S1 > &r, const Vec< M, E2, S2 > &v)
Definition: SmallMatrixMixed.h:86
void applyOneMobilityForce(const State &state, int which, Real f, Vector &mobilityForces) const
This utility adds in the supplied generalized force f (a scalar) to the appropriate slot of the suppl...
Definition: MobilizedBody.h:1704
A UnitInertia matrix is a unit-mass inertia matrix; you can convert it to an Inertia by multiplying i...
Definition: MassProperties.h:81
bool isLocked(const State &state) const
Check whether this mobilizer is currently locked in the given state.
Definition: MobilizedBody.h:262
Vec3 findStationVelocityInAnotherBody(const State &state, const Vec3 &stationOnBodyB, const MobilizedBody &inBodyA) const
Return the velocity of a station S fixed on body B, in body A's frame, expressed in body A...
Definition: MobilizedBody.h:956
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72
Two mobilities – rotation about the x axis, followed by a rotation about the new y axis...
Definition: MobilizedBody_Universal.h:40
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:167
CNT< ScalarNormSq >::TSqrt norm() const
Definition: Vec.h:608
A spatial inertia contains the mass, center of mass point, and inertia matrix for a rigid body...
Definition: MassProperties.h:83
bool isLockedByDefault() const
Check whether this mobilizer is to be locked in the default state.
Definition: MobilizedBody.h:285
Ball Orientation
Synonym for Ball mobilizer.
Definition: MobilizedBody.h:1844
The handle class MobilizedBody::Custom (dataless) and its companion class MobilizedBody::Custom::Impl...
Definition: MobilizedBody_Custom.h:72
Unrestricted motion for a rigid body (six mobilities).
Definition: MobilizedBody_Free.h:52
This class represents a small matrix whose size is known at compile time, containing elements of any ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:607
const Rotation & getBodyRotation(const State &state) const
Extract from the state cache the already-calculated spatial orientation R_GB of body B's body frame x...
Definition: MobilizedBody.h:325
This subsystem contains the bodies ("matter") in the multibody system, the mobilizers (joints) that d...
Definition: SimbodyMatterSubsystem.h:133
SpatialVec findRelativeAcceleration(const Transform &X_FA, const SpatialVec &V_FA, const SpatialVec &A_FA, const Transform &X_FB, const SpatialVec &V_FB, const SpatialVec &A_FB)
Find the relative spatial acceleration between two frames A and B whose individual spatial accelerati...
Definition: SpatialAlgebra.h:245
Zero mobilities.
Definition: MobilizedBody_Weld.h:43
Method
There are several ways to specify the motion at this Level, and the selected method also determines l...
Definition: Motion.h:126
BendStretch PolarCoords
Synonym for BendStretch mobilizer.
Definition: MobilizedBody.h:1834
const SpatialVec & getBodyVelocity(const State &state) const
Extract from the state cache the already-calculated spatial velocity V_GB of this body's reference fr...
Real calcStationToStationDistance(const State &state, const Vec3 &locationOnBodyB, const MobilizedBody &bodyA, const Vec3 &locationOnBodyA) const
Calculate the distance from a station PB on body B to a station PA on body A.
Definition: MobilizedBody.h:1290
const Vec3 & getBodyAngularAcceleration(const State &state) const
Extract from the state cache the already-calculated inertial angular acceleration vector b_GB of this...
Definition: MobilizedBody.h:382
Transform findBodyTransformInAnotherBody(const State &state, const MobilizedBody &inBodyA) const
Return X_AB, the spatial transform giving this body B's frame in body A's frame.
Definition: MobilizedBody.h:716
Vec3 findStationAccelerationInAnotherBody(const State &state, const Vec3 &stationOnBodyB, const MobilizedBody &inBodyA) const
Return the acceleration of a station S fixed on body B, in another body A's frame, expressed in body A.
Definition: MobilizedBody.h:991
const Transform & getBodyTransform(const State &state) const
Extract from the state cache the already-calculated spatial configuration X_GB of body B's body frame...
The Mobilizer associated with each MobilizedBody, once modeled, has a specific number of generalized ...
Three mobilities – body fixed 3-2 (z-y) rotation followed by translation along body z or body x...
Definition: MobilizedBody_SphericalCoords.h:77
void findStationLocationAndVelocityInGround(const State &state, const Vec3 &locationOnB, Vec3 &locationOnGround, Vec3 &velocityInGround) const
It is cheaper to calculate a station's ground location and velocity together than to do them separate...
Definition: MobilizedBody.h:1010
Two mobilities: The z axis of the parent's F frame is used for rotation (and that is always aligned w...
Definition: MobilizedBody_BendStretch.h:42
const SpatialVec & getBodyAcceleration(const State &state) const
Extract from the state cache the already-calculated spatial acceleration A_GB of this body's referenc...
MobilizedBody & setDefaultMassProperties(const MassProperties &m)
If the contained Body can have its mass properties set to the supplied value m its mass properties ar...
Definition: MobilizedBody.h:1547
Translation CartesianCoords
Synonym for Translation mobilizer.
Definition: MobilizedBody.h:1832
Six mobilities – arbitrary relative motion modeled as x-y-z translation followed by an x-y-z body-fi...
Definition: MobilizedBody_Bushing.h:86
Inertia_ reexpress(const Rotation_< P > &R_FB) const
Return a new inertia matrix like this one but re-expressed in another frame (leaving the origin point...
Definition: MassProperties.h:375