openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
OpenRAVE::KinBody::Link Class Reference

A rigid body holding all its collision and rendering data. More...

#include <kinbody.h>

Inheritance diagram for OpenRAVE::KinBody::Link:
Inheritance graph
[legend]
Collaboration diagram for OpenRAVE::KinBody::Link:
Collaboration graph
[legend]

Classes

class  Geometry
 geometry object holding a link parent and wrapping access to a protected geometry info More...
 

Public Types

typedef KinBody::GeometryInfo
GeometryInfo 
RAVE_DEPRECATED
 
typedef boost::shared_ptr
< KinBody::GeometryInfo >
GeometryInfoPtr 
RAVE_DEPRECATED
 
typedef TriMesh TRIMESH RAVE_DEPRECATED
 
typedef GeometryType GeomType RAVE_DEPRECATED
 
typedef boost::shared_ptr
< Geometry
GeometryPtr
 
typedef boost::shared_ptr
< Geometry const > 
GeometryConstPtr
 
typedef Geometry GEOMPROPERTIES RAVE_DEPRECATED
 

Public Member Functions

 Link (KinBodyPtr parent)
 pass in a ODE world
 
virtual ~Link ()
 
const std::string & GetName () const
 
bool IsStatic () const
 Indicates a static body that does not move with respect to the root link.
 
virtual void Enable (bool enable)
 Enables a Link. An enabled link takes part in collision detection and physics simulations.
 
virtual bool IsEnabled () const
 returns true if the link is enabled.
 
virtual bool SetVisible (bool visible)
 Sets all the geometries of the link as visible or non visible.
 
virtual bool IsVisible () const
 
KinBodyPtr GetParent () const
 parent body that link belong to.
 
int GetIndex () const
 unique index into parent KinBody::GetLinks vector
 
const TriMeshGetCollisionData () const
 
virtual AABB ComputeLocalAABB () const
 Compute the aabb of all the geometries of the link in the link coordinate system.
 
virtual AABB ComputeAABB () const
 Compute the aabb of all the geometries of the link in the world coordinate system.
 
Transform GetTransform () const
 Return the current transformation of the link in the world coordinate system.
 
virtual void GetParentLinks (std::vector< boost::shared_ptr< Link > > &vParentLinks) const
 Return all the direct parent links in the kinematics hierarchy of this link.
 
virtual bool IsParentLink (boost::shared_ptr< Link const > plink) const
 Tests if a link is a direct parent.
 
Vector GetLocalCOM () const
 return center of mass offset in the link's local coordinate frame
 
Vector GetGlobalCOM () const
 return center of mass of the link in the global coordinate system
 
Vector GetCOMOffset () const
 
virtual TransformMatrix GetLocalInertia () const
 return inertia in link's local coordinate frame. The translation component is the the COM in the link's frame.
 
virtual TransformMatrix GetGlobalInertia () const
 
TransformMatrix GetInertia () const RAVE_DEPRECATED
 
virtual void SetLocalMassFrame (const Transform &massframe)
 sets a new mass frame with respect to the link coordinate system
 
virtual void SetPrincipalMomentsOfInertia (const Vector &inertiamoments)
 sets new principal moments of inertia (with respect to the mass frame)
 
virtual void SetMass (dReal mass)
 set a new mass
 
const TransformGetLocalMassFrame () const
 return the mass frame in the link's local coordinate system that holds the center of mass and principal axes for inertia.
 
Transform GetGlobalMassFrame () const
 return the mass frame in the global coordinate system that holds the center of mass and principal axes for inertia.
 
const VectorGetPrincipalMomentsOfInertia () const
 return the principal moments of inertia inside the mass frame
 
dReal GetMass () const
 
virtual void SetStatic (bool bStatic)
 sets a link to be static.
 
virtual void SetTransform (const Transform &transform)
 Sets the transform of the link regardless of kinematics.
 
virtual void SetForce (const Vector &force, const Vector &pos, bool add)
 
virtual void SetTorque (const Vector &torque, bool add)
 
virtual void SetVelocity (const Vector &linearvel, const Vector &angularvel)
 
virtual void GetVelocity (Vector &linearvel, Vector &angularvel) const
 get the velocity of the link
 
virtual std::pair< Vector, VectorGetVelocity () const
 return the linear/angular velocity of the link
 
const std::vector< GeometryPtr > & GetGeometries () const
 returns a list of all the geometry objects.
 
virtual GeometryPtr GetGeometry (int index)
 
virtual void InitGeometries (std::vector< KinBody::GeometryInfoConstPtr > &geometries)
 inits the current geometries with the new geometry info.
 
virtual void InitGeometries (std::list< KinBody::GeometryInfo > &geometries)
 
virtual void SwapGeometries (boost::shared_ptr< Link > &link)
 swaps the geometries with the link
 
