Drake
drake::multibody Namespace Reference

Namespaces

 benchmarks
 
 collision
 
 constraint
 
 examples
 
 hydroelastics
 
 internal
 
 joints
 
 math
 
 multibody_plant
 
 parsers
 
 test
 
 test_utilities
 

Classes

struct  AddMultibodyPlantSceneGraphResult
 Temporary result from AddMultibodyPlantSceneGraph. More...
 
class  AngleBetweenVectorsConstraint
 Constrains that the angle between a vector a and another vector b is between [θ_lower, θ_upper]. 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  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...
 
class  BoxSphereTest
 
class  ContactResults
 A container class storing the contact results information for each contact pair for a given state of the simulation. More...
 
class  ContactResultsToLcmSystem
 A System that encodes ContactResults into a lcmt_contact_results_for_viz message. More...
 
struct  ContactWrench
 Stores the contact wrench (spatial force) from Body A to Body B applied at point Cb. More...
 
class  ContactWrenchEvaluator
 
class  ContactWrenchFromForceInWorldFrameEvaluator
 The contact wrench is τ_AB_W = 0, f_AB_W = λ Namely we assume that λ is the contact force from A to B, applied directly at B's witness point. More...
 
class  CoulombFriction
 Parameters for Coulomb's Law of Friction, namely: More...
 
class  DistanceConstraint
 Constrains the distance between a pair of geometries to be within a range [distance_lower, distance_upper]. More...
 
struct  ExternallyAppliedSpatialForce
 
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...
 
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...
 
class  GaussianTriangleQuadratureRule
 
class  GazeTargetConstraint
 Constrains a target point T to be within a cone K. More...
 
class  GlobalInverseKinematics
 Solves the inverse kinematics problem as a mixed integer convex optimization problem. More...
 
class  HydroelasticContactInfo
 A class containing information regarding contact and contact response between two geometries attached to a pair of bodies. More...
 
class  IiwaKinematicConstraintTest
 
class  ImplicitStribeckSolver
 
struct  ImplicitStribeckSolverIterationStats
 Struct used to store information about the iteration process performed by ImplicitStribeckSolver. More...
 
struct  ImplicitStribeckSolverParameters
 These are the parameters controlling the iteration process of the ImplicitStribeckSolver solver. 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...
 
class  LinearSpringDamper
 This ForceElement models a spring-damper attached between two points on two different bodies. More...
 
class  ManipulatorEquationConstraint
 A Constraint to impose the manipulator equation: 0 = (Buₙ₊₁ + ∑ᵢ (Jᵢ_WBᵀ(qₙ₊₁)ᵀ * Fᵢ_AB_W(λᵢ,ₙ₊₁)) More...
 
class  MinimumDistanceConstraint
 Constrain the signed distance between all candidate pairs of geometries (according to the logic of SceneGraphInspector::GetCollisionCandidates()) to be no smaller than a specified minimum distance. More...
 
class  MultibodyForces
 A class to hold a set of forces applied to a MultibodyTree system. More...
 
class  MultibodyPlant
 MultibodyPlant is a Drake system framework representation (see systems::System) for the model of a physical system consisting of a collection of interconnected bodies. More...
 
class  MultibodyPlantTester
 
class  MultibodyTreeElement< ElementType< T >, ElementIndexType >
 A class representing an element or component of a MultibodyTree. More...
 
class  OrientationConstraint
 Constrains that the angle difference θ between the orientation of frame A and the orientation of frame B to satisfy θ ≤ θ_bound. More...
 
class  PackageMap
 Maps ROS package names to their full path on the local file system. More...
 
class  Parser
 Parses SDF and URDF input files into a MultibodyPlant and (optionally) a SceneGraph. More...
 
class  PointPairContactInfo
 A class containing information regarding contact response between two bodies including: More...
 
class  PositionConstraint
 Constrains the position of a point Q, rigidly attached to a frame B, to be within a bounding box measured and expressed in frame A. More...
 
class  PrismaticJoint
 This Joint allows two bodies to translate relative to one another along a common axis. More...
 
class  RevoluteJoint
 This Joint allows two bodies to rotate relatively to one another around a common axis. More...
 
class  RevoluteSpring
 This ForceElement models a torsional spring attached to a RevoluteJoint and applies a torque to that joint. 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 describes the mass distribution (inertia properties) of a body or composite body about a particular point. 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  StaticEquilibriumConstraint
 Impose the static equilibrium constraint 0 = τ_g + Bu + ∑J_WBᵀ(q) * Fapp_B_W. More...
 
class  StaticEquilibriumProblem
 Finds the static equilibrium pose of a multibody system through optimization. More...
 
class  StaticFrictionConeConstraint
 Formulates the nonlinear friction cone constraint |fₜ| ≤ μ*fₙ, where fₜ is the tangential contact force, fₙ is the normal contact force, and μ is the friction coefficient. More...
 
class  TriangleQuadrature
 A class for integrating a function using numerical quadrature over triangular domains. More...
 
class  TriangleQuadratureRule
 A "rule" (weights and quadrature points) for computing quadrature over triangular domains. More...
 
class  TwoFreeBodiesConstraintTest
 
class  TwoFreeSpheresTest
 
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  WeldJoint
 This Joint fixes the relative pose between two frames as if "welding" them together. More...
 

Typedefs

using MinimumDistancePenaltyFunction = solvers::MinimumValuePenaltyFunction
 Computes the penalty function φ(x) and its derivatives dφ(x)/dx. More...
 
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 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...
 

Enumerations

enum  ImplicitStribeckSolverResult { kSuccess = 0, kMaxIterationsReached = 1, kLinearSolverFailed = 2 }
 The result from ImplicitStribeckSolver::SolveWithGuess() used to report the success or failure of the solver. More...
 
enum  JacobianWrtVariable { kQDot, kV }
 Enumeration that indicates whether the Jacobian is partial differentiation with respect to q̇ (time-derivatives of generalized positions) or with respect to v (generalized velocities). 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)
 
template<typename T >
void EvalConstraintGradient (const systems::Context< T > &, const MultibodyPlant< T > &, const Frame< T > &, const Frame< T > &, const Eigen::Vector3d &, const Eigen::Vector3d &, const math::RotationMatrix< T > &, const Eigen::Ref< const VectorX< T >> &, VectorX< T > *)
 
