Drake
Drake C++ Documentation
drake::examples::multibody::bouncing_ball Namespace Reference

Functions

void PopulateBallPlant (double radius, double mass, double hydroelastic_modulus, double dissipation, const drake::multibody::CoulombFriction< double > &surface_friction, const Vector3< double > &gravity_W, bool rigid_sphere, bool compliant_ground, drake::multibody::MultibodyPlant< double > *plant)
 This function populates the given MultibodyPlant with a model of a ball falling onto a plane. More...
 

Function Documentation

◆ PopulateBallPlant()

void drake::examples::multibody::bouncing_ball::PopulateBallPlant ( double  radius,
double  mass,
double  hydroelastic_modulus,
double  dissipation,
const drake::multibody::CoulombFriction< double > &  surface_friction,
const Vector3< double > &  gravity_W,
bool  rigid_sphere,
bool  compliant_ground,
drake::multibody::MultibodyPlant< double > *  plant 
)

This function populates the given MultibodyPlant with a model of a ball falling onto a plane.

MultibodyPlant models the contact of the ball with the ground as a perfectly inelastic collision (zero coefficient of restitution), i.e. energy is lost due to the collision.

The hydroelastic compliance type of the ground and ball can be independently configured. Not every compliance configuration is compatible with every contact model; contact between strict hydroelastic contact will fail for two contacting objects with the same compliance type. So, it is important to use the resulting plant with a contact model consistent with the configuration of the ball and ground.

Parameters
[in]radiusThe radius of the ball.
[in]massThe mass of the ball.
[in]hydroelastic_modulusThe modulus of elasticity for the ball. Only used when modeled with the hydroelastic model. See hydroelastic contact parameters documentation for details.
[in]dissipationThe Hunt & Crossley dissipation constant for the ball. Only used with the hydroelastic model. See hydroelastic contact parameters documentation for details.
[in]surface_frictionThe Coulomb's law coefficients of friction.
[in]gravity_WThe acceleration of gravity vector, expressed in the world frame W.
[in]rigid_sphereIf true, the sphere will have a rigid hydroelastic representation (soft otherwise).
[in]compliant_groundIf 'true', the ground will have a soft hydroelastic representation (rigid otherwise).
[in,out]plantA valid pointer to a MultibodyPlant. This function will register geometry for contact modeling.
Precondition
plant is not null, unfinalized, and is registered with a SceneGraph.
Note
The given plant is not finalized. You must call Finalize() on the new model once you are done populating it.