Drake
ContactInformation Class Reference

This class describes contact related information for each body in contact with other bodies in the world. More...

#include <systems/controllers/qp_inverse_dynamics/qp_inverse_dynamics_common.h>

Collaboration diagram for ContactInformation:
[legend]

Public Member Functions

 ContactInformation (const RigidBody< double > &body, int num_basis=kDefaultNumBasisPerContactPoint)
 Constructs a ContactInformation object for body. More...
 
MatrixX< doubleComputeBasisMatrix (const RigidBodyTree< double > &robot, const KinematicsCache< double > &cache) const
 Computes a matrix (Basis) that converts a vector of scalars (Beta) to the stacked point contact forces (F). More...
 
void ComputeContactPointsAndWrenchReferencePoint (const RigidBodyTree< double > &robot, const KinematicsCache< double > &cache, const Vector3< double > &offset, drake::Matrix3X< double > *contact_points, Vector3< double > *reference_point) const
 Computes the contact points and reference point location in the world frame. More...
 
MatrixX< doubleComputeWrenchMatrix (const Matrix3X< double > &contact_points, const Vector3< double > &reference_point) const
 Computes a matrix that converts a vector of stacked point forces to an equivalent wrench in a frame that has the same orientation as the world frame, but located at reference_point. More...
 
MatrixX< doubleComputeJacobianAtContactPoints (const RigidBodyTree< double > &robot, const KinematicsCache< double > &cache) const
 Computes the linear part of the stacked Jacobian for all the contact points. More...
 
VectorX< doubleComputeJacobianDotTimesVAtContactPoints (const RigidBodyTree< double > &robot, const KinematicsCache< double > &cache) const
 Computes the linear part of the stacked Jacobian dot times v vector for all the contact points. More...
 
VectorX< doubleComputeLinearVelocityAtContactPoints (const RigidBodyTree< double > &robot, const KinematicsCache< double > &cache) const
 Computes the stacked velocities for all the contact points. More...
 
bool is_valid () const
 
bool operator== (const ContactInformation &other) const
 
bool operator!= (const ContactInformation &other) const
 
const std::string & body_name () const
 
int num_contact_points () const
 
int num_basis () const
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 ContactInformation (const ContactInformation &)=default
 
ContactInformationoperator= (const ContactInformation &)=default
 
 ContactInformation (ContactInformation &&)=default
 
ContactInformationoperator= (ContactInformation &&)=default
 
Accessors
double mu () const
 
double weight () const
 
double Kd () const
 
ConstraintType acceleration_constraint_type () const
 
const Matrix3X< double > & contact_points () const
 
const Vector3< double > & normal () const
 
const RigidBody< double > & body () const
 
int num_basis_per_contact_point () const
 
Matrix3X< double > & mutable_contact_points ()
 
doublemutable_mu ()
 
doublemutable_weight ()
 
doublemutable_Kd ()
 
ConstraintTypemutable_acceleration_constraint_type ()
 
Vector3< double > & mutable_normal ()
 
intmutable_num_basis_per_contact_point ()
 
void set_body (const RigidBody< double > &body)
 

Static Public Attributes

static const int kDefaultNumBasisPerContactPoint = 4
 

Detailed Description

This class describes contact related information for each body in contact with other bodies in the world.

Each contact body has a set of point contacts. For each contact point, only point contact forces can be applied, and the friction cone is approximated by a set of basis vectors.

The stationary contact condition can be described as:

\[ J * vd + J_dot_times_vd = Kd * (0 - v_contact_pt). \]

Only the linear velocities and accelerations are considered here. Kd >= 0 is a stabilizing velocity gain to damp out contact velocity. This condition can be enforced either as an equality constraint or as a cost term.

Constructor & Destructor Documentation

ContactInformation ( const ContactInformation )
default
ContactInformation ( const RigidBody< double > &  body,
int  num_basis = kDefaultNumBasisPerContactPoint 
)

Constructs a ContactInformation object for body.

Parameters
bodyReference to a RigidBody, which must be valid through the lifespan of this obejct.
num_basis_per_contact_pointNumber of basis per contact point.

Member Function Documentation

ConstraintType acceleration_constraint_type ( ) const
inline

Here is the caller graph for this function:

const RigidBody<double>& body ( ) const
inline

Here is the caller graph for this function:

const std::string& body_name ( ) const
inline

Here is the caller graph for this function:

MatrixX< double > ComputeBasisMatrix ( const RigidBodyTree< double > &  robot,
const KinematicsCache< double > &  cache 
) const

