Drake
drake::multibody Namespace Reference

Namespaces

 benchmarks
 
 collision
 
 constraint
 
 implicit_stribeck
 
 internal
 
 joints
 
 math
 
 multibody_model
 
 multibody_plant
 
 multibody_tree
 
 parsers
 
 parsing
 
 test
 

Classes

class  AccelerationKinematicsCache
 This class is one of the cache entries in MultibodyTreeContext. More...
 
class  ArticulatedBodyInertia
 Articulated Body Inertia is the inertia that a body appears to have when it is the base (or root) of a rigid-body system, also referred to as Articulated Body in the context of articulated body algorithms. More...
 
class  ArticulatedBodyInertiaCache
 This class is one of the cache entries in MultibodyTreeContext. More...
 
class  Body
 Body provides the general abstraction of a body with an API that makes no assumption about whether a body is rigid or deformable and neither does it make any assumptions about the underlying physical model or approximation. More...
 
class  BodyFrame
 A BodyFrame is a material Frame that serves as the unique reference frame for a Body. More...
 
struct  BodyNodeTopology
 Data structure to store the topological information associated with a tree node. More...
 
struct  BodyTopology
 Data structure to store the topological information associated with a Body. More...
 
class  FixedOffsetFrame
 FixedOffsetFrame represents a material frame F whose pose is fixed with respect to a parent material frame P. More...
 
class  ForceElement
 A ForceElement allows modeling state and time dependent forces in a MultibodyTree model. More...
 
struct  ForceElementTopology
 Data structure to store the topological information associated with a ForceElement. More...
 
class  Frame
 Frame is an abstract class representing a material frame (also called a physical frame), meaning that it is associated with a material point of a Body. More...
 
class  FrameBase
 FrameBase is an abstract representation of the concept of a frame in multibody dynamics. More...
 
struct  FrameTopology
 Data structure to store the topological information associated with a Frame. More...
 
class  GlobalInverseKinematics
 Solves the inverse kinematics problem as a mixed integer convex optimization problem. More...
 
class  InverseKinematics
 Solves an inverse kinematics (IK) problem on a MultibodyPlant, to find the postures of the robot satisfying certain constraints. More...
 
class  Joint
 A Joint models the kinematical relationship which characterizes the possible relative motion between two bodies. More...
 
class  JointActuator
 The JointActuator class is mostly a simple bookkeeping structure to represent an actuator acting on a given Joint. More...
 
struct  JointActuatorTopology
 Data structure to store the topological information associated with a JointActuator. More...
 
class  LinearSpringDamper
 This ForceElement models a spring-damper attached between two points on two different bodies. More...
 
class  Mobilizer
 Mobilizer is a fundamental object within Drake's multibody engine used to specify the allowed motions between two Frame objects within a MultibodyTree. More...
 
class  MobilizerImpl
 Base class for specific Mobilizer implementations with the number of generalized positions and velocities resolved at compile time as template parameters. More...
 
struct  MobilizerTopology
 Data structure to store the topological information associated with a Mobilizer object. More...
 
class  MultibodyForces
 A class to hold a set of forces applied to a MultibodyTree system. More...
 
class  MultibodyTree
 MultibodyTree provides a representation for a physical system consisting of a collection of interconnected rigid and deformable bodies. More...
 
class  MultibodyTreeContext
 MultibodyTreeContext is an object that contains all the information needed to uniquely determine the state of a MultibodyTree. More...
 
class  MultibodyTreeElement< ElementType< T >, ElementIndexType >
 A class representing an element or component of a MultibodyTree. More...
 
class  MultibodyTreeTopology
 Data structure to store the topological information associated with an entire MultibodyTree. More...
 
class  PositionKinematicsCache
 This class is one of the cache entries in MultibodyTreeContext. More...
 
class  PrismaticJoint
 This Joint allows two bodies to translate relative to one another along a common axis. More...
 
class  PrismaticMobilizer
 This Mobilizer allows two frames to translate relative to one another along an axis whose direction is constant when measured in either this mobilizer's inboard frame or its outboard frame. More...
 
