Simox  2.3.49
VirtualRobot::LocalRobot Class Reference
Inheritance diagram for VirtualRobot::LocalRobot:
VirtualRobot::Robot VirtualRobot::SceneObject

Public Member Functions

 LocalRobot (const std::string &name, const std::string &type="")
 
virtual ~LocalRobot ()
 
virtual void setRootNode (RobotNodePtr node)
 
virtual RobotNodePtr getRootNode () const
 
virtual void registerRobotNode (RobotNodePtr node)
 
virtual void deregisterRobotNode (RobotNodePtr node)
 
virtual bool hasRobotNode (const std::string &robotNodeName)
 
virtual bool hasRobotNode (RobotNodePtr node)
 
virtual RobotNodePtr getRobotNode (const std::string &robotNodeName)
 
virtual void getRobotNodes (std::vector< RobotNodePtr > &storeNodes, bool clearVector=true)
 
virtual void registerRobotNodeSet (RobotNodeSetPtr nodeSet)
 
virtual void deregisterRobotNodeSet (RobotNodeSetPtr nodeSet)
 
virtual bool hasRobotNodeSet (const std::string &name)
 
virtual RobotNodeSetPtr getRobotNodeSet (const std::string &nodeSetName) const
 
virtual void getRobotNodeSets (std::vector< RobotNodeSetPtr > &storeNodeSet) const
 
virtual void registerEndEffector (EndEffectorPtr endEffector)
 
virtual bool hasEndEffector (const std::string &endEffectorName)
 
virtual EndEffectorPtr getEndEffector (const std::string &endEffectorName)
 
virtual void getEndEffectors (std::vector< EndEffectorPtr > &storeEEF)
 
virtual void setGlobalPose (const Eigen::Matrix4f &globalPose, bool applyJointValues=true)
 
virtual void setGlobalPose (const Eigen::Matrix4f &globalPose)
 
virtual Eigen::Matrix4f getGlobalPose () const
 
- Public Member Functions inherited from VirtualRobot::Robot
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Robot (const std::string &name, const std::string &type="")
 
virtual ~Robot ()
 
virtual void applyJointValues ()
 
virtual void setThreadsafe (bool)
 
template<typename T >
boost::shared_ptr< T > getVisualization (SceneObject::VisualizationType visuType=SceneObject::Full, bool sensors=true)
 
void showStructure (bool enable, const std::string &type="")
 
void showCoordinateSystems (bool enable, const std::string &type="")
 
void showPhysicsInformation (bool enableCoM, bool enableInertial, VisualizationNodePtr comModel=VisualizationNodePtr())
 
void setupVisualization (bool showVisualization, bool showAttachedVisualizations)
 
virtual std::string getName ()
 
virtual std::string getType ()
 
virtual void print (bool printChildren=false, bool printDecoration=true) const
 
void setUpdateVisualization (bool enable)
 
void setUpdateCollisionModel (bool enable)
 
boost::shared_ptr< Robotshared_from_this () const
 
virtual RobotConfigPtr getConfig ()
 
virtual bool setConfig (RobotConfigPtr c)
 
virtual std::vector< RobotNodePtrgetRobotNodes ()
 
virtual bool hasRobotNodeSet (RobotNodeSetPtr nodeSet)
 
virtual std::vector< RobotNodeSetPtrgetRobotNodeSets () const
 
virtual bool hasEndEffector (EndEffectorPtr endEffector)
 
virtual std::vector< EndEffectorPtrgetEndEffectors ()
 
virtual std::vector< CollisionModelPtrgetCollisionModels ()
 
virtual CollisionCheckerPtr getCollisionChecker ()
 
virtual void highlight (VisualizationPtr visualization, bool enable)
 
virtual int getNumFaces (bool collisionModel=false)
 
virtual void setGlobalPoseForRobotNode (const RobotNodePtr &node, const Eigen::Matrix4f &globalPoseNode)
 
virtual Eigen::Vector3f getCoMLocal ()
 
virtual Eigen::Vector3f getCoMGlobal ()
 
