Simox  2.3.74.0
VirtualRobot::Scene Class Reference

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW Scene (const std::string &name)
 
virtual ~Scene ()
 
void registerRobot (RobotPtr robot)
 
void deRegisterRobot (RobotPtr robot)
 
void deRegisterRobot (const std::string &name)
 
bool hasRobot (RobotPtr robot) const
 
bool hasRobot (const std::string &name) const
 
RobotPtr getRobot (const std::string &name)
 
std::vector< RobotPtrgetRobots ()
 
void registerRobotConfig (RobotPtr robot, RobotConfigPtr config)
 
void registerRobotConfig (RobotPtr robot, std::vector< RobotConfigPtr > configs)
 
void deRegisterRobotConfig (RobotPtr robot, RobotConfigPtr config)
 
void deRegisterRobotConfig (RobotPtr robot, const std::string &name)
 
bool hasRobotConfig (RobotPtr robot, RobotConfigPtr config)
 
bool hasRobotConfig (RobotPtr robot, const std::string &name)
 
RobotConfigPtr getRobotConfig (const std::string &robotName, const std::string &name)
 
RobotConfigPtr getRobotConfig (RobotPtr robot, const std::string &name)
 
std::vector< RobotConfigPtrgetRobotConfigs (RobotPtr robot)
 
void registerManipulationObject (ManipulationObjectPtr obj)
 
void deRegisterManipulationObject (ManipulationObjectPtr obj)
 
void deRegisterManipulationObject (const std::string &name)
 
bool hasManipulationObject (ManipulationObjectPtr obstacle) const
 
bool hasManipulationObject (const std::string &name) const
 
ManipulationObjectPtr getManipulationObject (const std::string &name)
 
std::vector< ManipulationObjectPtrgetManipulationObjects ()
 
void registerObstacle (ObstaclePtr obstacle)
 
void deRegisterObstacle (ObstaclePtr obstacle)
 
void deRegisterObstacle (const std::string &name)
 
bool hasObstacle (ObstaclePtr obstacle) const
 
bool hasObstacle (const std::string &name) const
 
ObstaclePtr getObstacle (const std::string &name)
 
std::vector< ObstaclePtrgetObstacles ()
 
void registerTrajectory (TrajectoryPtr t)
 
void deRegisterTrajectory (TrajectoryPtr t)
 
void deRegisterTrajectory (const std::string &name)
 
bool hasTrajectory (TrajectoryPtr t) const
 
bool hasTrajectory (const std::string &name) const
 
TrajectoryPtr getTrajectory (const std::string &name)
 
std::vector< TrajectoryPtrgetTrajectories ()
 
std::vector< TrajectoryPtrgetTrajectories (const std::string &robotName)
 
void registerSceneObjectSet (SceneObjectSetPtr sos)
 
void deRegisterSceneObjectSet (SceneObjectSetPtr sos)
 
void deRegisterSceneObjectSet (const std::string &name)
 
bool hasSceneObjectSet (SceneObjectSetPtr sos) const
 
bool hasSceneObjectSet (const std::string &name) const
 
SceneObjectSetPtr getSceneObjectSet (const std::string &name)
 
std::vector< SceneObjectSetPtrgetSceneObjectSets ()
 
RobotNodeSetPtr getRobotNodeSet (const std::string &robot, const std::string rns)
 
std::string getName () const
 
template<typename T >
std::shared_ptr< T > getVisualization (SceneObject::VisualizationType visuType=SceneObject::Full, bool addRobots=true, bool addObstacles=true, bool addManipulationObjects=true, bool addTrajectories=true, bool addSceneObjectSets=true)
 
std::string getXMLString (const std::string &basePath)
 

Protected Attributes

std::string name
 
std::vector< RobotPtrrobots
 
std::map< RobotPtr, std::vector< RobotConfigPtr > > robotConfigs
 
std::vector< ObstaclePtrobstacles
 
std::vector< ManipulationObjectPtrmanipulationObjects
 
std::vector< SceneObjectSetPtrsceneObjectSets
 
std::vector< TrajectoryPtrtrajectories
 

Constructor & Destructor Documentation

◆ Scene()

VirtualRobot::Scene::Scene ( const std::string &  name)

◆ ~Scene()

VirtualRobot::Scene::~Scene ( )
virtual

Member Function Documentation

◆ deRegisterManipulationObject() [1/2]

void VirtualRobot::Scene::deRegisterManipulationObject ( ManipulationObjectPtr  obj)

Removes the ManipulationObject to from this scene. If the ManipulationObject is not registered nothing happens.

◆ deRegisterManipulationObject() [2/2]

