RobWorkProject  23.9.11-
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::core::Ptr< RigidObjectPtr
 smart pointer
 
typedef rw::core::Ptr< const RigidObjectCPtr
 const smart pointer
 
- Public Types inherited from Object
typedef rw::core::Ptr< ObjectPtr
 smart pointer
 
typedef rw::core::Ptr< const ObjectCPtr
 const smart pointer
 
- Public Types inherited from Stateless
typedef rw::core::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

 RigidObject (rw::core::Ptr< rw::kinematics::Frame > baseframe)
 constructor More...
 
 RigidObject (rw::core::Ptr< rw::kinematics::Frame > baseframe, rw::geometry::Geometry::Ptr geom)
 constructor More...
 
 RigidObject (rw::core::Ptr< rw::kinematics::Frame > baseframe, std::vector< rw::geometry::Geometry::Ptr > geom)
 constructor More...
 
 RigidObject (std::vector< rw::kinematics::Frame * > frames)
 constructor More...
 
 RigidObject (std::vector< rw::kinematics::Frame * > frames, rw::geometry::Geometry::Ptr geom)
 constructor More...
 
 RigidObject (std::vector< rw::kinematics::Frame * > frames, std::vector< rw::geometry::Geometry::Ptr > geom)
 constructor More...
 
virtual ~RigidObject ()
 destructor
 
void addGeometry (rw::geometry::Geometry::Ptr geom)
 add collision geometry from this object More...
 
void removeGeometry (rw::geometry::Geometry::Ptr geom)
 remove collision geometry from this object More...
 
void addModel (rw::geometry::Model3D::Ptr model)
 add visualization model to this object More...
 
void removeModel (rw::geometry::Model3D::Ptr model)
 remove visualization model to this rigid object More...
 
double getMass () const
 returns the mass of this RigidObject More...
 
void setMass (double mass)
 set mass of this RigidObject More...
 
rw::math::InertiaMatrix getInertia () const
 get the inertia matrix of this rigid body seen in the base frame More...
 
void setInertia (const rw::math::InertiaMatrix<> &inertia)
 set inertia of this rigid object More...
 
rw::math::Vector3D< double > getCOM () const
 get the center of mass of this rigid body seen in the base frame More...
 
void setCOM (const rw::math::Vector3D< double > &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 More...
 
const std::vector< rw::geometry::Model3D::Ptr > & getModels () const
 get visualization models for this rigid object More...
 
double getMass (const rw::kinematics::State &state) const
 get mass in Kg of this object More...
 
rw::math::InertiaMatrix getInertia (const 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< double > getCOM (const 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
 get base frame of this object More...
 
const std::vector< rw::kinematics::Frame * > & getFrames ()
 get all associated frames of this object More...
 
void addFrame (rw::core::Ptr< 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::geometry::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::geometry::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::geometry::Model3D::Ptr > & doGetModels (const rw::kinematics::State &state) const
 get the default models More...
 
- Protected Member Functions inherited from Object
 Object (rw::core::Ptr< 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 (rw::core::Ptr< StateData > data)
 implementations of sensor should add all their state data on initialization
 

Friends

class WorkCell
 

Additional Inherited Members

- Protected Attributes inherited from Stateless
bool _registered
 True if object has registered its state.
 
std::vector< rw::core::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.

Constructor & Destructor Documentation

◆ RigidObject() [1/6]

constructor

Parameters
baseframe[in] base frame of the object

◆ RigidObject() [2/6]

constructor

Parameters
baseframe[in] base frame of the object
geom[in] the Geometry Forming the object

◆ RigidObject() [3/6]

RigidObject ( rw::core::Ptr< rw::kinematics::Frame baseframe,
std::vector< rw::geometry::Geometry::Ptr geom 
)

constructor

Parameters
baseframe[in] base frame of the object
geom[in] the Geometry Forming the object

◆ RigidObject() [4/6]

RigidObject ( std::vector< rw::kinematics::Frame * >  frames)

constructor

Parameters
frames[in] first frame is base frame of the object

◆ RigidObject() [5/6]

RigidObject ( std::vector< rw::kinematics::Frame * >  frames,
rw::geometry::Geometry::Ptr  geom 
)

constructor

Parameters
frames[in] first frame is base frame of the object
geom[in] the Geometry Forming the object

◆ RigidObject() [6/6]

RigidObject ( std::vector< rw::kinematics::Frame * >  frames,
std::vector< rw::geometry::Geometry::Ptr geom 
)

constructor

Parameters
frames[in] first frame is base frame of the object
geom[in] a list of geometries to form the object

Member Function Documentation

◆ addGeometry()

void addGeometry ( rw::geometry::Geometry::Ptr  geom)

add collision geometry from this object

Parameters
geom[in] the geometry to add

◆ addModel()

void addModel ( rw::geometry::Model3D::Ptr  model)

add visualization model to this object

Parameters
model[in] the model to be added

◆ 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::geometry::Model3D::Ptr>& doGetModels ( const rw::kinematics::State state) const
inlineprotectedvirtual

get the default models

Returns
models for vizualization

Implements Object.

◆ getCOM() [1/2]

rw::math::Vector3D<double> getCOM ( ) const
inline

get the center of mass of this rigid body seen in the base frame

Returns
the center of mass 3D coordinate

◆ getCOM() [2/2]

rw::math::Vector3D<double> getCOM ( const 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.

◆ getGeometry()

const std::vector<rw::geometry::Geometry::Ptr>& getGeometry ( ) const

get geometry of this rigid object

Returns
a list of all Geometries

◆ getInertia() [1/2]

rw::math::InertiaMatrix getInertia ( ) const
inline

get the inertia matrix of this rigid body seen in the base frame

Returns
IntertiaMatrix

◆ getInertia() [2/2]

rw::math::InertiaMatrix getInertia ( const 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() [1/2]

double getMass ( ) const
inline

returns the mass of this RigidObject

Returns
mass of the Object

◆ getMass() [2/2]

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

get mass in Kg of this object

Parameters
state[in] the state in which the mass should be gotten from
Returns
mass in kilo grams

Implements Object.

◆ getModels()

const std::vector<rw::geometry::Model3D::Ptr>& getModels ( ) const

get visualization models for this rigid object

Returns
a list of all models

◆ removeGeometry()

void removeGeometry ( rw::geometry::Geometry::Ptr  geom)

remove collision geometry from this object

Parameters
geom[in] the geometry to remove

◆ removeModel()

void removeModel ( rw::geometry::Model3D::Ptr  model)

remove visualization model to this rigid object

Parameters
model[in] the model to be removed

◆ setInertia()

void setInertia ( const rw::math::InertiaMatrix<> &  inertia)
inline

set inertia of this rigid object

Parameters
inertia[in] the inertia of this object

◆ setMass()

void setMass ( double  mass)
inline

set mass of this RigidObject

Parameters
mass[in] the mass of this object

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