class  QuaternionFloatingMobilizer
 This Mobilizer allows two frames to move freely relatively to one another. More...
 
class  RevoluteJoint
 This Joint allows two bodies to rotate relatively to one another around a common axis. More...
 
class  RevoluteMobilizer
 This Mobilizer allows two frames to rotate relatively to one another around an axis that is constant when measured in either this mobilizer's inboard or outboard frames, while the distance between the two frames does not vary. More...
 
class  RigidBody
 The term rigid body implies that the deformations of the body under consideration are so small that they have no significant effect on the overall motions of the body and therefore deformations can be neglected. More...
 
class  RotationalInertia
 This class helps describe the mass distribution (inertia properties) of a body or composite body about a particular point. More...
 
class  SpaceXYZMobilizer
 This mobilizer models a gimbal joint between an inboard frame F and an outboard frame M that allows frame M to rotate freely with respect to F ( though a gimbal joint provides arbitrary orientation like a ball joint but with some restrictions, discussed below). More...
 
class  SpatialAcceleration
 This class is used to represent a spatial acceleration that combines rotational (angular acceleration) and translational (linear acceleration) components. More...
 
class  SpatialForce
 This class is used to represent a spatial force (also called a wrench) that combines both rotational (torque) and translational force components. More...
 
class  SpatialInertia
 This class represents the physical concept of a Spatial Inertia. More...
 
class  SpatialMomentum
 This class is used to represent the spatial momentum of a particle, system of particles or body (whether rigid or soft.) The linear momentum l_NS of a system of particles S in a reference frame N is defined by: More...
 
class  SpatialVector
 This class is used to represent physical quantities that correspond to spatial vectors such as spatial velocities, spatial accelerations and spatial forces. More...
 
class  SpatialVelocity
 This class is used to represent a spatial velocity (also called a twist) that combines rotational (angular) and translational (linear) velocity components. More...
 
class  UniformGravityFieldElement
 This ForceElement allows modeling the effect of a uniform gravity field as felt by bodies on the surface of the Earth. More...
 
class  UnitInertia
 This class is used to represent rotational inertias for unit mass bodies. More...
 
class  VelocityKinematicsCache
 This class is one of the cache entries in MultibodyTreeContext. More...
 
class  WeldJoint
 This Joint fixes the relative pose between two frames as if "welding" them together. More...
 
class  WeldMobilizer
 This mobilizer fixes the relative pose X_FM of an outboard frame M in an inboard frame F as if "welding" them together at this fixed relative pose. More...
 

Typedefs

using FrameIndex = TypeSafeIndex< class FrameTag >
 Type used to identify frames by index in a multibody tree system. More...
 
using BodyIndex = TypeSafeIndex< class BodyTag >
 Type used to identify bodies by index in a multibody tree system. More...
 
using MobilizerIndex = TypeSafeIndex< class MobilizerTag >
 Type used to identify mobilizers by index in a multibody tree system. More...
 
using BodyNodeIndex = TypeSafeIndex< class BodyNodeTag >
 Type used to identify tree nodes by index within a multibody tree system. More...
 
using ForceElementIndex = TypeSafeIndex< class ForceElementTag >
 Type used to identify force elements by index within a multibody tree system. More...
 
using JointIndex = TypeSafeIndex< class JointElementTag >
 Type used to identify joints by index within a multibody tree system. More...
 
using JointActuatorIndex = TypeSafeIndex< class JointActuatorElementTag >
 Type used to identify actuators by index within a multibody tree system. More...
 
using ModelInstanceIndex = TypeSafeIndex< class ModelInstanceTag >
 Type used to identify model instances by index within a multibody tree system. More...
 

Functions

void ApproximateBoundedNormByLinearConstraints (const Eigen::Ref< const Vector3< symbolic::Expression >> &x, double c, solvers::MathematicalProgram *prog)
 
template<typename T >
lcmt_viewer_load_robot CreateLoadRobotMessage (const RigidBodyTree< double > &tree)
 Creates and returns an lcmt_viewer_load_robot message containing the visual geometries from the provided RigidBodyTree. More...
 
