RobWorkProject  23.9.11-
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
Object Class Referenceabstract

The object class represents a physical thing in the scene which has geometry. An object has a base frame (similar to a Device) and may have a number of associated frames. More...

#include <Object.hpp>

Inherits Stateless.

Inherited by DeformableObject, and RigidObject.

Public Types

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

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...
 
virtual double getMass (const rw::kinematics::State &state) const =0
 get mass in Kg of this object More...
 
virtual rw::math::Vector3D< double > getCOM (const rw::kinematics::State &state) const =0
 get center of mass of this object More...
 
virtual rw::math::InertiaMatrix getInertia (const rw::kinematics::State &state) const =0
 returns the inertia matrix of this body calculated around COM with the orientation of the base frame.
 
- 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

 Object (rw::core::Ptr< rw::kinematics::Frame > baseframe)
 constructor
 
 Object (std::vector< rw::kinematics::Frame * > frames)
 constructor - first frame is base
 
virtual const std::vector< rw::geometry::Geometry::Ptr > & doGetGeometry (const rw::kinematics::State &state) const =0
 get geometry of this object More...
 
virtual const std::vector< rw::geometry::Model3D::Ptr > & doGetModels (const rw::kinematics::State &state) const =0
 get visualization models of this object More...
 
- 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 object class represents a physical thing in the scene which has geometry. An object has a base frame (similar to a Device) and may have a number of associated frames.

Member Function Documentation

◆ addFrame()

void addFrame ( rw::core::Ptr< rw::kinematics::Frame frame)

associate a frame to this Object.

Parameters
frame[in] frame to associate to object

◆ doGetGeometry()

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

get geometry of this object

Returns
geometry for collision detection.

Implemented in RigidObject, and DeformableObject.

◆ doGetModels()

virtual const std::vector<rw::geometry::Model3D::Ptr>& doGetModels ( const rw::kinematics::State state) const
protectedpure virtual

get visualization models of this object

Returns
models for visualization

Implemented in RigidObject, and DeformableObject.

◆ getBase() [1/2]

rw::kinematics::Frame* getBase ( )

get base frame of this object

Returns
base frame of object

◆ getBase() [2/2]

const rw::kinematics::Frame* getBase ( ) const

get base frame of this object

Returns
base frame of object

◆ getCOM()

virtual rw::math::Vector3D<double> getCOM ( const rw::kinematics::State state) const
pure virtual

get center of mass of this object

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

Implemented in RigidObject, and DeformableObject.

◆ getFrames()

const std::vector<rw::kinematics::Frame*>& getFrames ( )

get all associated frames of this object

Returns
a vector of frames

◆ getGeometry() [1/2]

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

get default geometries

Returns
geometry for collision detection

◆ getGeometry() [2/2]

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

get geometry of this object

Returns
geometry for collision detection.

◆ getMass()

virtual double getMass ( const rw::kinematics::State state) const
pure virtual

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

Implemented in RigidObject, and DeformableObject.

◆ getModels() [1/2]

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

get the default models

Returns
models for vizualization

◆ getModels() [2/2]

const std::vector<rw::geometry::Model3D::Ptr>& getModels ( const rw::kinematics::State state) const
inline

get visualization models of this object

Returns
models for visualization

◆ getName()

const std::string& getName ( )
inline

get name of this object. Name is always the same as the name of the base frame.

Returns
name of object.

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