Drake
ContactInfo< T > Class Template Reference

A class containing information regarding contact response between two bodies including: More...

#include <drake/multibody/rigid_body_plant/contact_info.h>

Public Member Functions

 ContactInfo (drake::multibody::collision::ElementId element1, drake::multibody::collision::ElementId element2)
 Initialize the contact response for two colliding collision elements. More...
 
drake::multibody::collision::ElementId get_element_id_1 () const
 
drake::multibody::collision::ElementId get_element_id_2 () const
 
void set_resultant_force (const ContactForce< T > force)
 
const ContactForce< T > & get_resultant_force () const
 
const std::vector< copyable_unique_ptr< ContactDetail< T > > > & get_contact_details () const
 
void set_contact_details (std::vector< copyable_unique_ptr< ContactDetail< T >>> &&details)
 
void set_contact_details (std::vector< std::unique_ptr< ContactDetail< T >>> &&details)
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 ContactInfo (const ContactInfo &)=default
 
ContactInfooperator= (const ContactInfo &)=default
 
 ContactInfo (ContactInfo &&)=default
 
ContactInfooperator= (ContactInfo &&)=default
 

Detailed Description

template<typename T>
class drake::systems::ContactInfo< T >

A class containing information regarding contact response between two bodies including:

  • The pair of collision elements that are contacting (e1, e2), referenced by their unique identifiers.
  • A resultant ContactForce – a single ContactForce with the equivalent effect of applying all individual ContactDetails to element e1.
  • An optional list of ContactDetail instances.

Some forms of ContactDetail are more expensive than others. However, ContactInfo instances will need to be copied. The contact model defines a default behavior of whether the ContactDetails are stored in the corresponding ContactInfo instance or not. If this happens, the ContactInfo instance will contain a valid resultant force, but no contact details.

Eventually, this beahvior will be subject to user configuration; the user will specify whether they want the details to be included in the ContactInfo, overriding the contact model's default behavior, and paying the corresponding copying cost.

The resultant force and contact details, if they are included, are all defined such that they act on the first element in the pair (e1). Newton's third law requires that an equal and opposite force be applied, at exactly the same point in space, to e2.

Template Parameters
TThe scalar type. It must be a valid Eigen scalar.

Instantiated templates for the following ScalarTypes are provided:

  • double
  • AutoDiffXd

Constructor & Destructor Documentation

ContactInfo ( const ContactInfo< T > &  )
default
ContactInfo ( ContactInfo< T > &&  )
default

Initialize the contact response for two colliding collision elements.

Parameters
element1The identifier for the first collision element.
element2The identifier for the second collision element.

Member Function Documentation

const std::vector<copyable_unique_ptr<ContactDetail<T> > >& get_contact_details ( ) const
inline
drake::multibody::collision::ElementId get_element_id_1 ( ) const
inline

Here is the caller graph for this function:

drake::multibody::collision::ElementId get_element_id_2 ( ) const
inline

Here is the caller graph for this function:

const ContactForce<T>& get_resultant_force ( ) const
inline

Here is the caller graph for this function:

ContactInfo& operator= ( ContactInfo< T > &&  )
default
ContactInfo& operator= ( const ContactInfo< T > &  )
default
void set_contact_details ( std::vector< copyable_unique_ptr< ContactDetail< T >>> &&  details)
inline

Here is the caller graph for this function:

void set_contact_details ( std::vector< std::unique_ptr< ContactDetail< T >>> &&  details)
inline
void set_resultant_force ( const ContactForce< T >  force)
inline

Here is the caller graph for this function:


The documentation for this class was generated from the following files: