RobWorkProject
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
RigidObject Class Reference

the RigidObject defines a physical object in the workcell that is rigid in the sence that the geometry does not change. The rigid object also have basic properties such as Inertia and mass. These are default 1.0 kg and inertia of solid sphere with mass 1.0kg and radius of 10cm. The center of mass defaults to origin of the base frame. More...

#include <RigidObject.hpp>

Inherits Object.

Public Types

typedef rw::common::Ptr< RigidObjectPtr
 smart pointer
 
typedef rw::common::Ptr< const RigidObjectCPtr
 const smart pointer
 
- Public Types inherited from Object
typedef rw::common::Ptr< ObjectPtr
 smart pointer
 
typedef rw::common::Ptr< const ObjectCPtr
 const smart pointer
 
- Public Types inherited from Stateless
typedef rw::common::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

 RigidObject (rw::kinematics::Frame *baseframe)
 constructor
 
 RigidObject (rw::kinematics::Frame *baseframe, rw::geometry::Geometry::Ptr geom)
 constructor
 
 RigidObject (rw::kinematics::Frame *baseframe, std::vector< rw::geometry::Geometry::Ptr > geom)
 constructor
 
 RigidObject (std::vector< rw::kinematics::Frame *> frames)
 constructor - first frame is base
 
 RigidObject (std::vector< rw::kinematics::Frame *> frames, rw::geometry::Geometry::Ptr geom)
 constructor - first frame is base
 
 RigidObject (std::vector< rw::kinematics::Frame *> frames, std::vector< rw::geometry::Geometry::Ptr > geom)
 
virtual ~RigidObject ()
 destructor
 
void addGeometry (rw::geometry::Geometry::Ptr geom)
 add collision geometry from this object
 
void removeGeometry (rw::geometry::Geometry::Ptr geom)
 remove collision geometry from this object
 
void addModel (rw::graphics::Model3D::Ptr model)
 add visualization model to this object
 
void removeModel (rw::graphics::Model3D::Ptr model)
 add visualization model to this rigid object
 
double getMass () const
 returns the mass of this RigidObject
 
void setMass (double mass)
 set mass of this RigidObject
 
rw::math::InertiaMatrix getInertia () const
 get the inertia matrix of this rigid body seen in the base frame
 
void setInertia (const rw::math::InertiaMatrix<> &inertia)
 set inertia of this rigid object
 
rw::math::Vector3D getCOM () const
 get the center of mass of this rigid body seen in the base frame
 
void setCOM (const rw::math::Vector3D<> &com)
 set the center of mass of this rigid body seen in the base frame
 
void approximateInertia ()
 approximates inertia based on geometry, mass and center of mass properties
 
void approximateInertiaCOM ()
 approximates inertia and center of mass based on geometry and mass properties
 
const std::vector< rw::geometry::Geometry::Ptr > & getGeometry () const
 get geometry of this rigid object
 
const std::vector< rw::graphics::Model3D::Ptr > & getModels () const
 get visualization models for this rigid object
 
double getMass (rw::kinematics::State &state) const
 get mass in Kg of this object More...
 
rw::math::InertiaMatrix getInertia (rw::kinematics::State &state) const
 returns the inertia matrix of this body calculated around COM with the orientation of the base frame. More...
 
rw::math::Vector3D getCOM (rw::kinematics::State &state) const
 get center of mass of this object More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 destructor
 
const std::string & getName ()
 get name of this object. Name is always the same as the name of the base frame. More...
 
rw::kinematics::FramegetBase ()
 get base frame of this object More...
 
const rw::kinematics::FramegetBase () const
 
const std::vector< rw::kinematics::Frame * > & getFrames ()
 get all associated frames of this object More...
 
void addFrame (rw::kinematics::Frame *frame)
 associate a frame to this Object. More...
 
const std::vector< rw::geometry::Geometry::Ptr > & getGeometry () const
 get default geometries More...
 