virtual bool ValidateContactNormal (const Vector &position, Vector &normal) const
 
virtual bool IsRigidlyAttached (boost::shared_ptr< Link const > plink) const
 returns true if plink is rigidily attahced to this link.
 
virtual void GetRigidlyAttachedLinks (std::vector< boost::shared_ptr< Link > > &vattachedlinks) const
 Gets all the rigidly attached links to linkindex, also adds the link to the list.
 
virtual void serialize (std::ostream &o, int options) const
 
const std::map< std::string,
std::vector< dReal > > & 
GetFloatParameters () const
 return a map of custom float parameters
 
virtual void SetFloatParameters (const std::string &key, const std::vector< dReal > &parameters)
 set custom float parameters
 
const std::map< std::string,
std::vector< int > > & 
GetIntParameters () const
 return a map of custom integer parameters
 
virtual void SetIntParameters (const std::string &key, const std::vector< int > &parameters)
 set custom int parameters
 
virtual void UpdateInfo ()
 Updates several fields in _info depending on the current state of the link.
 
const KinBody::LinkInfoGetInfo () const
 returns the current info structure of the link.
 
const KinBody::LinkInfoUpdateAndGetInfo ()
 Calls UpdateInfo and returns the link structure.
 

Static Public Attributes

static const GeometryType GeomNone RAVE_DEPRECATED = OpenRAVE::GT_None
 
static const GeometryType GeomBox RAVE_DEPRECATED = OpenRAVE::GT_Box
 
static const GeometryType
GeomSphere 
RAVE_DEPRECATED = OpenRAVE::GT_Sphere
 
static const GeometryType
GeomCylinder 
RAVE_DEPRECATED = OpenRAVE::GT_Cylinder
 
static const GeometryType
GeomTrimesh 
RAVE_DEPRECATED = OpenRAVE::GT_TriMesh
 

Protected Member Functions

virtual void _Update ()
 Updates the cached information due to changes in the collision data.
 

Protected Attributes

std::vector< GeometryPtr_vGeometries
 
LinkInfo _info
 parameter information of the link
 

Detailed Description

A rigid body holding all its collision and rendering data.

Definition at line 186 of file kinbody.h.

Member Typedef Documentation

typedef boost::shared_ptr<Geometry const> OpenRAVE::KinBody::Link::GeometryConstPtr

Definition at line 326 of file kinbody.h.

typedef boost::shared_ptr<Geometry> OpenRAVE::KinBody::Link::GeometryPtr

Definition at line 325 of file kinbody.h.

Deprecated:
(12/10/18)

Definition at line 193 of file kinbody.h.

Definition at line 194 of file kinbody.h.

Definition at line 195 of file kinbody.h.

Definition at line 196 of file kinbody.h.

Definition at line 327 of file kinbody.h.

Constructor & Destructor Documentation

OpenRAVE::KinBody::Link::Link ( KinBodyPtr  parent)

pass in a ODE world

Definition at line 25 of file kinbodylink.cpp.

OpenRAVE::KinBody::Link::~Link ( )
virtual

Definition at line 31 of file kinbodylink.cpp.

Member Function Documentation

void OpenRAVE::KinBody::Link::_Update ( )
protectedvirtual

Updates the cached information due to changes in the collision data.

Definition at line 420 of file kinbodylink.cpp.

AABB OpenRAVE::KinBody::Link::ComputeAABB ( ) const
virtual

Compute the aabb of all the geometries of the link in the world coordinate system.

Definition at line 203 of file kinbodylink.cpp.

AABB OpenRAVE::KinBody::Link::ComputeLocalAABB ( ) const
virtual

Compute the aabb of all the geometries of the link in the link coordinate system.

Definition at line 148 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::Enable ( bool  enable)
virtual

Enables a Link. An enabled link takes part in collision detection and physics simulations.

Definition at line 36 of file kinbodylink.cpp.

const TriMesh& OpenRAVE::KinBody::Link::GetCollisionData ( ) const
inline

Definition at line 364 of file kinbody.h.

Vector OpenRAVE::KinBody::Link::GetCOMOffset ( ) const
inline

Definition at line 402 of file kinbody.h.

const std::map<std::string, std::vector<dReal> >& OpenRAVE::KinBody::Link::GetFloatParameters ( ) const
inline

return a map of custom float parameters

Definition at line 511 of file kinbody.h.

const std::vector<GeometryPtr>& OpenRAVE::KinBody::Link::GetGeometries ( ) const
inline

returns a list of all the geometry objects.

Definition at line 479 of file kinbody.h.

KinBody::Link::GeometryPtr OpenRAVE::KinBody::Link::GetGeometry ( int  index)
virtual

Definition at line 317 of file kinbodylink.cpp.

Vector OpenRAVE::KinBody::Link::GetGlobalCOM ( ) const
inline