void EvalConstraintGradient (const systems::Context< double > &context, const MultibodyPlant< double > &plant, const Frame< double > &frameA, const Frame< double > &frameB, const Eigen::Vector3d &a_unit_A, const Eigen::Vector3d &b_unit_B, const math::RotationMatrix< double > &R_AB, const Eigen::Ref< const AutoDiffVecXd > &x, AutoDiffVecXd *y)
 
template<typename T , typename S >
void DoEvalGeneric (const MultibodyPlant< T > &plant, systems::Context< T > *context, const FrameIndex frameA_index, const FrameIndex frameB_index, const Eigen::Vector3d &a_unit_A, const Eigen::Vector3d &b_unit_B, const Eigen::Ref< const VectorX< S >> &x, VectorX< S > *y)
 
template<typename T , typename S >
void EvalDistance (const MultibodyPlant< T > &plant, const SortedPair< geometry::GeometryId > &geometry_pair, systems::Context< T > *context, const Eigen::Ref< const VectorX< S >> &x, VectorX< S > *y)
 
template<typename T >
void EvalConstraintGradient (const systems::Context< T > &, const MultibodyPlant< T > &, const Frame< T > &, const Frame< T > &, const Eigen::Vector3d &, const Eigen::Vector3d &, const Vector3< T > &, const T &, const Vector2< T > &g, const Eigen::Ref< const VectorX< T >> &, VectorX< T > *y)
 
void EvalConstraintGradient (const systems::Context< double > &context, const MultibodyPlant< double > &plant, const Frame< double > &frameA, const Frame< double > &frameB, const Eigen::Vector3d &p_BT, const Eigen::Vector3d &n_A, const Eigen::Vector3d &cos_cone_half_angle_squared_times_p, const double &p_dot_n, const Eigen::Vector2d &g, const Eigen::Ref< const AutoDiffVecXd > &x, AutoDiffVecXd *y)
 
template<typename T , typename S >
void DoEvalGeneric (const MultibodyPlant< T > &plant, systems::Context< T > *context, const FrameIndex frameA_index, const FrameIndex frameB_index, const Eigen::Vector3d &p_AS, const Eigen::Vector3d &n_A, const Eigen::Vector3d p_BT, double cos_cone_half_angle, const Eigen::Ref< const VectorX< S >> &x, VectorX< S > *y)
 
template<typename T , typename S >
VectorX< S > Distances (const MultibodyPlant< T > &plant, systems::Context< T > *context, const Eigen::Ref< const VectorX< S >> &q, double influence_distance)
 
template<typename T >
void EvalConstraintGradient (const systems::Context< T > &, const MultibodyPlant< T > &, const Frame< T > &, const Frame< T > &, const math::RotationMatrix< double > &, const math::RotationMatrix< T > &R_AB, const Vector3< T > &, const Eigen::Ref< const VectorX< T >> &, VectorX< T > *y)
 
void EvalConstraintGradient (const systems::Context< double > &context, const MultibodyPlant< double > &plant, const Frame< double > &frameAbar, const Frame< double > &frameBbar, const math::RotationMatrix< double > &R_AbarA, const math::RotationMatrix< double > &R_AB, const Vector3< double > &r_AB, const Eigen::Ref< const AutoDiffVecXd > &x, AutoDiffVecXd *y)
 
template<typename T , typename S >
void DoEvalGeneric (const MultibodyPlant< T > &plant, systems::Context< T > *context, FrameIndex frameAbar_index, FrameIndex frameBbar_index, const math::RotationMatrix< double > &R_AbarA, const math::RotationMatrix< double > &R_BbarB, const Eigen::Ref< const VectorX< S >> &x, VectorX< S > *y)
 
template<typename T >
void EvalConstraintGradient (const systems::Context< T > &, const MultibodyPlant< T > &, const Frame< T > &, const Frame< T > &, const Vector3< T > &p_AQ, const Eigen::Vector3d &, const Eigen::Ref< const VectorX< T >> &, VectorX< T > *y)
 
void EvalConstraintGradient (const systems::Context< double > &context, const MultibodyPlant< double > &plant, const Frame< double > &frameA, const Frame< double > &frameB, const Eigen::Vector3d &p_AQ, const Eigen::Vector3d &p_BQ, const Eigen::Ref< const AutoDiffVecXd > &x, AutoDiffVecXd *y)
 
template<typename T , typename S >
void DoEvalGeneric (const MultibodyPlant< T > &plant, systems::Context< T > *context, const FrameIndex frameA_index, const FrameIndex frameB_index, const Eigen::Vector3d &p_BQ, const Eigen::Ref< const VectorX< S >> &x, VectorX< S > *y)
 
 TEST_F (TwoFreeSpheresTest, Constructor)
 
 TEST_F (TwoFreeSpheresTest, TestEval)
 
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)
 
 TEST_F (TwoFreeSpheresTest, MinimumDistanceConstraintTest)
 
template<typename T >
void AddTwoFreeBodiesToPlant (MultibodyPlant< T > *model)
 Adds two free bodies to a MultibodyPlant. More...
 
template<typename T >
std::unique_ptr< MultibodyPlant< T > > ConstructTwoFreeBodiesPlant ()
 Constructs a MultibodyPlant consisting of two free bodies. More...
 
