Drake
ContactResults< T > Class Template Reference

A class containing the contact results (contact points and response spatial forces for each colliding pair of collision elements) as well as the sum of all JᵀF for all contact, where J is the contact point Jacobian, and F is the contact force. More...

#include <drake/attic/multibody/rigid_body_plant/contact_results.h>

Public Member Functions

 ContactResults ()
 
int get_num_contacts () const
 Returns the number of unique collision element pairs in contact. More...
 
const ContactInfo< T > & get_contact_info (int i) const
 Retrieves the ith ContactInfo instance. More...
 
void Clear ()
 
ContactInfo< T > & AddContact (drake::multibody::collision::ElementId element_a, drake::multibody::collision::ElementId element_b)
 
void set_generalized_contact_force (const VectorX< T > &f)
 Stores the contact forces as a force in the generalized coordinate. More...
 
const VectorX< T > & get_generalized_contact_force () const
 Returns the stored generalized force that represents the contact forces. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 ContactResults (const ContactResults &)=default
 
ContactResultsoperator= (const ContactResults &)=default
 
 ContactResults (ContactResults &&)=default
 
ContactResultsoperator= (ContactResults &&)=default
 

Detailed Description

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

A class containing the contact results (contact points and response spatial forces for each colliding pair of collision elements) as well as the sum of all JᵀF for all contact, where J is the contact point Jacobian, and F is the contact force.

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

◆ ContactResults() [1/3]

ContactResults ( const ContactResults< T > &  )
default

◆ ContactResults() [2/3]

ContactResults ( ContactResults< T > &&  )
default

◆ ContactResults() [3/3]

Member Function Documentation

◆ AddContact()

◆ Clear()

void Clear ( )

◆ get_contact_info()

const ContactInfo< T > & get_contact_info ( int  i) const

Retrieves the ith ContactInfo instance.

No bounds checking will be done in a release build (but will be done in debug). It is assumed the caller will only use values in the range [0, get_num_contacts() -1], inclusive.

◆ get_generalized_contact_force()

const VectorX<T>& get_generalized_contact_force ( ) const
inline

Returns the stored generalized force that represents the contact forces.

◆ get_num_contacts()

int get_num_contacts ( ) const

Returns the number of unique collision element pairs in contact.

◆ operator=() [1/2]

ContactResults& operator= ( const ContactResults< T > &  )
default

◆ operator=() [2/2]

ContactResults& operator= ( ContactResults< T > &&  )
default

◆ set_generalized_contact_force()

void set_generalized_contact_force ( const VectorX< T > &  f)
inline

Stores the contact forces as a force in the generalized coordinate.

Parameters
f= J^T * contact_force, where J is the stacked contact Jacobian, and contact_force is the stacked contact forces.

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