template lcmt_viewer_load_robot CreateLoadRobotMessage< double > (const RigidBodyTree< double > &tree)
 
void AddFlatTerrainToWorld (RigidBodyTreed *tree, double box_size=1000, double box_depth=10)
 Adds a box-shaped terrain to tree. More...
 
 TEST_F (RigidBodyTreeKinematicsTests, TestDoKinematicWithValidCache)
 
 TEST_F (RigidBodyTreeKinematicsTests, TestDoKinematicWithBadCache1)
 
 TEST_F (RigidBodyTreeKinematicsTests, TestDoKinematicWithBadCache2)
 
 TEST_F (AcrobotTests, PoseTests)
 
 TEST_F (AcrobotTests, SpatialVelocityTests)
 
 TEST_F (RBTDifferentialKinematicsHelperTest, RPYPoseTest)
 
 TEST_F (RBTDifferentialKinematicsHelperTest, RPYTwistInWorldAlignedBodyTest)
 
 TEST_F (RBTDifferentialKinematicsHelperTest, RPYJacobianTest)
 
 TEST_F (RBTDifferentialKinematicsHelperTest, RPYJacobianDotTimeVTest)
 
 TEST_F (RBTDifferentialKinematicsHelperTest, QuatPoseTest)
 
 TEST_F (RBTDifferentialKinematicsHelperTest, QuatTwistInWorldAlignedBodyTest)
 
 TEST_F (RBTDifferentialKinematicsHelperTest, QuatJacobianTest)
 
 TEST_F (RBTDifferentialKinematicsHelperTest, QuatJacobianDotTimeVTest)
 
Eigen::Quaterniond Vector4ToQuaternion (const Eigen::Ref< const Eigen::Vector4d > &q)
 
 GTEST_TEST (InverseKinematicsTest, ConstructorWithJointLimits)
 
 TEST_F (TwoFreeBodiesTest, PositionConstraint)
 
 TEST_F (TwoFreeBodiesTest, OrientationConstraint)
 
 TEST_F (TwoFreeBodiesTest, GazeTargetConstraint)
 
 TEST_F (TwoFreeBodiesTest, AngleBetweenVectorsConstraint)
 
template<typename T >
std::unique_ptr< MultibodyTree< T > > ConstructTwoFreeBodies ()
 Constructs a MultibodyTree consisting of two free bodies. More...
 
template<typename T >
std::unique_ptr< multibody_plant::MultibodyPlant< T > > ConstructTwoFreeBodiesPlant ()
 Constructs a MultibodyPlant consisting of two free bodies. More...
 
std::unique_ptr< multibody_plant::MultibodyPlant< double > > ConstructIiwaPlant (const std::string &iiwa_sdf_name, double time_step)
 Constructs a MultibodyPlant consisting of an Iiwa robot. More...
 
Eigen::Vector4d QuaternionToVectorWxyz (const Eigen::Quaterniond &q)
 Convert an Eigen::Quaternion to a vector 4d in the order (w, x, y, z). More...
 
template std::unique_ptr< MultibodyTree< double > > ConstructTwoFreeBodies< double > ()
 
template std::unique_ptr< MultibodyTree< AutoDiffXd > > ConstructTwoFreeBodies< AutoDiffXd > ()
 
template std::unique_ptr< multibody_plant::MultibodyPlant< double > > ConstructTwoFreeBodiesPlant< double > ()
 
template std::unique_ptr< multibody_plant::MultibodyPlant< AutoDiffXd > > ConstructTwoFreeBodiesPlant< AutoDiffXd > ()
 
template<typename DerivedA , typename DerivedB >
std::enable_if< std::is_same< typename DerivedA::Scalar, typename DerivedB::Scalar >::value &&std::is_same< typename DerivedA::Scalar, AutoDiffXd >::value >::type CompareAutoDiffVectors (const Eigen::MatrixBase< DerivedA > &a, const Eigen::MatrixBase< DerivedB > &b, double tol)
 Compares if two eigen matrices of AutoDiff have the same values and gradients. More...
 
