A class containing information regarding contact and contact response between two geometries attached to a pair of bodies.
This class provides the output from the Hydroelastic contact model and includes:
The two geometries, denoted M and N (and obtainable via contact_surface().id_M()
and contact_surface().id_N()
) are attached to bodies A and B, respectively.
When T = Expression, the class is specialized to not contain any member data, because ContactSurface doesn't support Expression.
T | The scalar type, which must be one of the default scalars. |
#include <drake/multibody/plant/hydroelastic_contact_info.h>
Public Member Functions | |
HydroelasticContactInfo (std::shared_ptr< const geometry::ContactSurface< T >> contact_surface, const SpatialForce< T > &F_Ac_W) | |
Constructs this structure using the given contact surface and spatial force. More... | |
HydroelasticContactInfo (const geometry::ContactSurface< T > *contact_surface, const SpatialForce< T > &F_Ac_W) | |
(Advanced) Constructs by aliasing the given contact_surface, without any expensive reference counting. More... | |
~HydroelasticContactInfo () | |
const geometry::ContactSurface< T > & | contact_surface () const |
Returns a reference to the ContactSurface data structure. More... | |
const SpatialForce< T > & | F_Ac_W () const |
Gets the spatial force applied on body A, at the centroid point C of the surface mesh M, and expressed in the world frame W. More... | |
Implements CopyConstructible, CopyAssignable | |
HydroelasticContactInfo (const HydroelasticContactInfo &) | |
HydroelasticContactInfo & | operator= (const HydroelasticContactInfo &) |
HydroelasticContactInfo | ( | std::shared_ptr< const geometry::ContactSurface< T >> | contact_surface, |
const SpatialForce< T > & | F_Ac_W | ||
) |
Constructs this structure using the given contact surface and spatial force.
The geometry::ContactSurface defines contact between two geometries M and N (via contact_surface().id_M() and contact_surface().id_N(), respectively). HydroelasticContactInfo further associates geometries M and N with the bodies to which they are rigidly fixed, A and B, respectively. It is the responsibility of the caller of this constructor to ensure that the parameters satisfy the documented invariants, see below. Similarly, the spatial force F_Ac_W
must be provided as indicated by the monogram notation in use, that is, it is the spatial force on body A, at the contact surface's centroid C, and expressed in the world frame.
[in] | contact_surface | Contact surface between two geometries M and N, see geometry::ContactSurface::id_M() and geometry::ContactSurface::id_N(). This must point to immutable data (i.e., data that will never change), and must not be nullptr. |
[in] | F_Ac_W | Spatial force applied on body A, at contact surface centroid C, and expressed in the world frame W. The position p_WC of C in the world frame W can be obtained with ContactSurface::centroid() . |
HydroelasticContactInfo | ( | const geometry::ContactSurface< T > * | contact_surface, |
const SpatialForce< T > & | F_Ac_W | ||
) |
(Advanced) Constructs by aliasing the given contact_surface, without any expensive reference counting.
It is the responsibility of the caller to ensure that the given contact_surface outlives this object. Copying or moving this object will result in a deep copy of the surface.
HydroelasticContactInfo | ( | const HydroelasticContactInfo< T > & | ) |
const geometry::ContactSurface<T>& contact_surface | ( | ) | const |
Returns a reference to the ContactSurface data structure.
Note that the mesh and gradient vector fields are expressed in the world frame.
const SpatialForce<T>& F_Ac_W | ( | ) | const |
Gets the spatial force applied on body A, at the centroid point C of the surface mesh M, and expressed in the world frame W.
The position p_WC
of the centroid point C in the world frame W can be obtained with contact_surface().centroid()
.
HydroelasticContactInfo& operator= | ( | const HydroelasticContactInfo< T > & | ) |