Simox  2.3.74.0
VirtualRobot::ManipulationObject Class Reference
Inheritance diagram for VirtualRobot::ManipulationObject:
VirtualRobot::Obstacle VirtualRobot::GraspableSensorizedObject 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())
 
 ManipulationObject (const std::string &name, const TriMeshModelPtr &trimesh, const std::string &filename="")
 
 ManipulationObject (const TriMeshModelPtr &trimesh)
 
 ~ManipulationObject () override
 
void print (bool printDecoration=true) override
 
virtual std::string toXML (const std::string &basePath=std::string(), int tabs=0, bool storeLinkToFile=false, const std::string &modelPathRelative="", bool storeSensors=true)
 
ManipulationObjectPtr clone (const std::string &name, CollisionCheckerPtr colChecker=CollisionCheckerPtr(), bool deepVisuCopy=true) const
 
ManipulationObjectPtr clone (CollisionCheckerPtr colChecker=CollisionCheckerPtr(), bool deepVisuCopy=true) const
 
- Public Member Functions inherited from VirtualRobot::Obstacle
 Obstacle (const std::string &name, VisualizationNodePtr visualization={}, CollisionModelPtr collisionModel={}, const SceneObject::Physics &p={}, CollisionCheckerPtr colChecker={})
 
 Obstacle (const std::string &name, const TriMeshModelPtr &trimesh, const std::string &filename="")
 
 ~Obstacle () override
 
ObstaclePtr clone (const std::string &name, CollisionCheckerPtr colChecker={}, float scaling=1.0) const
 
int getID ()
 
virtual std::string toXML (const std::string &basePath, int tabs=0, const std::string &modelPathRelative="", bool storeSensors=true)
 
void setFilename (const std::string &filename)
 
std::string getFilename () const
 
- Public Member Functions inherited from VirtualRobot::GraspableSensorizedObject
 GraspableSensorizedObject (const std::string &name, VisualizationNodePtr visualization=VisualizationNodePtr(), CollisionModelPtr collisionModel=CollisionModelPtr(), const Physics &p=Physics(), CollisionCheckerPtr colChecker=CollisionCheckerPtr())
 
bool initialize (SceneObjectPtr parent=SceneObjectPtr(), const std::vector< SceneObjectPtr > &children=std::vector< SceneObjectPtr >()) override
 
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)
 
const std::vector< GraspSetPtr > & getAllGraspSets ()
 
virtual SensorPtr getSensor (const std::string &name) const
 
virtual bool hasSensor (const std::string &name) const
 
virtual std::vector< SensorPtrgetSensors () const
 
virtual bool registerSensor (SensorPtr sensor)
 
void appendGraspSetsTo (GraspableSensorizedObjectPtr other) const
 
void appendSensorsTo (GraspableSensorizedObjectPtr other) const
 
void printGrasps () const
 
- 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 Eigen::Vector3f getGlobalPosition () const
 
virtual Eigen::Matrix3f getGlobalOrientation () const
 
virtual Eigen::Matrix4f getGlobalPose (const Eigen::Matrix4f &localPose) const
 
virtual Eigen::Vector3f getGlobalPosition (const Eigen::Vector3f &localPosition) const
 
virtual Eigen::Vector3f getGlobalDirection (const Eigen::Vector3f &localDircetion) const
 
virtual Eigen::Matrix3f getGlobalOrientation (const Eigen::Matrix3f &localOrientation) 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 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) const
 
Eigen::Matrix4f getTransformationFrom (const SceneObjectPtr otherObject) const
 
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 ()
 
void setCoMLocal (const Eigen::Vector3f &comLocal)
 Set a new position for the CoM of this bode. More...
 
virtual Eigen::Vector3f getCoMGlobal ()
 
float getMass () const
 
void setMass (float m)
 
Physics::SimulationType getSimulationType () const
 
void setSimulationType (Physics::SimulationType s)
 
Eigen::Matrix3f getInertiaMatrix ()
 