template<typename T >
SpatialForce< Toperator+ (const SpatialForce< T > &F1_Sp_E, const SpatialForce< T > &F2_Sp_E)
 Computes the resultant spatial force as the addition of two spatial forces F1_Sp_E and F2_Sp_E on a same system or body S, at the same point P and expressed in the same frame E. More...
 
template<typename T >
SpatialMomentum< Toperator+ (const SpatialMomentum< T > &L1_NSp_E, const SpatialMomentum< T > &L2_NSp_E)
 Computes the resultant spatial momentum as the addition of two spatial momenta L1_NSp_E and L2_NSp_E on a same system S, about the same point P and expressed in the same frame E. More...
 
template<typename T >
SpatialVelocity< Toperator+ (const SpatialVelocity< T > &V_EAb, const SpatialVelocity< T > &V_AB_E)
 Performs the addition of two spatial velocities. More...
 
ModelInstanceIndex world_model_instance ()
 Returns the model instance containing the world body. More...
 
ModelInstanceIndex default_model_instance ()
 Returns the model instance which contains all tree elements with no explicit model instance specified. More...
 
BodyIndex world_index ()
 For every MultibodyTree the world body always has this unique index and it is always zero. More...
 
Drake joint comparison methods.

These methods compare joint original with joint clone.

Since these methods are intended to compare a clone, an exact match is performed. This method will only return true if the provided clone joint is exactly the same as the provided original joint.

bool CompareDrakeJointToClone (const DrakeJoint &original, const DrakeJoint &clone)
 
bool CompareFixedJointToClone (const FixedJoint &original, const FixedJoint &other)
 
bool CompareHelicalJointToClone (const HelicalJoint &original, const HelicalJoint &clone)
 
bool ComparePrismaticJointToClone (const PrismaticJoint &original, const PrismaticJoint &clone)
 
bool CompareQuaternionBallJointToClone (const QuaternionBallJoint &original, const QuaternionBallJoint &clone)
 
bool CompareQuaternionFloatingJointToClone (const QuaternionFloatingJoint &original, const QuaternionFloatingJoint &clone)
 
bool CompareRevoluteJointToClone (const RevoluteJoint &original, const RevoluteJoint &clone)
 
bool CompareRollPitchYawFloatingJointToClone (const RollPitchYawFloatingJoint &original, const RollPitchYawFloatingJoint &clone)
 
template<typename Derived >
bool CompareFixedAxisOneDofJointToClone (const FixedAxisOneDoFJoint< Derived > &original, const FixedAxisOneDoFJoint< Derived > &clone)
 

Typedef Documentation

using BodyIndex = TypeSafeIndex<class BodyTag>

Type used to identify bodies by index in a multibody tree system.

using BodyNodeIndex = TypeSafeIndex<class BodyNodeTag>

Type used to identify tree nodes by index within a multibody tree system.

using ForceElementIndex = TypeSafeIndex<class ForceElementTag>

Type used to identify force elements by index within a multibody tree system.

using FrameIndex = TypeSafeIndex<class FrameTag>

Type used to identify frames by index in a multibody tree system.

using JointActuatorIndex = TypeSafeIndex<class JointActuatorElementTag>

Type used to identify actuators by index within a multibody tree system.

using JointIndex = TypeSafeIndex<class JointElementTag>

Type used to identify joints by index within a multibody tree system.

using MobilizerIndex = TypeSafeIndex<class MobilizerTag>

Type used to identify mobilizers by index in a multibody tree system.

using ModelInstanceIndex = TypeSafeIndex<class ModelInstanceTag>

Type used to identify model instances by index within a multibody tree system.

Function Documentation

void AddFlatTerrainToWorld ( RigidBodyTreed tree,
double  box_size = 1000,
double  box_depth = 10 
)

Adds a box-shaped terrain to tree.

This directly modifies the existing world rigid body within tree and thus does not need to return a model_instance_id value.

Two opposite corners of the resulting axis-aligned box are: (box_size / 2, box_size / 2, 0) and (-box_size / 2, -box_size / 2, -box_depth).