void VirtualRobot::Scene::deRegisterManipulationObject ( const std::string &  name)

◆ deRegisterObstacle() [1/2]

void VirtualRobot::Scene::deRegisterObstacle ( ObstaclePtr  obstacle)

Removes the obstacle to from this scene. If the obstacle is not registered nothing happens.

◆ deRegisterObstacle() [2/2]

void VirtualRobot::Scene::deRegisterObstacle ( const std::string &  name)

◆ deRegisterRobot() [1/2]

void VirtualRobot::Scene::deRegisterRobot ( RobotPtr  robot)

Removes the robot to from this scene. If the robot is not registered nothing happens.

◆ deRegisterRobot() [2/2]

void VirtualRobot::Scene::deRegisterRobot ( const std::string &  name)

◆ deRegisterRobotConfig() [1/2]

void VirtualRobot::Scene::deRegisterRobotConfig ( RobotPtr  robot,
RobotConfigPtr  config 
)

Removes the RobotConfig to from this scene. If the RobotConfig is not registered nothing happens.

◆ deRegisterRobotConfig() [2/2]

void VirtualRobot::Scene::deRegisterRobotConfig ( RobotPtr  robot,
const std::string &  name 
)

◆ deRegisterSceneObjectSet() [1/2]

void VirtualRobot::Scene::deRegisterSceneObjectSet ( SceneObjectSetPtr  sos)

Removes the set to from this scene. If the set is not registered nothing happens.

◆ deRegisterSceneObjectSet() [2/2]

void VirtualRobot::Scene::deRegisterSceneObjectSet ( const std::string &  name)

◆ deRegisterTrajectory() [1/2]

void VirtualRobot::Scene::deRegisterTrajectory ( TrajectoryPtr  t)

Removes the Trajectory to from this scene. If the Trajectory is not registered nothing happens.

◆ deRegisterTrajectory() [2/2]

void VirtualRobot::Scene::deRegisterTrajectory ( const std::string &  name)

◆ getManipulationObject()

VirtualRobot::ManipulationObjectPtr VirtualRobot::Scene::getManipulationObject ( const std::string &  name)

◆ getManipulationObjects()

std::vector< ManipulationObjectPtr > VirtualRobot::Scene::getManipulationObjects ( )

◆ getName()

std::string VirtualRobot::Scene::getName ( ) const

◆ getObstacle()

VirtualRobot::ObstaclePtr VirtualRobot::Scene::getObstacle ( const std::string &  name)

◆ getObstacles()

std::vector< ObstaclePtr > VirtualRobot::Scene::getObstacles ( )

◆ getRobot()

VirtualRobot::RobotPtr VirtualRobot::Scene::getRobot ( const std::string &  name)

◆ getRobotConfig() [1/2]

VirtualRobot::RobotConfigPtr VirtualRobot::Scene::getRobotConfig ( const std::string &  robotName,
const std::string &  name 
)

◆ getRobotConfig() [2/2]

VirtualRobot::RobotConfigPtr VirtualRobot::Scene::getRobotConfig ( RobotPtr  robot,
const std::string &  name 
)

◆ getRobotConfigs()

std::vector< RobotConfigPtr > VirtualRobot::Scene::getRobotConfigs ( RobotPtr  robot)

◆ getRobotNodeSet()

VirtualRobot::RobotNodeSetPtr VirtualRobot::Scene::getRobotNodeSet ( const std::string &  robot,
const std::string  rns 
)

◆ getRobots()

std::vector< RobotPtr > VirtualRobot::Scene::getRobots ( )

◆ getSceneObjectSet()

VirtualRobot::SceneObjectSetPtr VirtualRobot::Scene::getSceneObjectSet ( const std::string &  name)

◆ getSceneObjectSets()

std::vector< SceneObjectSetPtr > VirtualRobot::Scene::getSceneObjectSets ( )

◆ getTrajectories() [1/2]

std::vector< TrajectoryPtr > VirtualRobot::Scene::getTrajectories ( )

◆ getTrajectories() [2/2]

std::vector< TrajectoryPtr > VirtualRobot::Scene::getTrajectories ( const std::string &  robotName)

◆ getTrajectory()

VirtualRobot::TrajectoryPtr VirtualRobot::Scene::getTrajectory ( const std::string &  name)

◆ getVisualization()

template<typename T >
std::shared_ptr< T > VirtualRobot::Scene::getVisualization ( SceneObject::VisualizationType  visuType = SceneObject::Full,
bool  addRobots = true,
bool  addObstacles = true,
bool  addManipulationObjects = true,
bool  addTrajectories = true,
bool  addSceneObjectSets = true 
)

