Drake
RigidBody Class Reference

#include <drake/systems/plants/RigidBody.h>

Collaboration diagram for RigidBody:

Classes

class  CollisionElement
 

Public Member Functions

 RigidBody ()
 
const std::string & name () const
 Name of the body. More...
 
const std::string & model_name () const
 An accessor for the name of the model or robot that this rigid body is a part of. More...
 
int get_model_id () const
 Returns the ID of the model to which this rigid body belongs. More...
 
void set_model_id (int model_id)
 Sets the ID of the model to which this rigid body belongs. More...
 
void setJoint (std::unique_ptr< DrakeJoint > joint)
 Sets the parent joint through which this rigid body connects to its parent rigid body. More...
 
const DrakeJointgetJoint () const
 An accessor to this rigid body's parent joint. More...
 
bool hasParent () const
 
bool has_as_parent (const RigidBody &other) const
 Checks if a particular rigid body is the parent of this rigid body. More...
 
void addVisualElement (const DrakeShapes::VisualElement &elements)
 
const DrakeShapes::VectorOfVisualElementsgetVisualElements () const
 
void setCollisionFilter (const DrakeCollision::bitmask &group, const DrakeCollision::bitmask &ignores)
 
const DrakeCollision::bitmaskgetCollisionFilterGroup () const
 
void setCollisionFilterGroup (const DrakeCollision::bitmask &group)
 
const DrakeCollision::bitmaskgetCollisionFilterIgnores () const
 
void setCollisionFilterIgnores (const DrakeCollision::bitmask &ignores)
 
void addToCollisionFilterGroup (const DrakeCollision::bitmask &group)
 
void ignoreCollisionFilterGroup (const DrakeCollision::bitmask &group)
 
void collideWithCollisionFilterGroup (const DrakeCollision::bitmask &group)
 
bool adjacentTo (const RigidBody &other) const
 
bool CollidesWith (const RigidBody &other) const
 
bool appendCollisionElementIdsFromThisBody (const std::string &group_name, std::vector< DrakeCollision::ElementId > &ids) const
 
bool appendCollisionElementIdsFromThisBody (std::vector< DrakeCollision::ElementId > &ids) const
 
void ApplyTransformToJointFrame (const Eigen::Isometry3d &transform_body_to_joint)
 Transforms all of the visual, collision, and inertial elements associated with this body to the proper joint frame. More...
 

Public Attributes

std::string name_
 The name of this rigid body. More...
 
std::string model_name_
 The name of the model to which this rigid body belongs. More...
 
int robotnum
 A unique ID for each model. It uses 0-index, starts from 0. More...
 
RigidBodyparent
 The rigid body that's connected to this rigid body's joint. More...
 
int body_index
 The index of this rigid body in the rigid body tree. More...
 
int position_num_start
 The starting index of this rigid body's joint's position value(s) within the parent tree's state vector. More...
 
int velocity_num_start
 The starting index of this rigid body's joint's velocity value(s) within the parent tree's state vector. More...
 
DrakeShapes::VectorOfVisualElements visual_elements
 A list of visual elements for this RigidBody. More...
 
std::vector< DrakeCollision::ElementIdcollision_element_ids
 
std::map< std::string, std::vector< DrakeCollision::ElementId > > collision_element_groups
 
Eigen::Matrix3Xd contact_pts
 
double mass
 The mass of this rigid body. More...
 
Eigen::Vector3d com
 The center of mass of this rigid body. More...
 
drake::SquareTwistMatrix< doubleI
 The spatial rigid body inertia of this rigid body. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const RigidBody &b)
 

Constructor & Destructor Documentation

RigidBody ( )

Member Function Documentation

void addToCollisionFilterGroup ( const DrakeCollision::bitmask group)
inline
void addVisualElement ( const DrakeShapes::VisualElement elements)

Here is the caller graph for this function:

bool adjacentTo ( const RigidBody other) const

Here is the call graph for this function:

bool appendCollisionElementIdsFromThisBody ( const std::string &  group_name,
std::vector< DrakeCollision::ElementId > &  ids 
) const
bool appendCollisionElementIdsFromThisBody ( std::vector< DrakeCollision::ElementId > &  ids) const
void ApplyTransformToJointFrame ( const Eigen::Isometry3d &  transform_body_to_joint)

Transforms all of the visual, collision, and inertial elements associated with this body to the proper joint frame.

This is necessary, for instance, to support SDF loading where the child frame can be specified independently from the joint frame. In our RigidBodyTree classes, the body frame IS the joint frame.

Parameters
transform_body_to_jointThe transform from this body's frame to the joint's frame.

Here is the call graph for this function:

bool CollidesWith ( const RigidBody other) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void collideWithCollisionFilterGroup ( const DrakeCollision::bitmask group)
inline
int get_model_id ( ) const

Returns the ID of the model to which this rigid body belongs.

const DrakeCollision::bitmask& getCollisionFilterGroup ( ) const
inline

Here is the caller graph for this function:

const DrakeCollision::bitmask& getCollisionFilterIgnores ( ) const
inline

Here is the caller graph for this function:

const DrakeJoint & getJoint ( ) const

An accessor to this rigid body's parent joint.

By "parent joint" we mean the joint through which this rigid body connects to its parent rigid body in the rigid body tree.

Returns
The parent joint of this rigid body.

Here is the caller graph for this function:

const DrakeShapes::VectorOfVisualElements & getVisualElements ( ) const
bool has_as_parent ( const RigidBody other) const
inline

Checks if a particular rigid body is the parent of this rigid body.

Parameters
[in]otherThe potential parent of this rigid body.
Returns
true if the supplied rigid body parameter other is the parent of this rigid body.

Here is the caller graph for this function:

bool hasParent ( ) const

Here is the caller graph for this function:

void ignoreCollisionFilterGroup ( const DrakeCollision::bitmask group)
inline
const std::string & model_name ( ) const

An accessor for the name of the model or robot that this rigid body is a part of.

Returns
The name of the model that this rigid body belongs to.
const std::string & name ( ) const

Name of the body.

An accessor for the name of the body that this rigid body represents.

Returns
The name of the body that's modeled by this rigid body.

Here is the caller graph for this function:

void set_model_id ( int  model_id)

Sets the ID of the model to which this rigid body belongs.

void setCollisionFilter ( const DrakeCollision::bitmask group,
const DrakeCollision::bitmask ignores 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void setCollisionFilterGroup ( const DrakeCollision::bitmask group)
inline

Here is the caller graph for this function:

void setCollisionFilterIgnores ( const DrakeCollision::bitmask ignores)
inline

Here is the caller graph for this function:

void setJoint ( std::unique_ptr< DrakeJoint joint)

Sets the parent joint through which this rigid body connects to its parent rigid body.

Parameters
[in]jointThe parent joint of this rigid body. Note that this rigid body assumes ownership of this joint.

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const RigidBody b 
)
friend

Member Data Documentation

int body_index

The index of this rigid body in the rigid body tree.

std::map<std::string, std::vector<DrakeCollision::ElementId> > collision_element_groups
std::vector<DrakeCollision::ElementId> collision_element_ids
Eigen::Vector3d com

The center of mass of this rigid body.

Eigen::Matrix3Xd contact_pts

The spatial rigid body inertia of this rigid body.

double mass

The mass of this rigid body.

std::string model_name_

The name of the model to which this rigid body belongs.

std::string name_

The name of this rigid body.

RigidBody* parent

The rigid body that's connected to this rigid body's joint.

int position_num_start

The starting index of this rigid body's joint's position value(s) within the parent tree's state vector.

int robotnum

A unique ID for each model. It uses 0-index, starts from 0.

int velocity_num_start

The starting index of this rigid body's joint's velocity value(s) within the parent tree's state vector.

A list of visual elements for this RigidBody.


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