std::unique_ptr< MultibodyPlant< double > > ConstructIiwaPlant (const std::string &file_path, 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<typename T >
std::unique_ptr< systems::Diagram< T > > ConstructBoxSphereDiagram (const Eigen::Vector3d &box_size, double radius, MultibodyPlant< T > **plant, geometry::SceneGraph< T > **scene_graph)
 
template<typename T >
BoxSphereSignedDistance (const Eigen::Ref< const Eigen::Vector3d > &box_size, double radius, const math::RigidTransform< T > &X_WB, const math::RigidTransform< T > &X_WS)
 Compute the signed distance between a box and a sphere. More...
 
template std::unique_ptr< MultibodyPlant< double > > ConstructTwoFreeBodiesPlant< double > ()
 
template std::unique_ptr< MultibodyPlant< AutoDiffXd > > ConstructTwoFreeBodiesPlant< AutoDiffXd > ()
 
template double BoxSphereSignedDistance< double > (const Eigen::Ref< const Eigen::Vector3d > &box_size, double radius, const math::RigidTransform< double > &X_WB, const math::RigidTransform< double > &X_WS)
 
template AutoDiffXd BoxSphereSignedDistance< AutoDiffXd > (const Eigen::Ref< const Eigen::Vector3d > &box_size, double radius, const math::RigidTransform< AutoDiffXd > &X_WB, const math::RigidTransform< AutoDiffXd > &X_WS)
 
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 ConstraintType >
void TestKinematicConstraintEval (const ConstraintType &constraint_from_double, const ConstraintType &constraint_from_autodiff, const Eigen::Ref< const Eigen::VectorXd > &x_double, const Eigen::Ref< const Eigen::MatrixXd > &dx, double gradient_tol)
 Since we can construct the kinematic constraint using both MultibodyPlant<double> (as constraint_from_double) and MultibodyPlant<AutoDiffXd> (as constraint_from_autodiff), and evaluate the constraint with both VectorX<double> and VectorX<AutoDiffXd>, we check if the following evaluation results match: More...
 
template<typename T >
Vector3< T > ComputeCollisionSphereCenterPosition (const Vector3< T > &p_WB, const Quaternion< T > &quat_WB, const math::RigidTransformd &X_BS)
 
 TEST_F (TwoFreeSpheresMinimumDistanceTest, ExponentialPenalty)
 
 TEST_F (TwoFreeSpheresMinimumDistanceTest, QuadraticallySmoothedHingePenalty)
 
 GTEST_TEST (MinimumDistanceConstraintTest, MultibodyPlantWithouthGeometrySource)
 
 GTEST_TEST (MinimumDistanceConstraintTest, MultibodyPlantWithoutCollisionPairs)
 
 TEST_F (TwoFreeSpheresTest, NonpositiveInfluenceDistanceOffset)
 
 TEST_F (TwoFreeSpheresTest, NonfiniteInfluenceDistanceOffset)
 
template<typename T >
BoxSphereSignedDistance (const Eigen::Vector3d &box_size, double radius, const VectorX< T > &x)
 
 TEST_F (BoxSphereTest, Test)
 
template<typename T >
SpatialForce< T > operator+ (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< T > operator+ (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< T > operator+ (const SpatialVelocity< T > &V_MAb_E, const SpatialVelocity< T > &V_AB_E)
 Performs the addition of two spatial velocities. More...
 
template<typename T >
SpatialVelocity< T > operator- (const SpatialVelocity< T > &V_MB_E, const SpatialVelocity< T > &V_MAb_E)
 The addition of two spatial velocities relates to the composition of the spatial velocities for two frames given we know the relative spatial velocity between them, see operator+(const SpatialVelocity<T>&, const SpatialVelocity<T>&) for further details. More...
 
std::pair< solvers::Binding< internal::SlidingFrictionComplementarityNonlinearConstraint >, solvers::Binding< StaticFrictionConeConstraint > > AddSlidingFrictionComplementarityExplicitContactConstraint (const ContactWrenchEvaluator *contact_wrench_evaluator, double complementarity_tolerance, const Eigen::Ref< const VectorX< symbolic::Variable >> &q_vars, const Eigen::Ref< const VectorX< symbolic::Variable >> &v_vars, const Eigen::Ref< const VectorX< symbolic::Variable >> &lambda_vars, solvers::MathematicalProgram *prog)
 For a pair of geometries in explicit contact, adds the sliding friction complementarity constraint explained in sliding_friction_complementarity_constraint to an optimization program. More...
 
std::pair< solvers::Binding< internal::SlidingFrictionComplementarityNonlinearConstraint >, solvers::Binding< internal::StaticFrictionConeComplementarityNonlinearConstraint > > AddSlidingFrictionComplementarityImplicitContactConstraint (const ContactWrenchEvaluator *contact_wrench_evaluator, double complementarity_tolerance, const Eigen::Ref< const VectorX< symbolic::Variable >> &q_vars, const Eigen::Ref< const VectorX< symbolic::Variable >> &v_vars, const Eigen::Ref< const VectorX< symbolic::Variable >> &lambda_vars, solvers::MathematicalProgram *prog)
 For a pair of geometries in implicit contact (they may or may not be in contact, adds the sliding friction complementarity constraint explained in sliding_friction_complementarity_constraint. More...
 
solvers::Binding< internal::StaticFrictionConeComplementarityNonlinearConstraintAddStaticFrictionConeComplementarityConstraint (const ContactWrenchEvaluator *contact_wrench_evaluator, double complementarity_tolerance, const Eigen::Ref< const VectorX< symbolic::Variable >> &q_vars, const Eigen::Ref< const VectorX< symbolic::Variable >> &lambda_vars, solvers::MathematicalProgram *prog)
 Adds the complementarity constraint on the static friction force between a pair of contacts |ft_W| <= μ * n_Wᵀ * f_W (static friction force in the friction cone). More...
 
 GTEST_TEST (StaticEquilibriumProblemTest, SphereOnGroundTest)
 
 GTEST_TEST (TestStaticEquilibriumProblem, TwoSpheresWithinBin)
 
 GTEST_TEST (StaticFrictionConeComplementarityNonlinearConstraint, TestEval)
 
 GTEST_TEST (StaticFrictionConeConstraint, TestEval)
 
std::ostream & operator<< (std::ostream &out, const PackageMap &package_map)
 
systems::lcm::LcmPublisherSystemConnectContactResultsToDrakeVisualizer (systems::DiagramBuilder< double > *builder, const MultibodyPlant< double > &multibody_plant, lcm::DrakeLcmInterface *lcm=nullptr)
 Extends a Diagram with the required components to publish contact results to drake_visualizer. More...
 
systems::lcm::LcmPublisherSystemConnectContactResultsToDrakeVisualizer (systems::DiagramBuilder< double > *builder, const MultibodyPlant< double > &multibody_plant, const systems::OutputPort< double > &contact_results_port, lcm::DrakeLcmInterface *lcm=nullptr)
 Implements ConnectContactResultsToDrakeVisualizer, but using contact_results_port to explicitly specify the output port used to get contact results for multibody_plant. More...
 
template<typename T >
CoulombFriction< T > CalcContactFrictionFromSurfaceProperties (const CoulombFriction< T > &surface_properties1, const CoulombFriction< T > &surface_properties2)
 Given the surface properties of two different surfaces, this method computes the Coulomb's law coefficients of friction characterizing the interaction by friction of the given surface pair. More...
 
template<typename T >
AddMultibodyPlantSceneGraphResult< T > AddMultibodyPlantSceneGraph (systems::DiagramBuilder< T > *builder, std::unique_ptr< MultibodyPlant< T >> plant=nullptr, std::unique_ptr< geometry::SceneGraph< T >> scene_graph=nullptr)
 Adds a MultibodyPlant and a SceneGraph instance to a diagram builder, connecting the geometry ports. More...
 
template AddMultibodyPlantSceneGraphResult< doubleAddMultibodyPlantSceneGraph (systems::DiagramBuilder< double > *builder, std::unique_ptr< MultibodyPlant< double >> plant, std::unique_ptr< geometry::SceneGraph< double >> scene_graph)
 
template AddMultibodyPlantSceneGraphResult< AutoDiffXdAddMultibodyPlantSceneGraph (systems::DiagramBuilder< AutoDiffXd > *builder, std::unique_ptr< MultibodyPlant< AutoDiffXd >> plant, std::unique_ptr< geometry::SceneGraph< AutoDiffXd >> scene_graph)
 
BodyIndex world_index ()
 For every MultibodyTree the world body always has this unique index and it is always zero. 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...
 
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)
 

Variables

constexpr int kNumPositionsForTwoFreeBodies {14}
 
const double kInf = std::numeric_limits<double>::infinity()
 

Typedef Documentation

◆ BodyIndex

using BodyIndex = TypeSafeIndex<class BodyTag>

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

◆ ForceElementIndex

using ForceElementIndex = TypeSafeIndex<class ForceElementTag>

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

◆ FrameIndex

using FrameIndex = TypeSafeIndex<class FrameTag>

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

◆ JointActuatorIndex

using JointActuatorIndex = TypeSafeIndex<class JointActuatorElementTag>

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

◆ JointIndex

using JointIndex = TypeSafeIndex<class JointElementTag>

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

◆ MinimumDistancePenaltyFunction

Computes the penalty function φ(x) and its derivatives dφ(x)/dx.

Valid penalty functions must meet the following criteria:

  1. φ(x) ≥ 0 ∀ x ∈ ℝ.
  2. dφ(x)/dx ≤ 0 ∀ x ∈ ℝ.
  3. φ(x) = 0 ∀ x ≥ 0.
  4. dφ(x)/dx < 0 ∀ x < 0.

◆ ModelInstanceIndex

using ModelInstanceIndex = TypeSafeIndex<class ModelInstanceTag>

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

Enumeration Type Documentation

◆ ImplicitStribeckSolverResult

The result from ImplicitStribeckSolver::SolveWithGuess() used to report the success or failure of the solver.

Enumerator
kSuccess 

Successful computation.

kMaxIterationsReached 

The maximum number of iterations was reached.

kLinearSolverFailed 

The linear solver used within the Newton-Raphson loop failed.

This might be caused by a divergent iteration that led to an invalid Jacobian matrix.

◆ JacobianWrtVariable

enum JacobianWrtVariable
strong

Enumeration that indicates whether the Jacobian is partial differentiation with respect to q̇ (time-derivatives of generalized positions) or with respect to v (generalized velocities).

Enumerator
kQDot 

J = ∂V/∂q̇

kV 

J = ∂V/∂v.

Function Documentation

◆ AddFlatTerrainToWorld()

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.

◆ AddMultibodyPlantSceneGraph() [1/3]

AddMultibodyPlantSceneGraphResult< T > AddMultibodyPlantSceneGraph ( systems::DiagramBuilder< T > *  builder,
std::unique_ptr< MultibodyPlant< T >>  plant = nullptr,
std::unique_ptr< geometry::SceneGraph< T >>  scene_graph = nullptr 
)

Adds a MultibodyPlant and a SceneGraph instance to a diagram builder, connecting the geometry ports.

Parameters
[in,out]builderBuilder to add to.
[in]plant(optional) Constructed plant (e.g. for using a discrete plant). By default, a continuous plant is used.
[in]scene_graph(optional) Constructed scene graph. If none is provided, one will be created and used.
Returns
Pair of the registered plant and scene graph.
Precondition
builder must be non-null.

Recommended usages:

Assign to a MultibodyPlant reference (ignoring the SceneGraph):

MultibodyPlant<double>& plant = AddMultibodyPlantSceneGraph(&builder);
plant.DoFoo(...);

This flavor is the simplest, when the SceneGraph is not explicitly needed. (It can always be retrieved later via GetSubsystemByName("scene_graph").)

Assign to auto, and use the named public fields:

auto items = AddMultibodyPlantSceneGraph(&builder);
items.plant.DoFoo(...);
items.scene_graph.DoBar(...);

or

auto items = AddMultibodyPlantSceneGraph(&builder);
MultibodyPlant<double>& plant = items.plant;
SceneGraph<double>& scene_graph = items.scene_graph;
...
plant.DoFoo(...);
scene_graph.DoBar(...);

This is the easiest way to use both the plant and scene_graph.

Assign to already-declared pointer variables:

MultibodyPlant<double>* plant{};
SceneGraph<double>* scene_graph{};
std::tie(plant, scene_graph) = AddMultibodyPlantSceneGraph(&builder);
plant->DoFoo(...);
scene_graph->DoBar(...);

This flavor is most useful when the pointers are class member fields (and so perhaps cannot be references).

◆ AddMultibodyPlantSceneGraph() [2/3]

template AddMultibodyPlantSceneGraphResult<double> drake::multibody::AddMultibodyPlantSceneGraph ( systems::DiagramBuilder< double > *  builder,
std::unique_ptr< MultibodyPlant< double >>  plant,
std::unique_ptr< geometry::SceneGraph< double >>  scene_graph 
)

◆ AddMultibodyPlantSceneGraph() [3/3]

template AddMultibodyPlantSceneGraphResult<AutoDiffXd> drake::multibody::AddMultibodyPlantSceneGraph ( systems::DiagramBuilder< AutoDiffXd > *  builder,
std::unique_ptr< MultibodyPlant< AutoDiffXd >>  plant,
std::unique_ptr< geometry::SceneGraph< AutoDiffXd >>  scene_graph 
)

◆ AddSlidingFrictionComplementarityExplicitContactConstraint()

std::pair< solvers::Binding< internal::SlidingFrictionComplementarityNonlinearConstraint >, solvers::Binding< StaticFrictionConeConstraint > > AddSlidingFrictionComplementarityExplicitContactConstraint ( const ContactWrenchEvaluator contact_wrench_evaluator,
double  complementarity_tolerance,
const Eigen::Ref< const VectorX< symbolic::Variable >> &  q_vars,
const Eigen::Ref< const VectorX< symbolic::Variable >> &  v_vars,
const Eigen::Ref< const VectorX< symbolic::Variable >> &  lambda_vars,
solvers::MathematicalProgram prog 
)

For a pair of geometries in explicit contact, adds the sliding friction complementarity constraint explained in sliding_friction_complementarity_constraint to an optimization program.

This function adds the slack variables (f_static, f_sliding, c), and impose all the constraints in sliding_friction_complementarity_constraint.

Parameters
contact_wrench_evaluatorEvaluates the contact wrench between a pair of geometries.
complementarity_toleranceThe tolerance on the complementarity constraint.
q_varsThe variable for the generalized position q in prog.
v_varsThe variable for the generalized velocity v in prog.
lambda_varsThe varaibles to parameterize the contact wrench between this pair of geometry.
progThe optimization program to which the sliding friction complementarity constraint is imposed.
Returns
(sliding_friction_complementarity_constraint, static_friction_cone_constraint), the pair of constraint that imposes (1)-(4) and (6) in sliding_friction_complementarity_constraint.

◆ AddSlidingFrictionComplementarityImplicitContactConstraint()

std::pair< solvers::Binding< internal::SlidingFrictionComplementarityNonlinearConstraint >, solvers::Binding< internal::StaticFrictionConeComplementarityNonlinearConstraint > > AddSlidingFrictionComplementarityImplicitContactConstraint ( const ContactWrenchEvaluator contact_wrench_evaluator,
double  complementarity_tolerance,
const Eigen::Ref< const VectorX< symbolic::Variable >> &  q_vars,
const Eigen::Ref< const VectorX< symbolic::Variable >> &  v_vars,
const Eigen::Ref< const VectorX< symbolic::Variable >> &  lambda_vars,
solvers::MathematicalProgram prog 
)

For a pair of geometries in implicit contact (they may or may not be in contact, adds the sliding friction complementarity constraint explained in sliding_friction_complementarity_constraint.

The input arguments are the same as those in AddSlidingFrictionComplementarityExplicitContactConstraint(). The difference is that the returned argument includes the nonlinear complementarity binding 0 ≤ φ(q) ⊥ fₙ≥ 0, which imposes the constraint for implicit contact.

◆ AddStaticFrictionConeComplementarityConstraint()

solvers::Binding< internal::StaticFrictionConeComplementarityNonlinearConstraint > AddStaticFrictionConeComplementarityConstraint ( const ContactWrenchEvaluator contact_wrench_evaluator,
double  complementarity_tolerance,
const Eigen::Ref< const VectorX< symbolic::Variable >> &  q_vars,
const Eigen::Ref< const VectorX< symbolic::Variable >> &  lambda_vars,
solvers::MathematicalProgram prog 
)

Adds the complementarity constraint on the static friction force between a pair of contacts |ft_W| <= μ * n_Wᵀ * f_W (static friction force in the friction cone).

fn_W * sdf = 0 (complementarity condition) sdf >= 0 (no penetration) where sdf stands for signed distance function, ft_W stands for the tangential friction force expressed in the world frame.

Mathematically, we add the following constraints to the optimization program

f_Wᵀ * ((μ² + 1)* n_W * n_Wᵀ - I) * f_W ≥ 0                    (1)
n_Wᵀ * f_W = α                                                 (2)
sdf(q) = β                                                     (3)
0 ≤ α * β ≤ ε                                                  (4)
α ≥ 0                                                          (5)
β ≥ 0                                                          (6)

the slack variables α and β are added to the optimization program as well.

Parameters
contact_wrench_evaluatorThe evaluator to compute the contact wrench expressed in the world frame.
complementarity_toleranceε in the documentation above.
q_varsThe decision variable for the generalized configuration q.
lambda_varsThe decision variable to parameterize the contact wrench.
[in,out]progThe optimization program to which the constraint is added.
Returns
binding The binding containing the nonlinear constraints (1)-(4).
Precondition
Both q_vars and lambda_vars have been added to prog before calling this function.

◆ AddTwoFreeBodiesToPlant()

void AddTwoFreeBodiesToPlant ( MultibodyPlant< T > *  model)

Adds two free bodies to a MultibodyPlant.

◆ ApproximateBoundedNormByLinearConstraints()

void drake::multibody::ApproximateBoundedNormByLinearConstraints ( const Eigen::Ref< const Vector3< symbolic::Expression >> &  x,
double  c,
solvers::MathematicalProgram prog 
)

◆ BoxSphereSignedDistance() [1/2]

T BoxSphereSignedDistance ( const Eigen::Ref< const Eigen::Vector3d > &  box_size,
double  radius,
const math::RigidTransform< T > &  X_WB,
const math::RigidTransform< T > &  X_WS 
)

Compute the signed distance between a box and a sphere.

Parameters
box_sizeThe size of the box.
radiusThe radius of the sphere.
X_WBthe pose of the box (B) in the world frame (W).
X_WSthe pose of the sphere (S) in the world frame (W).

◆ BoxSphereSignedDistance() [2/2]

T drake::multibody::BoxSphereSignedDistance ( const Eigen::Vector3d &  box_size,
double  radius,
const VectorX< T > &  x 
)

◆ BoxSphereSignedDistance< AutoDiffXd >()

template AutoDiffXd drake::multibody::BoxSphereSignedDistance< AutoDiffXd > ( const Eigen::Ref< const Eigen::Vector3d > &  box_size,
double  radius,
const math::RigidTransform< AutoDiffXd > &  X_WB,
const math::RigidTransform< AutoDiffXd > &  X_WS 
)

◆ BoxSphereSignedDistance< double >()

template double drake::multibody::BoxSphereSignedDistance< double > ( const Eigen::Ref< const Eigen::Vector3d > &  box_size,
double  radius,
const math::RigidTransform< double > &  X_WB,
const math::RigidTransform< double > &  X_WS 
)

◆ CalcContactFrictionFromSurfaceProperties()

CoulombFriction<T> drake::multibody::CalcContactFrictionFromSurfaceProperties ( const CoulombFriction< T > &  surface_properties1,
const CoulombFriction< T > &  surface_properties2 
)

Given the surface properties of two different surfaces, this method computes the Coulomb's law coefficients of friction characterizing the interaction by friction of the given surface pair.

The surface properties are specified by individual Coulomb's law coefficients of friction. As outlined in the class's documentation for CoulombFriction, friction coefficients characterize a surface pair and not individual surfaces. However, we find it useful in practice to associate the abstract idea of friction coefficients to a single surface. Please refer to the documentation for CoulombFriction for details on this topic.

More specifically, this method computes the contact coefficients for the given surface pair as:

  μ = 2μₘμₙ/(μₘ + μₙ)

where the operation above is performed separately on the static and dynamic friction coefficients.

Parameters
[in]surface_properties1Surface properties for surface 1. Specified as an individual set of Coulomb's law coefficients of friction.
[in]surface_properties2Surface properties for surface 2. Specified as an individual set of Coulomb's law coefficients of friction.
Returns
the combined friction coefficients for the interacting surfaces.

◆ CompareAutoDiffVectors()

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.

◆ CompareDrakeJointToClone()

bool CompareDrakeJointToClone ( const DrakeJoint original,
const DrakeJoint clone 
)

◆ CompareFixedAxisOneDofJointToClone()

bool drake::multibody::CompareFixedAxisOneDofJointToClone ( const FixedAxisOneDoFJoint< Derived > &  original,
const FixedAxisOneDoFJoint< Derived > &  clone 
)

◆ CompareFixedJointToClone()

bool CompareFixedJointToClone ( const FixedJoint original,
const FixedJoint other 
)

◆ CompareHelicalJointToClone()

bool CompareHelicalJointToClone ( const HelicalJoint original,
const HelicalJoint clone 
)

◆ ComparePrismaticJointToClone()

bool ComparePrismaticJointToClone ( const PrismaticJoint original,
const PrismaticJoint clone 
)

◆ CompareQuaternionBallJointToClone()

bool CompareQuaternionBallJointToClone ( const QuaternionBallJoint original,
const QuaternionBallJoint clone 
)

◆ CompareQuaternionFloatingJointToClone()

bool CompareQuaternionFloatingJointToClone ( const QuaternionFloatingJoint original,
const QuaternionFloatingJoint clone 
)

◆ CompareRevoluteJointToClone()

bool CompareRevoluteJointToClone ( const RevoluteJoint original,
const RevoluteJoint clone 
)

◆ CompareRollPitchYawFloatingJointToClone()

bool CompareRollPitchYawFloatingJointToClone ( const RollPitchYawFloatingJoint original,
const RollPitchYawFloatingJoint clone 
)

◆ ComputeCollisionSphereCenterPosition()

Vector3<T> drake::multibody::ComputeCollisionSphereCenterPosition ( const Vector3< T > &  p_WB,
const Quaternion< T > &  quat_WB,
const math::RigidTransformd &  X_BS 
)

◆ ConstructBoxSphereDiagram()

std::unique_ptr<systems::Diagram<T> > drake::multibody::ConstructBoxSphereDiagram ( const Eigen::Vector3d &  box_size,
double  radius,
MultibodyPlant< T > **  plant,
geometry::SceneGraph< T > **  scene_graph 
)

◆ ConstructIiwaPlant()

std::unique_ptr< MultibodyPlant< double > > ConstructIiwaPlant ( const std::string &  file_path,
double  time_step 
)

Constructs a MultibodyPlant consisting of an Iiwa robot.

◆ ConstructTwoFreeBodiesPlant()

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

Constructs a MultibodyPlant consisting of two free bodies.

◆ ConstructTwoFreeBodiesPlant< AutoDiffXd >()

◆ ConstructTwoFreeBodiesPlant< double >()

◆ CreateLoadRobotMessage()

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.

◆ CreateLoadRobotMessage< double >()

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

◆ default_model_instance()

ModelInstanceIndex drake::multibody::default_model_instance ( )

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

◆ Distances()

VectorX<S> drake::multibody::Distances ( const MultibodyPlant< T > &  plant,
systems::Context< T > *  context,
const Eigen::Ref< const VectorX< S >> &  q,
double  influence_distance 
)

◆ DoEvalGeneric() [1/4]

void drake::multibody::DoEvalGeneric ( const MultibodyPlant< T > &  plant,
systems::Context< T > *  context,
const FrameIndex  frameA_index,
const FrameIndex  frameB_index,
const Eigen::Vector3d &  p_BQ,
const Eigen::Ref< const VectorX< S >> &  x,
VectorX< S > *  y 
)

◆ DoEvalGeneric() [2/4]

void drake::multibody::DoEvalGeneric ( const MultibodyPlant< T > &  plant,
systems::Context< T > *  context,
const FrameIndex  frameA_index,
const FrameIndex  frameB_index,
const Eigen::Vector3d &  p_AS,
const Eigen::Vector3d &  n_A,
const Eigen::Vector3d  p_BT,
double  cos_cone_half_angle,
const Eigen::Ref< const VectorX< S >> &  x,
VectorX< S > *  y 
)

◆ DoEvalGeneric() [3/4]

void drake::multibody::DoEvalGeneric ( const MultibodyPlant< T > &  plant,
systems::Context< T > *  context,
FrameIndex  frameAbar_index,
FrameIndex  frameBbar_index,
const math::RotationMatrix< double > &  R_AbarA,
const math::RotationMatrix< double > &  R_BbarB,
const Eigen::Ref< const VectorX< S >> &  x,
VectorX< S > *  y 
)

◆ DoEvalGeneric() [4/4]

void drake::multibody::DoEvalGeneric ( const MultibodyPlant< T > &  plant,
systems::Context< T > *  context,
const FrameIndex  frameA_index,
const FrameIndex  frameB_index,
const Eigen::Vector3d &  a_unit_A,
const Eigen::Vector3d &  b_unit_B,
const Eigen::Ref< const VectorX< S >> &  x,
VectorX< S > *  y 
)

◆ EvalConstraintGradient() [1/8]

void drake::multibody::EvalConstraintGradient ( const systems::Context< T > &  ,
const MultibodyPlant< T > &  ,
const Frame< T > &  ,
const Frame< T > &  ,
const Vector3< T > &  p_AQ,
const Eigen::Vector3d &  ,
const Eigen::Ref< const VectorX< T >> &  ,
VectorX< T > *  y 
)

◆ EvalConstraintGradient() [2/8]

void drake::multibody::EvalConstraintGradient ( const systems::Context< T > &  ,
const MultibodyPlant< T > &  ,
const Frame< T > &  ,
const Frame< T > &  ,
const math::RotationMatrix< double > &  ,
const math::RotationMatrix< T > &  R_AB,
const Vector3< T > &  ,
const Eigen::Ref< const VectorX< T >> &  ,
VectorX< T > *  y 
)

◆ EvalConstraintGradient() [3/8]

void drake::multibody::EvalConstraintGradient ( const systems::Context< double > &  context,
const MultibodyPlant< double > &  plant,
const Frame< double > &  frameA,
const Frame< double > &  frameB,
const Eigen::Vector3d &  p_AQ,
const Eigen::Vector3d &  p_BQ,
const Eigen::Ref< const AutoDiffVecXd > &  x,
AutoDiffVecXd y 
)

◆ EvalConstraintGradient() [4/8]

void drake::multibody::EvalConstraintGradient ( const systems::Context< T > &  ,
const MultibodyPlant< T > &  ,
const Frame< T > &  ,
const Frame< T > &  ,
const Eigen::Vector3d &  ,
const Eigen::Vector3d &  ,
const math::RotationMatrix< T > &  ,
const Eigen::Ref< const VectorX< T >> &  ,
VectorX< T > *   
)

◆ EvalConstraintGradient() [5/8]

void drake::multibody::EvalConstraintGradient ( const systems::Context< double > &  context,
const MultibodyPlant< double > &  plant,
const Frame< double > &  frameAbar,
const Frame< double > &  frameBbar,
const math::RotationMatrix< double > &  R_AbarA,
const math::RotationMatrix< double > &  R_AB,
const Vector3< double > &  r_AB,
const Eigen::Ref< const AutoDiffVecXd > &  x,
AutoDiffVecXd y 
)

◆ EvalConstraintGradient() [6/8]

void drake::multibody::EvalConstraintGradient ( const systems::Context< T > &  ,
const MultibodyPlant< T > &  ,
const Frame< T > &  ,
const Frame< T > &  ,
const Eigen::Vector3d &  ,
const Eigen::Vector3d &  ,
const Vector3< T > &  ,
const T &  ,
const Vector2< T > &  g,
const Eigen::Ref< const VectorX< T >> &  ,
VectorX< T > *  y 
)

◆ EvalConstraintGradient() [7/8]

void drake::multibody::EvalConstraintGradient ( const systems::Context< double > &  context,
const MultibodyPlant< double > &  plant,
const Frame< double > &  frameA,
const Frame< double > &  frameB,
const Eigen::Vector3d &  a_unit_A,
const Eigen::Vector3d &  b_unit_B,
const math::RotationMatrix< double > &  R_AB,
const Eigen::Ref< const AutoDiffVecXd > &  x,
AutoDiffVecXd y 
)

◆ EvalConstraintGradient() [8/8]

void drake::multibody::EvalConstraintGradient ( const systems::Context< double > &  context,
const MultibodyPlant< double > &  plant,
const Frame< double > &  frameA,
const Frame< double > &  frameB,
const Eigen::Vector3d &  p_BT,
const Eigen::Vector3d &  n_A,
const Eigen::Vector3d &  cos_cone_half_angle_squared_times_p,
const double p_dot_n,
const Eigen::Vector2d g,
const Eigen::Ref< const AutoDiffVecXd > &  x,
AutoDiffVecXd y 
)

◆ EvalDistance()

void drake::multibody::EvalDistance ( const MultibodyPlant< T > &  plant,
const SortedPair< geometry::GeometryId > &  geometry_pair,
systems::Context< T > *  context,
const Eigen::Ref< const VectorX< S >> &  x,
VectorX< S > *  y 
)

◆ GTEST_TEST() [1/7]

drake::multibody::GTEST_TEST ( StaticEquilibriumProblemTest  ,
SphereOnGroundTest   
)

◆ GTEST_TEST() [2/7]

drake::multibody::GTEST_TEST ( StaticFrictionConeConstraint  ,
TestEval   
)

◆ GTEST_TEST() [3/7]

drake::multibody::GTEST_TEST ( StaticFrictionConeComplementarityNonlinearConstraint  ,
TestEval   
)

◆ GTEST_TEST() [4/7]

drake::multibody::GTEST_TEST ( InverseKinematicsTest  ,
ConstructorWithJointLimits   
)

◆ GTEST_TEST() [5/7]

drake::multibody::GTEST_TEST ( TestStaticEquilibriumProblem  ,
TwoSpheresWithinBin   
)

◆ GTEST_TEST() [6/7]

drake::multibody::GTEST_TEST ( MinimumDistanceConstraintTest  ,
MultibodyPlantWithouthGeometrySource   
)

◆ GTEST_TEST() [7/7]

drake::multibody::GTEST_TEST ( MinimumDistanceConstraintTest  ,
MultibodyPlantWithoutCollisionPairs   
)

◆ operator+() [1/3]

SpatialForce<T> drake::multibody::operator+ ( 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.

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.

◆ operator+() [2/3]

SpatialMomentum<T> drake::multibody::operator+ ( 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.

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.

◆ operator+() [3/3]

SpatialVelocity<T> drake::multibody::operator+ ( const SpatialVelocity< T > &  V_MAb_E,
const SpatialVelocity< T > &  V_AB_E 
)

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 M, 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 M. But that can't be done directly since frames A and B don't have the same origin. So:

Given the velocity V_MA_E of a frame A in a measured-in frame M, and the velocity V_AB_E of a frame B measured in frame A (both expressed in a common frame E), we can calculate V_MB_E as their sum after shifting A's velocity to point Bo:

  V_MB_E = V_MA_E.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_MAb_E = V_MA_E.Shift(p_AB_E)
  V_MB_E = V_MAb_E + 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.

◆ operator-()

SpatialVelocity<T> drake::multibody::operator- ( const SpatialVelocity< T > &  V_MB_E,
const SpatialVelocity< T > &  V_MAb_E 
)

The addition of two spatial velocities relates to the composition of the spatial velocities for two frames given we know the relative spatial velocity between them, see operator+(const SpatialVelocity<T>&, const SpatialVelocity<T>&) for further details.

Mathematically, operator-(v1, v2) is equivalent ot operator+(v1, -v2).

Physically, the subtraction operation allow us to compute the relative velocity between two frames. As an example, consider having the the spatial velocities V_MA and V_MB of two frames A and B respectively measured in the same frame M. The velocity of B in A can be obtained as:

  V_AB_E = V_MB_E - V_MAb_E = V_AB_E = V_MB_E - V_MA_E.Shift(p_AB_E)

where we have expressed all quantities in a common frame E. Notice that, as explained in the documentation for operator+(const SpatialVelocity<T>&, const SpatialVelocity<T>&) a shift operation with SpatialVelocity::Shift() operation is needed.

◆ operator<<()

std::ostream& drake::multibody::operator<< ( std::ostream &  out,
const PackageMap package_map 
)

◆ QuaternionToVectorWxyz()

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

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

◆ TEST_F() [1/25]

drake::multibody::TEST_F ( TwoFreeSpheresTest  ,
Constructor   
)

◆ TEST_F() [2/25]

drake::multibody::TEST_F ( TwoFreeSpheresTest  ,
TestEval   
)

◆ TEST_F() [3/25]

drake::multibody::TEST_F ( RigidBodyTreeKinematicsTests  ,
TestDoKinematicWithValidCache   
)

◆ TEST_F() [4/25]

drake::multibody::TEST_F ( RigidBodyTreeKinematicsTests  ,
TestDoKinematicWithBadCache1   
)

◆ TEST_F() [5/25]

drake::multibody::TEST_F ( RigidBodyTreeKinematicsTests  ,
TestDoKinematicWithBadCache2   
)

◆ TEST_F() [6/25]

drake::multibody::TEST_F ( TwoFreeBodiesTest  ,
PositionConstraint   
)

◆ TEST_F() [7/25]

drake::multibody::TEST_F ( TwoFreeBodiesTest  ,
OrientationConstraint   
)

◆ TEST_F() [8/25]

drake::multibody::TEST_F ( TwoFreeSpheresMinimumDistanceTest  ,
ExponentialPenalty   
)

◆ TEST_F() [9/25]

drake::multibody::TEST_F ( TwoFreeSpheresMinimumDistanceTest  ,
QuadraticallySmoothedHingePenalty   
)

◆ TEST_F() [10/25]

drake::multibody::TEST_F ( TwoFreeBodiesTest  ,
GazeTargetConstraint   
)

◆ TEST_F() [11/25]

drake::multibody::TEST_F ( TwoFreeBodiesTest  ,
AngleBetweenVectorsConstraint   
)

◆ TEST_F() [12/25]

drake::multibody::TEST_F ( AcrobotTests  ,
PoseTests   
)

◆ TEST_F() [13/25]

drake::multibody::TEST_F ( TwoFreeSpheresTest  ,
NonpositiveInfluenceDistanceOffset   
)

◆ TEST_F() [14/25]

drake::multibody::TEST_F ( AcrobotTests  ,
SpatialVelocityTests   
)

◆ TEST_F() [15/25]

drake::multibody::TEST_F ( TwoFreeSpheresTest  ,
NonfiniteInfluenceDistanceOffset   
)

◆ TEST_F() [16/25]

drake::multibody::TEST_F ( TwoFreeSpheresTest  ,
MinimumDistanceConstraintTest   
)

◆ TEST_F() [17/25]

drake::multibody::TEST_F ( BoxSphereTest  ,
Test   
)

◆ TEST_F() [18/25]

drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
RPYPoseTest   
)

◆ TEST_F() [19/25]

drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
RPYTwistInWorldAlignedBodyTest   
)

◆ TEST_F() [20/25]

drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
RPYJacobianTest   
)

◆ TEST_F() [21/25]

drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
RPYJacobianDotTimeVTest   
)

◆ TEST_F() [22/25]

drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
QuatPoseTest   
)

◆ TEST_F() [23/25]

drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
QuatTwistInWorldAlignedBodyTest   
)