Parameters
[in]treeThe RigidBodyTreed to which to add the terrain.
[in]box_sizeThe length and width of the terrain aligned with the world's X and Y axes.
[in]box_depthThe depth of the terrain aligned with the world's Z axis. Note that regardless of how deep the terrain is, the top surface of the terrain will be at Z = 0.
void drake::multibody::ApproximateBoundedNormByLinearConstraints ( const Eigen::Ref< const Vector3< symbolic::Expression >> &  x,
double  c,
solvers::MathematicalProgram prog 
)
std::enable_if< std::is_same<typename DerivedA::Scalar, typename DerivedB::Scalar>::value && std::is_same<typename DerivedA::Scalar, AutoDiffXd>::value>::type drake::multibody::CompareAutoDiffVectors ( const Eigen::MatrixBase< DerivedA > &  a,
const Eigen::MatrixBase< DerivedB > &  b,
double  tol 
)

Compares if two eigen matrices of AutoDiff have the same values and gradients.

bool CompareDrakeJointToClone ( const DrakeJoint original,
const DrakeJoint clone 
)
bool drake::multibody::CompareFixedAxisOneDofJointToClone ( const FixedAxisOneDoFJoint< Derived > &  original,
const FixedAxisOneDoFJoint< Derived > &  clone 
)
bool CompareFixedJointToClone ( const FixedJoint original,
const FixedJoint other 
)
bool CompareHelicalJointToClone ( const HelicalJoint original,
const HelicalJoint clone 
)
bool ComparePrismaticJointToClone ( const PrismaticJoint original,
const PrismaticJoint clone 
)
bool CompareQuaternionBallJointToClone ( const QuaternionBallJoint original,
const QuaternionBallJoint clone 
)
bool CompareQuaternionFloatingJointToClone ( const QuaternionFloatingJoint original,
const QuaternionFloatingJoint clone 
)
bool CompareRevoluteJointToClone ( const RevoluteJoint original,
const RevoluteJoint clone 
)
bool CompareRollPitchYawFloatingJointToClone ( const RollPitchYawFloatingJoint original,
const RollPitchYawFloatingJoint clone 
)
std::unique_ptr< multibody_plant::MultibodyPlant< double > > ConstructIiwaPlant ( const std::string &  iiwa_sdf_name,
double  time_step 
)

Constructs a MultibodyPlant consisting of an Iiwa robot.

std::unique_ptr< MultibodyTree< T > > ConstructTwoFreeBodies ( )

Constructs a MultibodyTree consisting of two free bodies.

std::unique_ptr< multibody_plant::MultibodyPlant< T > > ConstructTwoFreeBodiesPlant ( )

Constructs a MultibodyPlant consisting of two free bodies.

lcmt_viewer_load_robot CreateLoadRobotMessage ( const RigidBodyTree< double > &  tree)

Creates and returns an lcmt_viewer_load_robot message containing the visual geometries from the provided RigidBodyTree.

Note that this includes any visual geometries attached to the world body.

Instantiated templates for the following ScalarTypes are provided:

  • double

They are already available to link against in the containing library.

template lcmt_viewer_load_robot drake::multibody::CreateLoadRobotMessage< double > ( const RigidBodyTree< double > &  tree)
ModelInstanceIndex drake::multibody::default_model_instance ( )
inline

Returns the model instance which contains all tree elements with no explicit model instance specified.

drake::multibody::GTEST_TEST ( InverseKinematicsTest  ,
ConstructorWithJointLimits   
)
SpatialForce<T> drake::multibody::operator+ ( const SpatialForce< T > &  F1_Sp_E,
const SpatialForce< T > &  F2_Sp_E 
)
inline

Computes the resultant spatial force as the addition of two spatial forces F1_Sp_E and F2_Sp_E on a same system or body S, at the same point P and expressed in the same frame E.

Return values
Fr_Sp_EThe resultant spatial force on system or body S from combining F1_Sp_E and F2_Sp_E, applied at the same point P and in the same expressed-in frame E as the operand spatial forces.
SpatialMomentum<T> drake::multibody::operator+ ( const SpatialMomentum< T > &  L1_NSp_E,
const SpatialMomentum< T > &  L2_NSp_E 
)
inline