virtual float getMass ()
 
virtual RobotPtr extractSubPart (RobotNodePtr startJoint, const std::string &newRobotType, const std::string &newRobotName, bool cloneRNS=true, bool cloneEEFs=true, CollisionCheckerPtr collisionChecker=CollisionCheckerPtr(), float scaling=1.0f)
 
virtual RobotPtr clone (const std::string &name, CollisionCheckerPtr collisionChecker=CollisionCheckerPtr(), float scaling=1.0f)
 
virtual void setFilename (const std::string &filename)
 
virtual std::string getFilename ()
 
virtual ReadLockPtr getReadLock ()
 
virtual WriteLockPtr getWriteLock ()
 
virtual void setJointValue (RobotNodePtr rn, float jointValue)
 
virtual void setJointValue (const std::string &nodeName, float jointValue)
 
virtual void setJointValues (const std::map< std::string, float > &jointValues)
 
virtual void setJointValues (const std::map< RobotNodePtr, float > &jointValues)
 
virtual void setJointValues (RobotNodeSetPtr rns, const std::vector< float > &jointValues)
 
virtual void setJointValues (const std::vector< RobotNodePtr > rn, const std::vector< float > &jointValues)
 
virtual void setJointValues (RobotNodeSetPtr rns, const Eigen::VectorXf &jointValues)
 
virtual void setJointValues (RobotConfigPtr config)
 
virtual void setJointValues (RobotNodeSetPtr rns, RobotConfigPtr config)
 
virtual void setJointValues (TrajectoryPtr trajectory, float t)
 
virtual BoundingBox getBoundingBox (bool collisionModel=true)
 
virtual SensorPtr getSensor (const std::string &name)
 
virtual std::vector< SensorPtrgetSensors ()
 
virtual std::string toXML (const std::string &basePath=".", const std::string &modelPath="models", bool storeEEF=true, bool storeRNS=true, bool storeSensors=true)
 
float getScaling ()
 
void setScaling (float scaling)
 
- 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 void setGlobalPoseNoChecks (const Eigen::Matrix4f &pose)
 
virtual CollisionModelPtr getCollisionModel ()
 
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 >())
 
bool getUpdateVisualizationStatus ()
 
bool getUpdateCollisionModelStatus ()
 
virtual void showCoordinateSystem (bool enable, float scaling=1.0f, std::string *text=NULL, const std::string &visualizationType="")
 
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)
 
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)
 
SceneObject::Physics getPhysics ()
 
std::vector< std::string > getIgnoredCollisionModels ()
 
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)
 

Protected Member Functions

virtual void applyJointValuesNoLock ()
 
- Protected Member Functions inherited from VirtualRobot::Robot
 Robot ()
 
void createVisualizationFromCollisionModels ()
 
- 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)
 basic data, used by Obstacle and ManipulationObject More...
 
virtual bool initializePhysics ()
 

Protected Attributes

RobotNodePtr rootNode
 
std::map< std::string, RobotNodePtrrobotNodeMap
 
std::map< std::string, RobotNodeSetPtrrobotNodeSetMap
 
std::map< std::string, EndEffectorPtrendEffectorMap
 
- Protected Attributes inherited from VirtualRobot::Robot
float scaling
 
std::string filename
 
std::string type
 
bool updateVisualization
 
boost::recursive_mutex mutex
 
bool use_mutex
 
- 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 }
 

Constructor & Destructor Documentation

VirtualRobot::LocalRobot::LocalRobot ( const std::string &  name,
const std::string &  type = "" 
)
VirtualRobot::LocalRobot::~LocalRobot ( )
virtual

Member Function Documentation

void VirtualRobot::LocalRobot::applyJointValuesNoLock ( )
protectedvirtual

Can be called internally, when lock is already set.

Reimplemented from VirtualRobot::Robot.

void VirtualRobot::LocalRobot::deregisterRobotNode ( RobotNodePtr  node)
virtual

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::deregisterRobotNodeSet ( RobotNodeSetPtr  nodeSet)
virtual

