Simox  2.3.50
VirtualRobot::CollisionModel Class Reference

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW CollisionModel (const VisualizationNodePtr visu, const std::string &name="", CollisionCheckerPtr colChecker=CollisionCheckerPtr(), int id=666, float margin=0.0f)
 
virtual ~CollisionModel ()
 
std::string getName ()
 
BoundingBox getBoundingBox (bool global=true)
 
Eigen::Matrix4f getGlobalPose ()
 
virtual void setGlobalPose (const Eigen::Matrix4f &pose)
 
CollisionCheckerPtr getCollisionChecker ()
 
boost::shared_ptr< CollisionModelPQPgetCollisionModelImplementation ()
 
CollisionModelPtr clone (CollisionCheckerPtr colChecker=CollisionCheckerPtr(), float scaling=1.0f, bool deepVisuCopy=true)
 
void setVisualization (const VisualizationNodePtr visu)
 
int getId ()
 
void setUpdateVisualization (bool enable)
 
bool getUpdateVisualizationStatus ()
 
VisualizationNodePtr getVisualization ()
 
VisualizationNodePtr getModelDataVisualization ()
 
virtual int getNumFaces ()
 get number of faces (i.e. triangles) of this object More...
 
virtual void print ()
 
std::vector< Eigen::Vector3f > getModelVeticesGlobal ()
 
TriMeshModelPtr getTriMeshModel ()
 
std::string toXML (const std::string &basePath, int tabs)
 
std::string toXML (const std::string &basePath, const std::string &filename, int tabs)
 
virtual bool saveModel (const std::string &modelPath, const std::string &filename)
 
virtual void scale (Eigen::Vector3f &scaleFactor)
 
float getMargin () const
 
void inflateModel (float margin)
 in/deflates the model. If value is <0 the model is deflated. More...
 

Static Public Member Functions

static CollisionModelPtr CreateUnitedCollisionModel (const std::vector< CollisionModelPtr > &colModels)
 

Protected Member Functions

 CollisionModel (VisualizationNodePtr visu, const std::string &name, CollisionCheckerPtr colChecker, int id, InternalCollisionModelPtr collisionModel)
 
void destroyData ()
 delete all data More...
 

Protected Attributes

VisualizationNodePtr visualization
 
VisualizationNodePtr origVisualization
 
VisualizationNodePtr modelVisualization
 
bool updateVisualization
 
TriMeshModelPtr model
 
float margin
 
BoundingBox bbox
 
std::string name
 the name More...
 
int id
 
CollisionCheckerPtr colChecker
 
Eigen::Matrix4f globalPose
 
boost::shared_ptr< CollisionModelPQPcollisionModelImplementation
 

Detailed Description

An abstract representation of an object that can be used for collision queries.

Constructor & Destructor Documentation

VirtualRobot::CollisionModel::CollisionModel ( const VisualizationNodePtr  visu,
const std::string &  name = "",
CollisionCheckerPtr  colChecker = CollisionCheckerPtr(),
int  id = 666,
float  margin = 0.0f 
)

Standard Constructor If collision checks should be done in parallel, different CollisionCheckers can be specified.

Parameters
visuA visualization that is used for creating an internal triangle based representation of the object.
nameThe name of this object.
colCheckerIf not specified, the global singleton instance is used. Only useful, when parallel collision checks should be performed.
idA user id.
VirtualRobot::CollisionModel::~CollisionModel ( )
virtual

Standard Destructor

VirtualRobot::CollisionModel::CollisionModel ( VisualizationNodePtr  visu,
const std::string &  name,
CollisionCheckerPtr  colChecker,
int  id,
InternalCollisionModelPtr  collisionModel 
)
protected

Member Function Documentation

VirtualRobot::CollisionModelPtr VirtualRobot::CollisionModel::clone ( CollisionCheckerPtr  colChecker = CollisionCheckerPtr(),
float  scaling = 1.0f,
bool  deepVisuCopy = true 
)
VirtualRobot::CollisionModelPtr VirtualRobot::CollisionModel::CreateUnitedCollisionModel ( const std::vector< CollisionModelPtr > &  colModels)
static

