Simox  2.3.50
VirtualRobot::Obstacle Class Reference
Inheritance diagram for VirtualRobot::Obstacle:
VirtualRobot::SceneObject VirtualRobot::ManipulationObject

Public Member Functions

 Obstacle (const std::string &name, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const SceneObject::Physics &p=SceneObject::Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
virtual ~Obstacle ()
 
virtual void print (bool printDecoration=true)
 
ObstaclePtr clone (const std::string &name, CollisionCheckerPtr colChecker=CollisionCheckerPtr()) const
 
int getID ()
 
virtual std::string toXML (const std::string &basePath, int tabs=0)
 
void setFilename (const std::string &filename)
 
std::string getFilename ()
 
- Public Member Functions inherited from VirtualRobot::SceneObject
 SceneObject (const std::string &name, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const Physics &p=Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
virtual ~SceneObject ()
 
std::string getName () const
 
void setName (const std::string &name)
 
virtual Eigen::Matrix4f getGlobalPose () const
 
virtual void setGlobalPoseNoChecks (const Eigen::Matrix4f &pose)
 
virtual void setGlobalPose (const Eigen::Matrix4f &pose)
 
virtual CollisionModelPtr getCollisionModel ()
 
virtual CollisionCheckerPtr getCollisionChecker ()
 
void setVisualization (VisualizationNodePtr visualization)
 
void setCollisionModel (CollisionModelPtr colModel)
 
virtual VisualizationNodePtr getVisualization (SceneObject::VisualizationType visuType=SceneObject::Full)
 
virtual bool initialize (SceneObjectPtr parent=SceneObjectPtr(), const std::vector< SceneObjectPtr > &children=std::vector< SceneObjectPtr >())
 
virtual void setUpdateVisualization (bool enable)
 
bool getUpdateVisualizationStatus ()
 
virtual void setUpdateCollisionModel (bool enable)
 
bool getUpdateCollisionModelStatus ()
 
virtual void setupVisualization (bool showVisualization, bool showAttachedVisualizations)
 
virtual void showCoordinateSystem (bool enable, float scaling=1.0f, std::string *text=NULL, const std::string &visualizationType="")
 
virtual void showPhysicsInformation (bool enableCoM, bool enableInertial, VisualizationNodePtr comModel=VisualizationNodePtr())
 
virtual bool showCoordinateSystemState ()
 
virtual void showBoundingBox (bool enable, bool wireframe=false)
 
virtual bool ensureVisualization (const std::string &visualizationType="")
 
Eigen::Matrix4f toLocalCoordinateSystem (const Eigen::Matrix4f &poseGlobal) const
 
Eigen::Vector3f toLocalCoordinateSystemVec (const Eigen::Vector3f &positionGlobal) const
 
Eigen::Matrix4f toGlobalCoordinateSystem (const Eigen::Matrix4f &poseLocal) const
 
Eigen::Vector3f toGlobalCoordinateSystemVec (const Eigen::Vector3f &positionLocal) const
 
Eigen::Matrix4f getTransformationTo (const SceneObjectPtr otherObject)
 
Eigen::Matrix4f getTransformationFrom (const SceneObjectPtr otherObject)
 
Eigen::Matrix4f transformTo (const SceneObjectPtr otherObject, const Eigen::Matrix4f &poseInOtherCoordSystem)
 
Eigen::Vector3f transformTo (const SceneObjectPtr otherObject, const Eigen::Vector3f &positionInOtherCoordSystem)
 
virtual int getNumFaces (bool collisionModel=false)
 
virtual Eigen::Vector3f getCoMLocal ()
 
virtual Eigen::Vector3f getCoMGlobal ()
 
float getMass () const
 
void setMass (float m)
 
Physics::SimulationType getSimulationType () const
 
void setSimulationType (Physics::SimulationType s)
 
Eigen::Matrix3f getInertiaMatrix ()
 
void setInertiaMatrix (const Eigen::Matrix3f &im)
 
float getFriction ()
 
void setFriction (float friction)
 
SceneObject::Physics getPhysics ()
 
std::vector< std::string > getIgnoredCollisionModels ()
 
virtual void print (bool printChildren=false, bool printDecoration=true) const
 
template<typename T >
boost::shared_ptr< T > getVisualization (SceneObject::VisualizationType visuType=SceneObject::Full)
 
void highlight (VisualizationPtr visualization, bool enable)
 
SceneObjectPtr clone (const std::string &name, CollisionCheckerPtr colChecker=CollisionCheckerPtr(), float scaling=1.0f) const
 
virtual bool attachChild (SceneObjectPtr child)
 
virtual void detachChild (SceneObjectPtr child)
 
virtual bool hasChild (SceneObjectPtr child, bool recursive=false) const
 
virtual bool hasChild (const std::string &childName, bool recursive=false) const
 
virtual bool hasParent ()
 
virtual SceneObjectPtr getParent () const
 
virtual std::vector< SceneObjectPtrgetChildren () const
 
virtual void updatePose (bool updateChildren=true)
 Compute the global pose of this object. More...
 
virtual bool saveModelFiles (const std::string &modelPath, bool replaceFilenames)
 

Static Public Member Functions

static ObstaclePtr createBox (float width, float height, float depth, VisualizationFactory::Color color=VisualizationFactory::Color::Red(), std::string visualizationType="", CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
static ObstaclePtr createSphere (float radius, VisualizationFactory::Color color=VisualizationFactory::Color::Red(), std::string visualizationType="", CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
static ObstaclePtr createCylinder (float radius, float height, VisualizationFactory::Color color=VisualizationFactory::Color::Red(), std::string visualizationType="", CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
static ObstaclePtr createFromMesh (TriMeshModelPtr mesh, std::string visualizationType="", CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 

Protected Member Functions

virtual Obstacle_clone (const std::string &name, CollisionCheckerPtr colChecker=CollisionCheckerPtr(), float scaling=1.0f) const
 
- Protected Member Functions inherited from VirtualRobot::SceneObject
virtual void detachedFromParent ()
 Parent detached this object. More...
 
virtual void attached (SceneObjectPtr parent)
 Parent attached this object. More...
 
virtual void updatePose (const Eigen::Matrix4f &parentPose, bool updateChildren=true)
 
std::string getFilenameReplacementVisuModel (const std::string standardExtension=".wrl")
 
std::string getFilenameReplacementColModel (const std::string standardExtension=".wrl")
 
 SceneObject ()
 
std::string getSceneObjectXMLString (const std::string &basePath, int tabs)
 basic data, used by Obstacle and ManipulationObject More...
 
virtual bool initializePhysics ()
 

Protected Attributes

std::string filename
 
int id
 
- Protected Attributes inherited from VirtualRobot::SceneObject
std::string name
 
bool initialized
 
Eigen::Matrix4f globalPose
 
std::vector< SceneObjectPtrchildren
 
SceneObjectWeakPtr parent
 
CollisionModelPtr collisionModel
 
VisualizationNodePtr visualizationModel
 
bool updateVisualization
 
bool updateCollisionModel
 
Physics physics
 
CollisionCheckerPtr collisionChecker
 

Static Protected Attributes

static int idCounter = 20000
 

Additional Inherited Members

- Public Types inherited from VirtualRobot::SceneObject
enum  VisualizationType { Full, Collision, CollisionData }
 

Detailed Description

An obstacle is an object that owns a visualization and a collision model. It can be moved around and used for collision detection.

Constructor & Destructor Documentation

VirtualRobot::Obstacle::Obstacle ( const std::string &  name,
VisualizationNodePtr  visualization = VisualizationNodePtr(),
CollisionModelPtr  collisionModel = CollisionModelPtr(),
const SceneObject::Physics p = SceneObject::Physics(),
CollisionCheckerPtr  colChecker = CollisionCheckerPtr() 
)
VirtualRobot::Obstacle::~Obstacle ( )
virtual

Member Function Documentation

Obstacle * VirtualRobot::Obstacle::_clone ( const std::string &  name,
CollisionCheckerPtr  colChecker = CollisionCheckerPtr(),
float  scaling = 1.0f 
) const
protectedvirtual

Reimplemented from VirtualRobot::SceneObject.

ObstaclePtr VirtualRobot::Obstacle::clone ( const std::string &  name,
CollisionCheckerPtr  colChecker = CollisionCheckerPtr() 
) const
inline

Clones this object. If no col checker is given, the one of the original object is used.

VirtualRobot::ObstaclePtr VirtualRobot::Obstacle::createBox ( float  width,
float  height,
float  depth,
VisualizationFactory::Color  color = VisualizationFactory::Color::Red(),
std::string  visualizationType = "",
CollisionCheckerPtr  colChecker = CollisionCheckerPtr() 
)
static

Create a standard obstacle.

Parameters
widthThe width of the box.
heightThe height of the box.
depthThe depth of the box.
colorSpecify the color.
visualizationTypeHere the type of visualization can be specified (e.g. "Inventor"). If empty, the first registered visualization type (which is usually the only one) is used.
colCheckerOnly needed if you plan to use the collision checker in parallel. If not given, the object is registered with the global singleton collision checker.
VirtualRobot::ObstaclePtr VirtualRobot::Obstacle::createCylinder ( float  radius,
float  height,
VisualizationFactory::Color  color = VisualizationFactory::Color::Red(),
std::string  visualizationType = "",
CollisionCheckerPtr  colChecker = CollisionCheckerPtr() 
)
static

Create a standard obstacle.

Parameters
radiusThe radius of the cylinder.
heightThe height of the cylinder.
colorSpecify the color.
visualizationTypeHere the type of visualization can be specified (e.g. "Inventor"). If empty, the first registered visualization type (which is usually the only one) is used.
colCheckerOnly needed if you plan to use the collision checker in parallel. If not given, the object is registered with the global singleton collision checker.
VirtualRobot::ObstaclePtr VirtualRobot::Obstacle::createFromMesh ( TriMeshModelPtr  mesh,
std::string  visualizationType = "",
CollisionCheckerPtr  colChecker = CollisionCheckerPtr() 
)
static

Create a standard obstacle from a mesh.

Parameters
meshThe mesh.
visualizationTypeHere the type of visualization can be specified (e.g. "Inventor"). If empty, the first registered visualization type (which is usually the only one) is used.
colCheckerOnly needed if you plan to use the collision checker in parallel. If not given, the object is registered with the global singleton collision checker.
VirtualRobot::ObstaclePtr VirtualRobot::Obstacle::createSphere ( float  radius,
VisualizationFactory::Color  color = VisualizationFactory::Color::Red(),
std::string  visualizationType = "",
CollisionCheckerPtr  colChecker = CollisionCheckerPtr() 
)
static

Create a standard obstacle.

Parameters
radiusThe radius of the sphere.
colorSpecify the color.
visualizationTypeHere the type of visualization can be specified (e.g. "Inventor"). If empty, the first registered visualization type (which is usually the only one) is used.
colCheckerOnly needed if you plan to use the collision checker in parallel. If not given, the object is registered with the global singleton collision checker.
std::string VirtualRobot::Obstacle::getFilename ( )
int VirtualRobot::Obstacle::getID ( )
void VirtualRobot::Obstacle::print ( bool  printDecoration = true)
virtual
void VirtualRobot::Obstacle::setFilename ( const std::string &  filename)
std::string VirtualRobot::Obstacle::toXML ( const std::string &  basePath,
int  tabs = 0 
)
virtual

Field Documentation

std::string VirtualRobot::Obstacle::filename
protected
int VirtualRobot::Obstacle::id
protected
int VirtualRobot::Obstacle::idCounter = 20000
staticprotected