Eigen::Matrix3f getInertiaMatrix (const Eigen::Vector3f &shift)
 If the Inertia Matrix is given at the CoM, this function returns the Inertia Matrix at the parallel shifted coordinate system. The shift is done using the parallel axis theorem (https://en.wikipedia.org/wiki/Parallel_axis_theorem) More...
 
Eigen::Matrix3f getInertiaMatrix (const Eigen::Vector3f &shift, const Eigen::Matrix3f &rotation)
 
Eigen::Matrix3f getInertiaMatrix (const Eigen::Matrix4f &transform)
 
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 >
std::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
 
SceneObjectPtr clone (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 () const
 
virtual SceneObjectPtr getParent () const
 
virtual std::vector< SceneObjectPtrgetChildren () const
 
virtual void updatePose (bool updateChildren=true)
 Compute the global pose of this object. More...
 
virtual void copyPoseFrom (const SceneObjectPtr &other)
 
virtual bool saveModelFiles (const std::string &modelPath, bool replaceFilenames)
 
void setScaling (float scaling)
 
float getScaling ()
 
bool reloadVisualizationFromXML (bool useVisAsColModelIfMissing=true)
 
const std::string & getVisualizationModelXML () const
 

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={})
 
static ObstaclePtr createSphere (float radius, VisualizationFactory::Color color=VisualizationFactory::Color::Red(), std::string visualizationType="", CollisionCheckerPtr colChecker={})
 
static ObstaclePtr createCylinder (float radius, float height, VisualizationFactory::Color color=VisualizationFactory::Color::Red(), std::string visualizationType="", CollisionCheckerPtr colChecker={})
 
static ObstaclePtr createFromMesh (TriMeshModelPtr mesh, std::string visualizationType="", CollisionCheckerPtr colChecker={})
 
- Static Public Member Functions inherited from VirtualRobot::SceneObject
static Eigen::Matrix3f shiftInertia (const Eigen::Matrix3f inertiaMatrix, const Eigen::Vector3f &shift, float mass)
 The shift is done using the parallel axis theorem (https://en.wikipedia.org/wiki/Parallel_axis_theorem) More...
 

Additional Inherited Members

- Public Types inherited from VirtualRobot::SceneObject
enum  VisualizationType { Full, Collision, CollisionData }
 
- Protected Member Functions inherited from VirtualRobot::GraspableSensorizedObject
 GraspableSensorizedObject ()
 
std::string getGraspableSensorizedObjectXML (const std::string &modelPathRelative="models", bool storeSensors=true, int tabs=0)
 
- Protected Member Functions inherited from VirtualRobot::SceneObject
virtual SceneObject_clone (const std::string &name, CollisionCheckerPtr colChecker=CollisionCheckerPtr(), float scaling=1.0f) const
 
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, const std::string &modelPathRelative="")
 basic data, used by Obstacle and ManipulationObject More...
 
virtual bool initializePhysics ()
 
- Protected Attributes inherited from VirtualRobot::Obstacle
std::string filename
 
int id
 
- Protected Attributes inherited from VirtualRobot::GraspableSensorizedObject
std::vector< GraspSetPtrgraspSets
 
std::vector< SensorPtrsensors
 
- Protected Attributes inherited from VirtualRobot::SceneObject
std::string name
 
bool initialized
 
Eigen::Matrix4f globalPose
 
std::vector< SceneObjectPtrchildren
 
SceneObjectWeakPtr parent
 
CollisionModelPtr collisionModel
 
std::string collisionModelXML
 
VisualizationNodePtr visualizationModel
 
std::string visualizationModelXML
 
std::filesystem::path basePath
 
bool updateVisualization
 
bool updateCollisionModel
 
Physics physics
 
CollisionCheckerPtr collisionChecker
 
float scaling = 1.0f
 
- Static Protected Attributes inherited from VirtualRobot::Obstacle
static int idCounter = 20000
 

Constructor & Destructor Documentation

◆ ManipulationObject() [1/3]

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

◆ ManipulationObject() [2/3]

VirtualRobot::ManipulationObject::ManipulationObject ( const std::string &  name,
const TriMeshModelPtr trimesh,
const std::string &  filename = "" 
)

◆ ManipulationObject() [3/3]

VirtualRobot::ManipulationObject::ManipulationObject ( const TriMeshModelPtr trimesh)

◆ ~ManipulationObject()

VirtualRobot::ManipulationObject::~ManipulationObject ( )
overridedefault

Member Function Documentation

◆ clone() [1/2]

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.

◆ clone() [2/2]

ManipulationObjectPtr VirtualRobot::ManipulationObject::clone ( CollisionCheckerPtr  colChecker = CollisionCheckerPtr(),
bool  deepVisuCopy = true 
) const

◆ createFromMesh()

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.

◆ print()

void VirtualRobot::ManipulationObject::print ( bool  printDecoration = true)
overridevirtual

Reimplemented from VirtualRobot::Obstacle.

◆ toXML()

std::string VirtualRobot::ManipulationObject::toXML ( const std::string &  basePath = std::string(),
int  tabs = 0,
bool  storeLinkToFile = false,
const std::string &  modelPathRelative = "",
bool  storeSensors = true 
)
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.