Simox  2.3.62
VirtualRobot::Sensor Class Referenceabstract
Inheritance diagram for VirtualRobot::Sensor:
VirtualRobot::SceneObject VirtualRobot::CameraSensor VirtualRobot::ContactSensor VirtualRobot::ForceTorqueSensor VirtualRobot::PositionSensor

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW Sensor (RobotNodeWeakPtr robotNode, const std::string &name, VisualizationNodePtr visualization=VisualizationNodePtr(), const Eigen::Matrix4f &rnTrafo=Eigen::Matrix4f::Identity())
virtual ~Sensor ()
RobotNodePtr getRobotNode () const
virtual Eigen::Matrix4f getRobotNodeToSensorTransformation ()
virtual void setRobotNodeToSensorTransformation (const Eigen::Matrix4f &t)
virtual void setGlobalPose (const Eigen::Matrix4f &pose)
virtual void print (bool printChildren=false, bool printDecoration=true) const
virtual SensorPtr clone (RobotNodePtr newRobotNode, float scaling=1.0f)
SceneObjectPtr clone (const std::string &, CollisionCheckerPtr=CollisionCheckerPtr(), float=1.0f) const
 Forbid cloning method from SceneObject. We need to know the new robotnode for cloning. More...
virtual void updatePose (bool updateChildren=true)
virtual bool initialize (SceneObjectPtr parent=SceneObjectPtr(), const std::vector< SceneObjectPtr > &children=std::vector< SceneObjectPtr >())
virtual std::string toXML (const std::string &modelPath, int tabs=1)
- 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 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)
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 ()
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 ( 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 ()
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 bool saveModelFiles (const std::string &modelPath, bool replaceFilenames)

Protected Member Functions

virtual void updatePose (const Eigen::Matrix4f &parentPose, bool updateChildren=true)
 Sensor ()
virtual SensorPtr _clone (const RobotNodePtr newRobotNode, const VisualizationNodePtr visualizationModel, float scaling)=0
virtual SceneObject_clone (const std::string &, CollisionCheckerPtr=CollisionCheckerPtr(), float=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...
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

Eigen::Matrix4f rnTransformation
RobotNodeWeakPtr robotNode
- 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


class Robot
class RobotIO

Additional Inherited Members

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

Detailed Description

A sensor can be attached to a RobotNode.

Constructor & Destructor Documentation

VirtualRobot::Sensor::Sensor ( RobotNodeWeakPtr  robotNode,
const std::string &  name,
VisualizationNodePtr  visualization = VisualizationNodePtr(),
const Eigen::Matrix4f &  rnTrafo = Eigen::Matrix4f::Identity() 

Constructor with settings.

VirtualRobot::Sensor::~Sensor ( )
VirtualRobot::Sensor::Sensor ( )

Member Function Documentation

virtual SensorPtr VirtualRobot::Sensor::_clone ( const RobotNodePtr  newRobotNode,
const VisualizationNodePtr  visualizationModel,
float  scaling 
protectedpure virtual

Derived classes must implement their clone method here. The visualization is already scaled, the kinematic information (i.e. transformations) have to be scaled by derived implementations.

Implemented in VirtualRobot::ContactSensor, VirtualRobot::ForceTorqueSensor, VirtualRobot::CameraSensor, and VirtualRobot::PositionSensor.

virtual SceneObject* VirtualRobot::Sensor::_clone ( const std::string &  ,
CollisionCheckerPtr  = CollisionCheckerPtr(),
float  = 1.0f 
) const

Reimplemented from VirtualRobot::SceneObject.

SensorPtr VirtualRobot::Sensor::clone ( RobotNodePtr  newRobotNode,
float  scaling = 1.0f 

Clone this Sensor.

newRobotNodeThe newly created Sensor belongs to newRobotNode.
scalingScales the visualization and transformation data.
SceneObjectPtr VirtualRobot::Sensor::clone ( const std::string &  ,
CollisionCheckerPtr  = CollisionCheckerPtr(),
float  = 1.0f 
) const

Forbid cloning method from SceneObject. We need to know the new robotnode for cloning.

RobotNodePtr VirtualRobot::Sensor::getRobotNode ( ) const
virtual Eigen::Matrix4f VirtualRobot::Sensor::getRobotNodeToSensorTransformation ( )

The transformation that specifies the pose of the sensor relatively to the pose of the parent RobotNode.

bool VirtualRobot::Sensor::initialize ( SceneObjectPtr  parent = SceneObjectPtr(),
const std::vector< SceneObjectPtr > &  children = std::vector<SceneObjectPtr>() 

Initialize this object. Optionally the parents and children can be specified.

Reimplemented from VirtualRobot::SceneObject.

void VirtualRobot::Sensor::print ( bool  printChildren = false,
bool  printDecoration = true 
) const
void VirtualRobot::Sensor::setGlobalPose ( const Eigen::Matrix4f &  pose)

Calling this SceneObject method will cause an exception, since Sensors are controlled via their RobotNode parent.

Reimplemented from VirtualRobot::SceneObject.

void VirtualRobot::Sensor::setRobotNodeToSensorTransformation ( const Eigen::Matrix4f &  t)

Set the local transformation.

std::string VirtualRobot::Sensor::toXML ( const std::string &  modelPath,
int  tabs = 1 
void VirtualRobot::Sensor::updatePose ( bool  updateChildren = true)

Compute/Update the transformations of this sensor. Therefore the parent is queried for its pose.

Reimplemented from VirtualRobot::SceneObject.

void VirtualRobot::Sensor::updatePose ( const Eigen::Matrix4f &  parentPose,
bool  updateChildren = true 

Update the pose according to parent pose

Reimplemented from VirtualRobot::SceneObject.

Friends And Related Function Documentation

friend class Robot
friend class RobotIO

Field Documentation

Eigen::Matrix4f VirtualRobot::Sensor::rnTransformation
RobotNodeWeakPtr VirtualRobot::Sensor::robotNode