return center of mass of the link in the global coordinate system

Definition at line 398 of file kinbody.h.

TransformMatrix OpenRAVE::KinBody::Link::GetGlobalInertia ( ) const
virtual

Definition at line 125 of file kinbodylink.cpp.

Transform OpenRAVE::KinBody::Link::GetGlobalMassFrame ( ) const
inline

return the mass frame in the global coordinate system that holds the center of mass and principal axes for inertia.

Definition at line 433 of file kinbody.h.

int OpenRAVE::KinBody::Link::GetIndex ( ) const
inline

unique index into parent KinBody::GetLinks vector

Definition at line 361 of file kinbody.h.

TransformMatrix OpenRAVE::KinBody::Link::GetInertia ( ) const
inline
Deprecated:
(12/1/20)

Definition at line 413 of file kinbody.h.

const KinBody::LinkInfo& OpenRAVE::KinBody::Link::GetInfo ( ) const
inline

returns the current info structure of the link.

The LinkInfo::_vgeometryinfos do not reflect geometry changes that happened since the robot was created. User will need to call Geometry::GetInfo on each individual geometry.

Definition at line 537 of file kinbody.h.

const std::map<std::string, std::vector<int> >& OpenRAVE::KinBody::Link::GetIntParameters ( ) const
inline

return a map of custom integer parameters

Definition at line 521 of file kinbody.h.

Vector OpenRAVE::KinBody::Link::GetLocalCOM ( ) const
inline

return center of mass offset in the link's local coordinate frame

Definition at line 393 of file kinbody.h.

TransformMatrix OpenRAVE::KinBody::Link::GetLocalInertia ( ) const
virtual

return inertia in link's local coordinate frame. The translation component is the the COM in the link's frame.

Definition at line 120 of file kinbodylink.cpp.

const Transform& OpenRAVE::KinBody::Link::GetLocalMassFrame ( ) const
inline

return the mass frame in the link's local coordinate system that holds the center of mass and principal axes for inertia.

Definition at line 428 of file kinbody.h.

dReal OpenRAVE::KinBody::Link::GetMass ( ) const
inline

Definition at line 441 of file kinbody.h.

const std::string& OpenRAVE::KinBody::Link::GetName ( ) const
inline

Definition at line 329 of file kinbody.h.

KinBodyPtr OpenRAVE::KinBody::Link::GetParent ( ) const
inline

parent body that link belong to.

Definition at line 356 of file kinbody.h.

void OpenRAVE::KinBody::Link::GetParentLinks ( std::vector< boost::shared_ptr< Link > > &  vParentLinks) const
virtual

Return all the direct parent links in the kinematics hierarchy of this link.

A parent link is is immediately connected to this link by a joint and has a path to the root joint so that it is possible to compute this link's transformation from its parent.

Parameters
[out]filledwith the parent links

Definition at line 77 of file kinbodylink.cpp.

const Vector& OpenRAVE::KinBody::Link::GetPrincipalMomentsOfInertia ( ) const
inline

return the principal moments of inertia inside the mass frame

Definition at line 438 of file kinbody.h.

void OpenRAVE::KinBody::Link::GetRigidlyAttachedLinks ( std::vector< boost::shared_ptr< Link > > &  vattachedlinks) const
virtual

Gets all the rigidly attached links to linkindex, also adds the link to the list.

Parameters
vattachedlinksthe array to insert all links attached to linkindex with the link itself.

Definition at line 370 of file kinbodylink.cpp.

Transform OpenRAVE::KinBody::Link::GetTransform ( ) const
inline

Return the current transformation of the link in the world coordinate system.

Definition at line 375 of file kinbody.h.

void OpenRAVE::KinBody::Link::GetVelocity ( Vector linearvel,
Vector angularvel 
) const
virtual

get the velocity of the link

Parameters
[out]linearvelthe translational velocity
[out]angularvelis the rotation axis * angular speed

Definition at line 304 of file kinbodylink.cpp.

std::pair< Vector, Vector > OpenRAVE::KinBody::Link::GetVelocity ( ) const
virtual

return the linear/angular velocity of the link

Definition at line 310 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::InitGeometries ( std::vector< KinBody::GeometryInfoConstPtr > &  geometries)
virtual

inits the current geometries with the new geometry info.

This gives a user control for dynamically changing the object geometry. Note that the kinbody/robot hash could change.

Parameters
geometriesa list of geometry infos to be initialized into new geometry objects, note that the geometry info data is copied

Definition at line 322 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::InitGeometries ( std::list< KinBody::GeometryInfo > &  geometries)
virtual

Definition at line 332 of file kinbodylink.cpp.

bool OpenRAVE::KinBody::Link::IsEnabled ( ) const
virtual

returns true if the link is enabled.

See Also
Enable

Definition at line 46 of file kinbodylink.cpp.