Create a united collision model. All triangle data is copied to one model which usually improves the collision detection performance.

void VirtualRobot::CollisionModel::destroyData ( )
protected

delete all data

BoundingBox VirtualRobot::CollisionModel::getBoundingBox ( bool  global = true)

Return bounding box of this object.

Parameters
globalIf set, the boundignBox is transformed to globalCoordinate system. Otherwise the local BBox is returned.
CollisionCheckerPtr VirtualRobot::CollisionModel::getCollisionChecker ( )
inline
boost::shared_ptr< CollisionModelPQP > VirtualRobot::CollisionModel::getCollisionModelImplementation ( )
inline
Eigen::Matrix4f VirtualRobot::CollisionModel::getGlobalPose ( )
inline

The global pose defines the position of the joint in the world. This value is used for visualization.

int VirtualRobot::CollisionModel::getId ( )
float VirtualRobot::CollisionModel::getMargin ( ) const
VirtualRobot::VisualizationNodePtr VirtualRobot::CollisionModel::getModelDataVisualization ( )
std::vector< Eigen::Vector3f > VirtualRobot::CollisionModel::getModelVeticesGlobal ( )

Return a vector with all vertices of this object at the current global pose.

std::string VirtualRobot::CollisionModel::getName ( )

Returns name of this model.

int VirtualRobot::CollisionModel::getNumFaces ( )
virtual

get number of faces (i.e. triangles) of this object

TriMeshModelPtr VirtualRobot::CollisionModel::getTriMeshModel ( )
inline
bool VirtualRobot::CollisionModel::getUpdateVisualizationStatus ( )
VisualizationNodePtr VirtualRobot::CollisionModel::getVisualization ( )
void VirtualRobot::CollisionModel::inflateModel ( float  margin)

in/deflates the model. If value is <0 the model is deflated.

Parameters
marginEach vertex of the model is moved about this margin along its normal.
void VirtualRobot::CollisionModel::print ( )
virtual

Print information about this model.

bool VirtualRobot::CollisionModel::saveModel ( const std::string &  modelPath,
const std::string &  filename 
)
virtual

Saves model file to model path.

Parameters
modelPathThe directory.
filenameThe new filename without path.
void VirtualRobot::CollisionModel::scale ( Eigen::Vector3f &  scaleFactor)
virtual
void VirtualRobot::CollisionModel::setGlobalPose ( const Eigen::Matrix4f &  pose)
virtual
void VirtualRobot::CollisionModel::setUpdateVisualization ( bool  enable)

Enables/Disables the visualization updates of the collision model. This just handles the visualization, the collision data is not affected.

void VirtualRobot::CollisionModel::setVisualization ( const VisualizationNodePtr  visu)
std::string VirtualRobot::CollisionModel::toXML ( const std::string &  basePath,
int  tabs 
)
std::string VirtualRobot::CollisionModel::toXML ( const std::string &  basePath,
const std::string &  filename,
int  tabs 
)

Field Documentation

BoundingBox VirtualRobot::CollisionModel::bbox
protected
CollisionCheckerPtr VirtualRobot::CollisionModel::colChecker
protected
boost::shared_ptr< CollisionModelPQP > VirtualRobot::CollisionModel::collisionModelImplementation
protected
Eigen::Matrix4f VirtualRobot::CollisionModel::globalPose
protected
int VirtualRobot::CollisionModel::id
protected
float VirtualRobot::CollisionModel::margin
protected
TriMeshModelPtr VirtualRobot::CollisionModel::model
protected
VisualizationNodePtr VirtualRobot::CollisionModel::modelVisualization
protected
std::string VirtualRobot::CollisionModel::name
protected

the name

VisualizationNodePtr VirtualRobot::CollisionModel::origVisualization
protected
bool VirtualRobot::CollisionModel::updateVisualization
protected
VisualizationNodePtr VirtualRobot::CollisionModel::visualization
protected