const std::vector< rw::graphics::Model3D::Ptr > & getModels () const
 get the default models More...
 
const std::vector< rw::geometry::Geometry::Ptr > & getGeometry (const rw::kinematics::State &state) const
 get geometry of this object More...
 
const std::vector< rw::graphics::Model3D::Ptr > & getModels (const rw::kinematics::State &state) const
 get visualization models of this object More...
 
- Public Member Functions inherited from Stateless
virtual ~Stateless ()
 destructor
 
virtual void registerIn (State &state)
 initialize this stateless data to a specific state More...
 
virtual void registerIn (StateStructure::Ptr state)
 register this stateless object in a statestructure.
 
virtual void unregister ()
 unregisters all state data of this stateless object
 
StateStructure::Ptr getStateStructure ()
 Get the state structure. More...
 
const StateStructure::Ptr getStateStructure () const
 Get the state structure. More...
 
bool isRegistered ()
 Check if object has registered its state. More...
 

Protected Member Functions

const std::vector< rw::geometry::Geometry::Ptr > & doGetGeometry (const rw::kinematics::State &state) const
 get default geometries More...
 
const std::vector< rw::graphics::Model3D::Ptr > & doGetModels (const rw::kinematics::State &state) const
 get the default models More...
 
- Protected Member Functions inherited from Object
 Object (rw::kinematics::Frame *baseframe)
 constructor
 
 Object (std::vector< rw::kinematics::Frame *> frames)
 constructor - first frame is base
 
- Protected Member Functions inherited from Stateless
 Stateless ()
 constructor
 
template<class T >
void add (StatelessData< T > &data)
 implementations of sensor should add all their stateless data on initialization
 
void add (StateData *data)
 Add data. More...
 
void add (boost::shared_ptr< StateData > data)
 implementations of sensor should add all their state data on initialization
 

Friends

class WorkCell
 WorkCell keeps track of devices, obstacles and objects in the scene. More...
 

Additional Inherited Members

- Protected Attributes inherited from Stateless
bool _registered
 True if object has registered its state.
 
std::vector< boost::shared_ptr< StateData > > _datas
 Data.
 
StateStructure::Ptr _stateStruct
 The state structure.
 

Detailed Description

the RigidObject defines a physical object in the workcell that is rigid in the sence that the geometry does not change. The rigid object also have basic properties such as Inertia and mass. These are default 1.0 kg and inertia of solid sphere with mass 1.0kg and radius of 10cm. The center of mass defaults to origin of the base frame.

Member Function Documentation

◆ doGetGeometry()

const std::vector<rw::geometry::Geometry::Ptr>& doGetGeometry ( const rw::kinematics::State state) const
inlineprotectedvirtual

get default geometries

Returns
geometry for collision detection

Implements Object.

◆ doGetModels()

const std::vector<rw::graphics::Model3D::Ptr>& doGetModels ( const rw::kinematics::State state) const
inlineprotectedvirtual

get the default models

Returns
models for vizualization

Implements Object.

◆ getCOM()

rw::math::Vector3D getCOM ( rw::kinematics::State state) const
inlinevirtual

get center of mass of this object

Parameters
state[in] the state in which to get center of mass
Returns

Implements Object.

◆ getInertia()

rw::math::InertiaMatrix getInertia ( rw::kinematics::State state) const
inlinevirtual

returns the inertia matrix of this body calculated around COM with the orientation of the base frame.

Implements Object.

◆ getMass()

double getMass ( rw::kinematics::State state) const
inlinevirtual

get mass in Kg of this object

Returns
mass in kilo grams

Implements Object.

Friends And Related Function Documentation

◆ WorkCell

friend class WorkCell
friend

WorkCell keeps track of devices, obstacles and objects in the scene.

WorkCell is a pretty dumb container to which you can add your devices and the frames you your GUI to show as objects or camera views.

WorkCell is responsible for keeping track of everything including all devices, object and obstacles in the environment. WorkCell contains the World Frame, which represents the root and the only frame without a parent.


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