bool OpenRAVE::KinBody::Link::IsParentLink ( boost::shared_ptr< Link const >  plink) const
virtual

Tests if a link is a direct parent.

See Also
GetParentLinks
Parameters
linkThe link to test if it is one of the parents of this link.

Definition at line 86 of file kinbodylink.cpp.

bool OpenRAVE::KinBody::Link::IsRigidlyAttached ( boost::shared_ptr< Link const >  plink) const
virtual

returns true if plink is rigidily attahced to this link.

Definition at line 401 of file kinbodylink.cpp.

bool OpenRAVE::KinBody::Link::IsStatic ( ) const
inline

Indicates a static body that does not move with respect to the root link.

Static should be used when an object has infinite mass and shouldn't be affected by physics (including gravity). Collision still works.

Definition at line 337 of file kinbody.h.

bool OpenRAVE::KinBody::Link::IsVisible ( ) const
virtual
Returns
true if any geometry of the link is visible.

Definition at line 67 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::serialize ( std::ostream &  o,
int  options 
) const
virtual

Definition at line 259 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetFloatParameters ( const std::string &  key,
const std::vector< dReal > &  parameters 
)
virtual

set custom float parameters

Parameters
parametersif empty, then removes the parameter

Definition at line 379 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetForce ( const Vector force,
const Vector pos,
bool  add 
)
virtual

adds an external force at pos (absolute coords)

Parameters
[in]forcethe direction and magnitude of the force
[in]posin the world where the force is getting applied
[in]addif true, force is added to previous forces, otherwise it is set

Definition at line 289 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetIntParameters ( const std::string &  key,
const std::vector< int > &  parameters 
)
virtual

set custom int parameters

Parameters
parametersif empty, then removes the parameter

Definition at line 390 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetLocalMassFrame ( const Transform massframe)
virtual

sets a new mass frame with respect to the link coordinate system

Definition at line 130 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetMass ( dReal  mass)
virtual

set a new mass

Definition at line 142 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetPrincipalMomentsOfInertia ( const Vector inertiamoments)
virtual

sets new principal moments of inertia (with respect to the mass frame)

Definition at line 136 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetStatic ( bool  bStatic)
virtual

sets a link to be static.

Because this can affect the kinematics, it requires the body's internal structures to be recomputed

Definition at line 275 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetTorque ( const Vector torque,
bool  add 
)
virtual

adds torque to a body (absolute coords)

Parameters
addif true, torque is added to previous torques, otherwise it is set

Definition at line 294 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetTransform ( const Transform transform)
virtual

Sets the transform of the link regardless of kinematics.

Parameters
[in]tthe new transformation

Definition at line 283 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SetVelocity ( const Vector linearvel,
const Vector angularvel 
)
virtual

forces the velocity of the link

Parameters
[in]linearvelthe translational velocity
[in]angularvelis the rotation axis * angular speed

Definition at line 299 of file kinbodylink.cpp.

bool OpenRAVE::KinBody::Link::SetVisible ( bool  visible)
virtual

Sets all the geometries of the link as visible or non visible.

Returns
true if changed

Definition at line 51 of file kinbodylink.cpp.

void OpenRAVE::KinBody::Link::SwapGeometries ( boost::shared_ptr< Link > &  link)
virtual

swaps the geometries with the link

Definition at line 344 of file kinbodylink.cpp.

const KinBody::LinkInfo& OpenRAVE::KinBody::Link::UpdateAndGetInfo ( )
inline

Calls UpdateInfo and returns the link structure.

Definition at line 542 of file kinbody.h.

void OpenRAVE::KinBody::Link::UpdateInfo ( )
virtual

Updates several fields in _info depending on the current state of the link.

Definition at line 406 of file kinbodylink.cpp.

bool OpenRAVE::KinBody::Link::ValidateContactNormal ( const Vector position,
Vector normal 
) const
virtual

validates the contact normal on link and makes sure the normal faces "outside" of the geometry shape it lies on. An exception can be thrown if position is not on a geometry surface

Parameters
positionthe position of the contact point specified in the link's coordinate system, assumes it is on a particular geometry
normalthe unit normal of the contact point specified in the link's coordinate system
Returns
true if the normal is changed to face outside of the shape

Definition at line 359 of file kinbodylink.cpp.

Member Data Documentation

LinkInfo OpenRAVE::KinBody::Link::_info
protected

parameter information of the link

Definition at line 553 of file kinbody.h.

std::vector<GeometryPtr> OpenRAVE::KinBody::Link::_vGeometries
protected
See Also
GetGeometries

Definition at line 551 of file kinbody.h.

Definition at line 197 of file kinbody.h.

Definition at line 198 of file kinbody.h.

Definition at line 199 of file kinbody.h.

Definition at line 200 of file kinbody.h.

Definition at line 201 of file kinbody.h.


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