Retrieve a visualization in the given format. Example usage: std::shared_ptr<VirtualRobot::CoinVisualization> visualization = scene->getVisualization<CoinVisualization>(); SoNode* visualisationNode = NULL; if (visualization) visualisationNode = visualization->getCoinVisualization();

This method collects all visualization nodes and creates a new Visualization subclass which is given by the template parameter T. T must be a subclass of VirtualRobot::Visualization. A compile time error is thrown if a different class type is used as template argument.

◆ getXMLString()

std::string VirtualRobot::Scene::getXMLString ( const std::string &  basePath)

Creates an XML string that describes this scene.

Parameters
basePathAll paths to robots or objects are stored relative to this path.
Returns
The xml string.

◆ hasManipulationObject() [1/2]

bool VirtualRobot::Scene::hasManipulationObject ( ManipulationObjectPtr  obstacle) const

◆ hasManipulationObject() [2/2]

bool VirtualRobot::Scene::hasManipulationObject ( const std::string &  name) const

◆ hasObstacle() [1/2]

bool VirtualRobot::Scene::hasObstacle ( ObstaclePtr  obstacle) const

◆ hasObstacle() [2/2]

bool VirtualRobot::Scene::hasObstacle ( const std::string &  name) const

◆ hasRobot() [1/2]

bool VirtualRobot::Scene::hasRobot ( RobotPtr  robot) const

◆ hasRobot() [2/2]

bool VirtualRobot::Scene::hasRobot ( const std::string &  name) const

◆ hasRobotConfig() [1/2]

bool VirtualRobot::Scene::hasRobotConfig ( RobotPtr  robot,
RobotConfigPtr  config 
)

◆ hasRobotConfig() [2/2]

bool VirtualRobot::Scene::hasRobotConfig ( RobotPtr  robot,
const std::string &  name 
)

◆ hasSceneObjectSet() [1/2]

bool VirtualRobot::Scene::hasSceneObjectSet ( SceneObjectSetPtr  sos) const

◆ hasSceneObjectSet() [2/2]

bool VirtualRobot::Scene::hasSceneObjectSet ( const std::string &  name) const

◆ hasTrajectory() [1/2]

bool VirtualRobot::Scene::hasTrajectory ( TrajectoryPtr  t) const

◆ hasTrajectory() [2/2]

bool VirtualRobot::Scene::hasTrajectory ( const std::string &  name) const

◆ registerManipulationObject()

void VirtualRobot::Scene::registerManipulationObject ( ManipulationObjectPtr  obj)

Registers the ManipulationObject to this scene. If an ManipulationObject with the same name is already registered nothing happens.

◆ registerObstacle()

void VirtualRobot::Scene::registerObstacle ( ObstaclePtr  obstacle)

Registers the obstacle to this scene. If an obstacle with the same name is already registered nothing happens.

◆ registerRobot()

void VirtualRobot::Scene::registerRobot ( RobotPtr  robot)

Registers the robot to this scene. If a robot with the same name is already registered nothing happens.

◆ registerRobotConfig() [1/2]

void VirtualRobot::Scene::registerRobotConfig ( RobotPtr  robot,
RobotConfigPtr  config 
)

Registers the RobotConfig to this scene. If a config with the same name is already registered nothing happens.

◆ registerRobotConfig() [2/2]

void VirtualRobot::Scene::registerRobotConfig ( RobotPtr  robot,
std::vector< RobotConfigPtr configs 
)

◆ registerSceneObjectSet()

void VirtualRobot::Scene::registerSceneObjectSet ( SceneObjectSetPtr  sos)

Registers the set to this scene. If a set with the same name is already registered nothing happens.

◆ registerTrajectory()

void VirtualRobot::Scene::registerTrajectory ( TrajectoryPtr  t)

Registers the Trajectory to this scene. If an Trajectory with the same name is already registered nothing happens.

Field Documentation

◆ manipulationObjects

std::vector< ManipulationObjectPtr > VirtualRobot::Scene::manipulationObjects
protected

◆ name

std::string VirtualRobot::Scene::name
protected

◆ obstacles

std::vector< ObstaclePtr > VirtualRobot::Scene::obstacles
protected

◆ robotConfigs

std::map< RobotPtr, std::vector< RobotConfigPtr > > VirtualRobot::Scene::robotConfigs
protected

◆ robots

std::vector< RobotPtr > VirtualRobot::Scene::robots
protected

◆ sceneObjectSets

std::vector< SceneObjectSetPtr > VirtualRobot::Scene::sceneObjectSets
protected

◆ trajectories

std::vector< TrajectoryPtr > VirtualRobot::Scene::trajectories
protected