Implements VirtualRobot::Robot.

EndEffectorPtr VirtualRobot::LocalRobot::getEndEffector ( const std::string &  endEffectorName)
virtual
Returns
reference to endeffector with name endEffectorName or Null-Pointer otherwise

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::getEndEffectors ( std::vector< EndEffectorPtr > &  storeEEF)
virtual

This method stores all endeffectors belonging to the robot in storeEEF. If there are no registered endeffectors storeEEF will be empty.

Implements VirtualRobot::Robot.

Eigen::Matrix4f VirtualRobot::LocalRobot::getGlobalPose ( ) const
virtual

The global pose defines the position of the object in the world. For non-joint objects it is identical with the visualization frame.

Reimplemented from VirtualRobot::SceneObject.

RobotNodePtr VirtualRobot::LocalRobot::getRobotNode ( const std::string &  robotNodeName)
virtual

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::getRobotNodes ( std::vector< RobotNodePtr > &  storeNodes,
bool  clearVector = true 
)
virtual

This method stores all nodes belonging to the robot in storeNodes. If there are no registered nodes storeNodes will be empty.

Implements VirtualRobot::Robot.

RobotNodeSetPtr VirtualRobot::LocalRobot::getRobotNodeSet ( const std::string &  nodeSetName) const
virtual

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::getRobotNodeSets ( std::vector< RobotNodeSetPtr > &  storeNodeSets) const
virtual

This method stores all endeffectors belonging to the robot in storeEEF. If there are no registered endeffectors storeEEF will be empty.

Implements VirtualRobot::Robot.

RobotNodePtr VirtualRobot::LocalRobot::getRootNode ( ) const
virtual

This method returns a reference to Robot::rootNode;

Implements VirtualRobot::Robot.

bool VirtualRobot::LocalRobot::hasEndEffector ( const std::string &  endEffectorName)
virtual
Returns
true if instance of VirtualRobot::Robot contains an endeffector with name endEffectorName and false otherwise

Implements VirtualRobot::Robot.

bool VirtualRobot::LocalRobot::hasRobotNode ( const std::string &  robotNodeName)
virtual

Implements VirtualRobot::Robot.

bool VirtualRobot::LocalRobot::hasRobotNode ( RobotNodePtr  node)
virtual

Implements VirtualRobot::Robot.

bool VirtualRobot::LocalRobot::hasRobotNodeSet ( const std::string &  name)
virtual

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::registerEndEffector ( EndEffectorPtr  endEffector)
virtual

This method registers endEffector with the current VirtualRobot::Robot instance. It throws an exception if a VirtualRobot::EndEffector with the same name has already been registered.

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::registerRobotNode ( RobotNodePtr  node)
virtual

This method is automatically called in RobotNode's initialization routine.

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::registerRobotNodeSet ( RobotNodeSetPtr  nodeSet)
virtual

This method is automatically called in RobotNodeSet's initialization routine.

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::setGlobalPose ( const Eigen::Matrix4f &  globalPose,
bool  applyValues = true 
)
virtual

Set the global position of this robot

Implements VirtualRobot::Robot.

void VirtualRobot::LocalRobot::setGlobalPose ( const Eigen::Matrix4f &  pose)
virtual

Update the pose of this object. The visualization and collision models are updated accordingly.

Parameters
poseThe new pose of this object

Reimplemented from VirtualRobot::Robot.

void VirtualRobot::LocalRobot::setRootNode ( RobotNodePtr  node)
virtual

The root node is the first RobotNode of this robot.

Implements VirtualRobot::Robot.

Field Documentation

std::map< std::string, EndEffectorPtr > VirtualRobot::LocalRobot::endEffectorMap
protected
std::map< std::string, RobotNodePtr > VirtualRobot::LocalRobot::robotNodeMap
protected
std::map< std::string, RobotNodeSetPtr > VirtualRobot::LocalRobot::robotNodeSetMap
protected
RobotNodePtr VirtualRobot::LocalRobot::rootNode
protected