Computes the resultant spatial momentum as the addition of two spatial momenta L1_NSp_E and L2_NSp_E on a same system S, about the same point P and expressed in the same frame E.

Return values
Lc_NSp_EThe combined spatial momentum of system S from combining L1_NSp_E and L2_NSp_E, applied about the same point P, and in the same expressed-in frame E as the operand spatial momenta.
SpatialVelocity<T> drake::multibody::operator+ ( const SpatialVelocity< T > &  V_EAb,
const SpatialVelocity< T > &  V_AB_E 
)
inline

Performs the addition of two spatial velocities.

This operator returns the spatial velocity that results from adding the operands as if they were 6-dimensional vectors. In other words, the resulting spatial velocity contains a rotational component which is the 3-dimensional addition of the operand's rotational components and a translational component which is the 3-dimensional addition of the operand's translational components.

The addition of two spatial velocities has a clear physical meaning but can only be performed if the operands meet strict conditions. In addition the the usual requirement of common expressed-in frames, both spatial velocities must be for frames with the same origin point. The general idea is that if frame A has a spatial velocity with respect to E, and frame B has a spatial velocity with respect to A, we want to "compose" them so that we get frame B's spatial velocity in E. But that can't be done directly since frames A and B don't have the same origin. So:

Given the velocity V_EA of a frame A with respect to another frame E, and the velocity V_AB_E of a frame B measured in frame A (both expressed in frame E), we can calculate V_EB as their sum after shifting A's velocity to point Bo:

  V_EB = V_EA.Shift(p_AB_E) + V_AB_E

where p_AB_E is the position vector from A's origin to B's origin, expressed in E. This shift can also be thought of as yielding the spatial velocity of a new frame Ab, which is an offset frame rigidly aligned with A, but with its origin shifted to B's origin:

  V_EAb = V_EA.Shift(p_AB_E)
  V_EB = V_EAb + V_AB_E

The addition in the last expression is what is carried out by this operator; the caller must have already performed the necessary shift.

Eigen::Vector4d QuaternionToVectorWxyz ( const Eigen::Quaterniond &  q)

Convert an Eigen::Quaternion to a vector 4d in the order (w, x, y, z).

drake::multibody::TEST_F ( RigidBodyTreeKinematicsTests  ,
TestDoKinematicWithValidCache   
)
drake::multibody::TEST_F ( RigidBodyTreeKinematicsTests  ,
TestDoKinematicWithBadCache1   
)
drake::multibody::TEST_F ( RigidBodyTreeKinematicsTests  ,
TestDoKinematicWithBadCache2   
)
drake::multibody::TEST_F ( TwoFreeBodiesTest  ,
PositionConstraint   
)
drake::multibody::TEST_F ( TwoFreeBodiesTest  ,
OrientationConstraint   
)
drake::multibody::TEST_F ( TwoFreeBodiesTest  ,
GazeTargetConstraint   
)
drake::multibody::TEST_F ( TwoFreeBodiesTest  ,
AngleBetweenVectorsConstraint   
)
drake::multibody::TEST_F ( AcrobotTests  ,
PoseTests   
)
drake::multibody::TEST_F ( AcrobotTests  ,
SpatialVelocityTests   
)
drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
RPYPoseTest   
)
drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
RPYTwistInWorldAlignedBodyTest   
)
drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
RPYJacobianTest   
)
drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
RPYJacobianDotTimeVTest   
)
drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
QuatPoseTest   
)
drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
QuatTwistInWorldAlignedBodyTest   
)
drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
QuatJacobianTest   
)
drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
QuatJacobianDotTimeVTest   
)
Eigen::Quaterniond drake::multibody::Vector4ToQuaternion ( const Eigen::Ref< const Eigen::Vector4d > &  q)
BodyIndex drake::multibody::world_index ( )
inline

For every MultibodyTree the world body always has this unique index and it is always zero.

ModelInstanceIndex drake::multibody::world_model_instance ( )
inline

Returns the model instance containing the world body.

For every MultibodyTree the world body always has this unique model instance and it is always zero (as described in #3088).