ContactInfo< T > Class Template Reference

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

#include <drake/attic/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() [1/3]

ContactInfo ( const ContactInfo< T > &  )

◆ ContactInfo() [2/3]

ContactInfo ( ContactInfo< T > &&  )

◆ ContactInfo() [3/3]

Initialize the contact response for two colliding collision elements.

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

Member Function Documentation

◆ get_contact_details()

const std::vector<copyable_unique_ptr<ContactDetail<T> > >& get_contact_details ( ) const

◆ get_element_id_1()

drake::multibody::collision::ElementId get_element_id_1 ( ) const

◆ get_element_id_2()

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

◆ get_resultant_force()

const ContactForce<T>& get_resultant_force ( ) const

◆ operator=() [1/2]

ContactInfo& operator= ( ContactInfo< T > &&  )

◆ operator=() [2/2]

ContactInfo& operator= ( const ContactInfo< T > &  )

◆ set_contact_details() [1/2]

void set_contact_details ( std::vector< copyable_unique_ptr< ContactDetail< T >>> &&  details)

◆ set_contact_details() [2/2]

void set_contact_details ( std::vector< std::unique_ptr< ContactDetail< T >>> &&  details)

◆ set_resultant_force()

void set_resultant_force ( const ContactForce< T >  force)

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