Computes a matrix (Basis) that converts a vector of scalars (Beta) to the stacked point contact forces (F).

All point forces are in the world frame, and are applied at the contact points in the world frame. Basis is (3 * N_c) by (N_basis * N_c), where N_c is the number of contact points, and N_basis is the number of basis per contact point.

Parameters
robotmodel
cacheStores the kinematics information, needs to be initialized first.
Returns
Basis matrix

Here is the call graph for this function:

Here is the caller graph for this function:

void ComputeContactPointsAndWrenchReferencePoint ( const RigidBodyTree< double > &  robot,
const KinematicsCache< double > &  cache,
const Vector3< double > &  offset,
drake::Matrix3X< double > *  contact_points,
Vector3< double > *  reference_point 
) const

Computes the contact points and reference point location in the world frame.

Parameters
robotRobot model
cacheStores the kinematics information, needs to be initialized first.
offsetOffset for the reference point expressed in body frame.
[out]contact_pointsOutput of the function. Holds the contact point locations.
[out]reference_pointOutput of the function. Holds the reference point location.

Here is the call graph for this function:

Here is the caller graph for this function:

MatrixX< double > ComputeJacobianAtContactPoints ( const RigidBodyTree< double > &  robot,
const KinematicsCache< double > &  cache 
) const

Computes the linear part of the stacked Jacobian for all the contact points.

Parameters
robotRobot model
cacheStores the kinematics information, needs to be initialized first.
Returns
The stacked Jacobian matrix

Here is the call graph for this function:

Here is the caller graph for this function:

VectorX< double > ComputeJacobianDotTimesVAtContactPoints ( const RigidBodyTree< double > &  robot,
const KinematicsCache< double > &  cache 
) const

Computes the linear part of the stacked Jacobian dot times v vector for all the contact points.

Parameters
robotRobot model
cacheStores the kinematics information, needs to be initialized first.
Returns
The stacked Jacobian dot times v vector

Here is the caller graph for this function:

VectorX< double > ComputeLinearVelocityAtContactPoints ( const RigidBodyTree< double > &  robot,
const KinematicsCache< double > &  cache 
) const

Computes the stacked velocities for all the contact points.

Parameters
robotRobot model
cacheStores the kinematics information, needs to be initialized first.
Returns
Stacked velocities.

Here is the call graph for this function:

Here is the caller graph for this function:

MatrixX< double > ComputeWrenchMatrix ( const Matrix3X< double > &  contact_points,
const Vector3< double > &  reference_point 
) const

Computes a matrix that converts a vector of stacked point forces to an equivalent wrench in a frame that has the same orientation as the world frame, but located at reference_point.

The stacked point forces are assumed to have the same order of contact_points.

Parameters
contact_pointswhere the point forces are applied at. These are in the world frame.
referece_pointthe reference point for the equivalent wrench.
Returns
The matrix that converts point forces to an equivalent wrench.

Here is the call graph for this function:

Here is the caller graph for this function:

const Matrix3X<double>& contact_points ( ) const
inline

Here is the caller graph for this function:

bool is_valid ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

double Kd ( ) const
inline

Here is the caller graph for this function:

double mu ( ) const
inline

Here is the caller graph for this function:

ConstraintType& mutable_acceleration_constraint_type ( )
inline

Here is the caller graph for this function:

Matrix3X<double>& mutable_contact_points ( )
inline

Here is the caller graph for this function:

double& mutable_Kd ( )
inline

Here is the caller graph for this function:

double& mutable_mu ( )
inline

Here is the caller graph for this function:

Vector3<double>& mutable_normal ( )
inline

Here is the caller graph for this function:

int& mutable_num_basis_per_contact_point ( )
inline

Here is the caller graph for this function:

double& mutable_weight ( )
inline

Here is the caller graph for this function:

const Vector3<double>& normal ( ) const
inline

Here is the caller graph for this function:

int num_basis ( ) const
inline

Here is the caller graph for this function:

int num_basis_per_contact_point ( ) const
inline

Here is the caller graph for this function:

int num_contact_points ( ) const
inline

Here is the caller graph for this function:

bool operator!= ( const ContactInformation other) const
inline

Here is the call graph for this function:

ContactInformation& operator= ( ContactInformation &&  )
default
ContactInformation& operator= ( const ContactInformation )
default
bool operator== ( const ContactInformation other) const
void set_body ( const RigidBody< double > &  body)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

double weight ( ) const
inline

Here is the caller graph for this function:

Member Data Documentation

const int kDefaultNumBasisPerContactPoint = 4
static

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