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

Public Member Functions

 ManipulationObject (const std::string &name, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const SceneObject::Physics &p=SceneObject::Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
virtual ~ManipulationObject ()
 
virtual void print (bool printDecoration=true)
 
bool hasGraspSet (GraspSetPtr graspSet)
 
bool hasGraspSet (const std::string &robotType, const std::string &eef)
 
void addGraspSet (GraspSetPtr graspSet)
 
void includeGraspSet (GraspSetPtr graspSet)
 includeGraspSet More...
 
GraspSetPtr getGraspSet (EndEffectorPtr eef)
 
GraspSetPtr getGraspSet (const std::string &robotType, const std::string &eefName)
 
GraspSetPtr getGraspSet (const std::string &name)
 
std::vector< GraspSetPtrgetAllGraspSets ()
 
virtual std::string toXML (const std::string &basePath=std::string(), int tabs=0, bool storeLinkToFile=false)
 
ManipulationObjectPtr clone (const std::string &name, CollisionCheckerPtr colChecker=CollisionCheckerPtr(), bool deepVisuCopy=true) const
 
- Public Member Functions inherited from VirtualRobot::Obstacle
 Obstacle (const std::string &name, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const SceneObject::Physics &p=SceneObject::Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
virtual ~Obstacle ()
 
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 ManipulationObjectPtr createFromMesh (TriMeshModelPtr mesh, std::string visualizationType="", CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
- Static Public Member Functions inherited from VirtualRobot::Obstacle
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 ManipulationObject_clone (const std::string &name, CollisionCheckerPtr colChecker=CollisionCheckerPtr(), bool deepVisuCopy=true) const
 
- Protected Member Functions inherited from VirtualRobot::Obstacle
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::vector< GraspSetPtrgraspSets
 
- Protected Attributes inherited from VirtualRobot::Obstacle
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
 

Additional Inherited Members

- Public Types inherited from VirtualRobot::SceneObject
enum  VisualizationType { Full, Collision, CollisionData }
 
- Static Protected Attributes inherited from VirtualRobot::Obstacle
static int idCounter = 20000
 

Constructor & Destructor Documentation

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

Member Function Documentation

ManipulationObject * VirtualRobot::ManipulationObject::_clone ( const std::string &  name,
CollisionCheckerPtr  colChecker = CollisionCheckerPtr(),
bool  deepVisuCopy = true 
) const
protectedvirtual
void VirtualRobot::ManipulationObject::addGraspSet ( GraspSetPtr  graspSet)

Appends a grasp set. Note, that only one grasp set per EEF is allowed.

ManipulationObjectPtr VirtualRobot::ManipulationObject::clone ( const std::string &  name,
CollisionCheckerPtr  colChecker = CollisionCheckerPtr(),
bool  deepVisuCopy = true 
) const

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

VirtualRobot::ManipulationObjectPtr VirtualRobot::ManipulationObject::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.
std::vector< GraspSetPtr > VirtualRobot::ManipulationObject::getAllGraspSets ( )

Get grasp set vector

VirtualRobot::GraspSetPtr VirtualRobot::ManipulationObject::getGraspSet ( EndEffectorPtr  eef)

Get grasp set for the given end effector. In case multiple grasp sets for the eef are present, the first one is returned. An empty GraspSetPtr is returned when no GraspSet for eef is found.

VirtualRobot::GraspSetPtr VirtualRobot::ManipulationObject::getGraspSet ( const std::string &  robotType,
const std::string &  eefName 
)

Get grasp set for the given robotType and end effector. In case multiple grasp sets for the robot/eef combination are present, the first one is returned. An empty GraspSetPtr is returned when no GraspSet for robot&eef is found.

VirtualRobot::GraspSetPtr VirtualRobot::ManipulationObject::getGraspSet ( const std::string &  name)

Get grasp set by name.

Parameters
nameThe name of the grasp set.
Returns
An empty GraspSetPtr is returned when no GraspSet with the given name is found.
bool VirtualRobot::ManipulationObject::hasGraspSet ( GraspSetPtr  graspSet)
bool VirtualRobot::ManipulationObject::hasGraspSet ( const std::string &  robotType,
const std::string &  eef 
)
void VirtualRobot::ManipulationObject::includeGraspSet ( GraspSetPtr  graspSet)

includeGraspSet

Parameters
graspSet
void VirtualRobot::ManipulationObject::print ( bool  printDecoration = true)
virtual

Reimplemented from VirtualRobot::Obstacle.

std::string VirtualRobot::ManipulationObject::toXML ( const std::string &  basePath = std::string(),
int  tabs = 0,
bool  storeLinkToFile = false 
)
virtual

Creates an XML representation of this object.

Parameters
basePathIf set, all visualization and collision model files are made relative to this path.
tabsCreate indention at the beginning of each line.
storeLinkToFileIf set, the data (e.g. grasps) are not explicitly listed, but an xml tag directing to the XML file, from which this instance was loaded, is set. If not set a deep description is created.

Field Documentation

std::vector< GraspSetPtr > VirtualRobot::ManipulationObject::graspSets
protected