◆ TEST_F() [24/25]

drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
QuatJacobianTest   
)

◆ TEST_F() [25/25]

drake::multibody::TEST_F ( RBTDifferentialKinematicsHelperTest  ,
QuatJacobianDotTimeVTest   
)

◆ TestKinematicConstraintEval()

void drake::multibody::TestKinematicConstraintEval ( const ConstraintType &  constraint_from_double,
const ConstraintType &  constraint_from_autodiff,
const Eigen::Ref< const Eigen::VectorXd > &  x_double,
const Eigen::Ref< const Eigen::MatrixXd > &  dx,
double  gradient_tol 
)

Since we can construct the kinematic constraint using both MultibodyPlant<double> (as constraint_from_double) and MultibodyPlant<AutoDiffXd> (as constraint_from_autodiff), and evaluate the constraint with both VectorX<double> and VectorX<AutoDiffXd>, we check if the following evaluation results match:

  1. constraint_from_double.Eval(x_double) = constraint_from_autodiff.Eval(x_double).
  2. constraint_from_double.Eval(x_autodiff) = constraint_from_autodiff.Eval(x_autodiff).
  3. constraint_from_double.Eval(x_double) = constraint_from_double.Eval(x_autodiff).value()
  4. numerical_gradient(constraint_from_double.Eval(x_double)) ≈ constraint_from_double.Eval(x_autodiff).
    Parameters
    constraint_from_doubleA kinematic constraint constructed from MultibodyPlant<double>
    constraint_from_autodiffThe same kinematic constraint, but constructed from MultibodyPlant<AutoDiffXd>.
    x_doubleThe value of x passed to the constraint Eval function.
    dxThe gradient of x_double. dx must have the same number of rows as x_double.
    gradient_tolThe tolerance for checking the 4th condition above, that the numerical gradient should be close to the analytical gradient.

◆ Vector4ToQuaternion()

Eigen::Quaterniond drake::multibody::Vector4ToQuaternion ( const Eigen::Ref< const Eigen::Vector4d > &  q)

◆ world_index()

BodyIndex drake::multibody::world_index ( )

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

◆ world_model_instance()

ModelInstanceIndex drake::multibody::world_model_instance ( )

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).

Variable Documentation

◆ kInf

const double kInf = std::numeric_limits<double>::infinity()

◆ kNumPositionsForTwoFreeBodies

constexpr int kNumPositionsForTwoFreeBodies {14}