MIRA
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
RigidModel Class Referenceabstract

Class representing a named rigid model. More...

#include <model/RigidModel.h>

Inheritance diagram for RigidModel:
Inheritance graph
[legend]

Public Types

typedef std::list< LinkPtrLinkList
 A list of links. More...
 
typedef std::map< std::string, JointPtrJointMap
 Maps joint pointers to their name. More...
 
typedef std::map< std::string, MaterialPtrMaterialMap
 Maps material pointers to their name. More...
 
typedef std::list< std::pair< GeometryPtr, RigidTransform3f >, Eigen::aligned_allocator< std::pair< GeometryPtr, RigidTransform3f > > > CollisionGeometries
 List of collision geometries, each item consisting of the geometry pointer and a transform that describes the position of the geometry. More...
 

Public Member Functions

virtual ~RigidModel ()
 Destructor. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 
void reflect (XMLDeserializer &r)
 Specialized reflect for XMLDeserializer. More...
 
void clear ()
 Clears the rigid model. More...
 
std::string getRootLink () const
 Returns the name of the root link, the only link that has no parent. More...
 
CollisionGeometries getCollisionGeometries (std::string targetFrame="", const Time &timestamp=Time::now(), const std::string &filter="") const
 Returns a list of the models collision geometries and the corresponding transforms for each geometry that describes its position within the model. More...
 
std::list< Box3fgetCollisionBoundingBoxes (std::string targetFrame="", const Time &timestamp=Time::now(), const std::string &filter="") const
 Returns a list of the bounding boxes for each of the models collision geometries at their correct positions. More...
 
Footprint getFootprint (std::string targetFrame="", const Time &timestamp=Time::now(), const std::string &filter="") const
 Returns the models footprint (the projection on the xy-plane). More...
 
void resolveAndPublishLinks (const std::string &ns, const Time &timestamp=Time::now())
 Resolves all link names in the model and adds the transforms between them to the transform tree. More...
 
void publishJoint (const std::string &name, float value, const Time &timestamp=Time::now()) const
 Publishes the state of the joint with the given name. More...
 
Class const & getClass () const
 

Static Public Member Functions

static PseudoClass const & CLASS ()
 

Public Attributes

std::string name
 Name of the model. More...
 
LinkList links
 List of links used by this model. More...
 
JointMap joints
 Map with name - joint pointer pairs used by this model. More...
 
MaterialMap materials
 Map with name - material pointer pairs used by this model. More...
 

Protected Member Functions

virtual Class const & internalGetClass () const=0
 

Detailed Description

Class representing a named rigid model.

A rigid model consists of:

Member Typedef Documentation

◆ LinkList

typedef std::list<LinkPtr> LinkList

A list of links.

◆ JointMap

typedef std::map<std::string, JointPtr> JointMap

Maps joint pointers to their name.

◆ MaterialMap

typedef std::map<std::string, MaterialPtr> MaterialMap

Maps material pointers to their name.

◆ CollisionGeometries

List of collision geometries, each item consisting of the geometry pointer and a transform that describes the position of the geometry.

Constructor & Destructor Documentation

◆ ~RigidModel()

virtual ~RigidModel ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ reflect() [1/2]

void reflect ( Reflector &  r)
inline

◆ reflect() [2/2]

void reflect ( XMLDeserializer r)

Specialized reflect for XMLDeserializer.

◆ clear()

void clear ( )

Clears the rigid model.

◆ getRootLink()

std::string getRootLink ( ) const

Returns the name of the root link, the only link that has no parent.

Exceptions
XLogical,ifNONE or MORE than one root link exists

◆ getCollisionGeometries()

CollisionGeometries getCollisionGeometries ( std::string  targetFrame = "",
const Time timestamp = Time::now(),
const std::string &  filter = "" 
) const

Returns a list of the models collision geometries and the corresponding transforms for each geometry that describes its position within the model.

All transforms are given in relation to the specified target frame. If the target frame is left blank, the root link of the model is used, i.e. the footprint is given in the coordinate frame of the model. The optional timestamp parameter allows to specify a timestamp that is used for querying the transforms.

Parameters
[in]targetFrameAll transforms will be given relative to this frame. If empty (default) the root frame of the model will be used, so all transforms will be relative to the models origin.
[in]timestampTimestamp used for querying transforms
[in]filterFilter for filtering only collision geometries where the name matches the filter By default collision geometries with no name are returned

◆ getCollisionBoundingBoxes()

std::list<Box3f> getCollisionBoundingBoxes ( std::string  targetFrame = "",
const Time timestamp = Time::now(),
const std::string &  filter = "" 
) const

Returns a list of the bounding boxes for each of the models collision geometries at their correct positions.

All transforms and hence the position of the boxes are given in relation to the specified target frame. If the target frame is left blank, the root link of the model is used, i.e. the bounding boxes are given in the coordinate frame of the model. The optional timestamp parameter allows to specify a timestamp that is used for querying the transforms.

Parameters
[in]targetFrameAll box positions will be given relative to this frame. If empty (default) the root frame of the model will be used, so all box positions will be relative to the models origin.
[in]timestampTimestamp used for querying transforms
[in]filterFilter for filtering only collision geometries where the name matches the filter By default collision geometries with no name are used for calculating the bounding boxes

◆ getFootprint()

Footprint getFootprint ( std::string  targetFrame = "",
const Time timestamp = Time::now(),
const std::string &  filter = "" 
) const

Returns the models footprint (the projection on the xy-plane).

The geometry of the footprint is returned in relation to the specified target frame. If the target frame is left blank, the root link of the model is used, i.e. the footprint is given in the coordinate frame of the model.

Parameters
[in]targetFrameThe footprint will be given relative to this frame. If empty (default) the root frame of the model will be used, so the footprint will be relative to the models origin.
[in]timestampTimestamp used for querying transforms
[in]filterFilter for filtering only collision geometries where the name matches the filter By default collision geometries with no name are used for calculating the footprint

◆ resolveAndPublishLinks()

void resolveAndPublishLinks ( const std::string &  ns,
const Time timestamp = Time::now() 
)

Resolves all link names in the model and adds the transforms between them to the transform tree.

Parameters
nsThe namespace of the model.
timestampAn optional timestamp of the (initial) transformation states

◆ publishJoint()

void publishJoint ( const std::string &  name,
float  value,
const Time timestamp = Time::now() 
) const

Publishes the state of the joint with the given name.

Can be used for CONTINUOUS, REVOLUTE and PRISMATIC joints.

Exceptions
XInvalidConfigif used with not supported types of joints
Parameters
nameName of the joint to alter
valueThe new value for the joint
  • radian for CONTINUOUS and REVOLUTE
  • meter for PRISMATIC
timestampAn optional timestamp of the new joint state

Member Data Documentation

◆ name

std::string name

Name of the model.

◆ links

LinkList links

List of links used by this model.

◆ joints

JointMap joints

Map with name - joint pointer pairs used by this model.

◆ materials

MaterialMap materials

Map with name - material pointer pairs used by this model.


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