hpp::model::Body Class Reference

Geometry associated to a Joint. More...

#include <hpp/model/body.hh>

List of all members.

Public Member Functions

JointPtr_t joint () const
 Get joint holding the body.
void joint (JointPtr_t joint)
 Set joint holding the body.
const fcl::Vec3flocalCenterOfMass () const
void localCenterOfMass (const fcl::Vec3f &localCenterOfMass)
 Set postion of center of mass in joint reference frame.
const matrix3_tinertiaMatrix () const
 Get Intertia matrix expressed in joint local reference frame.
void inertiaMatrix (const matrix3_t &inertiaMatrix)
 Set inertia matrix.
value_type mass () const
 Get mass.
void mass (value_type mass)
 Set mass.
Construction and copy and destruction

Constructor

 Body ()
 Body (const Body &body)
 Copy constructor.
BodyPtr_t clone (const JointPtr_t &joint) const
 Clone body and attach to given joint.
virtual ~Body ()
Name
void name (const std::string &name)
 Set name.
std::string name () const
 Get name.
Inner objects
virtual void addInnerObject (const CollisionObjectPtr_t &object, bool collision, bool distance)
 Add an object to the body.
virtual void removeInnerObject (const CollisionObjectPtr_t &object, bool collision, bool distance)
 Remove an object to the body.
const ObjectVector_tinnerObjects (Request_t type) const
 Access to inner objects.
value_type radius () const
 Get radius.
Outer objects
virtual void addOuterObject (const CollisionObjectPtr_t &object, bool collision, bool distance)
 Add an object as obstacle for this body.
virtual void removeOuterObject (const CollisionObjectPtr_t &object, bool collision, bool distance)
 Remove an obstacle to the body.
const ObjectVector_touterObjects (Request_t type) const
 Access to outer objects.
Collision and distance computation
bool collisionTest () const
 Test for collision.
void computeDistances (DistanceResults_t &results, DistanceResults_t::size_type &offset)
 Compute distances between pairs of objects stored in bodies.

Detailed Description

Geometry associated to a Joint.

A body is a geometry container attached to a joint. The body contains objects (CollisionObject) that move with the joint and called inner objects.

Collision and distance computation is performed against other objects that can be obstacles or objects attached to other joints. These object are called outer objects for the body.


Constructor & Destructor Documentation

hpp::model::Body::Body ( const Body body)

Copy constructor.

virtual hpp::model::Body::~Body ( ) [inline, virtual]

Member Function Documentation

virtual void hpp::model::Body::addInnerObject ( const CollisionObjectPtr_t object,
bool  collision,
bool  distance 
) [virtual]

Add an object to the body.

Parameters:
objectobject to add. Position of object is expressed in world frame.
collisionwhether this object should be considered for collision
distancewhether this object should be considered for distance computation
Note:
If object is already in body, do nothing.
virtual void hpp::model::Body::addOuterObject ( const CollisionObjectPtr_t object,
bool  collision,
bool  distance 
) [virtual]

Add an object as obstacle for this body.

Parameters:
objectobject to add. Position of object is expressed in world frame.
collisionwhether this object should be considered for collision
distancewhether this object should be considered for distance computation
Note:
If object is already in body, do nothing.
Warning:
Added objects by this method will be unknown from the Device and will not be reset by it
BodyPtr_t hpp::model::Body::clone ( const JointPtr_t joint) const

Clone body and attach to given joint.

inner and outer object lists are filled with copies of the objects contained in the lists of this. (See CollisionObject::clone).

Test for collision.

Returns:
true if collision, false if no collision
void hpp::model::Body::computeDistances ( DistanceResults_t results,
DistanceResults_t::size_type &  offset 
)

Compute distances between pairs of objects stored in bodies.

const matrix3_t& hpp::model::Body::inertiaMatrix ( ) const [inline]

Get Intertia matrix expressed in joint local reference frame.

void hpp::model::Body::inertiaMatrix ( const matrix3_t inertiaMatrix) [inline]

Set inertia matrix.

Access to inner objects.

Parameters:
typeCollision or distance
JointPtr_t hpp::model::Body::joint ( ) const [inline]

Get joint holding the body.

void hpp::model::Body::joint ( JointPtr_t  joint) [inline]

Set joint holding the body.

References joint().

Referenced by joint().

void hpp::model::Body::localCenterOfMass ( const fcl::Vec3f localCenterOfMass) [inline]

Set postion of center of mass in joint reference frame.

value_type hpp::model::Body::mass ( ) const [inline]

Get mass.

void hpp::model::Body::mass ( value_type  mass) [inline]

Set mass.

void hpp::model::Body::name ( const std::string &  name) [inline]

Set name.

References name().

Referenced by name().

std::string hpp::model::Body::name ( ) const [inline]

Get name.

Access to outer objects.

Parameters:
typeCollision or distance

Get radius.

Radius is defined as an upper-bound to the distance of all points of the body to the origin of the joint that holds the body.

virtual void hpp::model::Body::removeInnerObject ( const CollisionObjectPtr_t object,
bool  collision,
bool  distance 
) [virtual]

Remove an object to the body.

Parameters:
objectobject to remove
collisionwhether this object should be removed from list of collision objects
distancewhether this object should be removed from list of distance computation objects
Note:
If object is not in body, do nothing
virtual void hpp::model::Body::removeOuterObject ( const CollisionObjectPtr_t object,
bool  collision,
bool  distance 
) [virtual]

Remove an obstacle to the body.

Parameters:
objectobject to remove
collisionwhether this object should be removed from list of collision objects
distancewhether this object should be removed from list of distance computation objects
Note:
If object is not in body, do nothing
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends