Gazebo Gazebo

API Reference

3.15.2
SceneManager Class Reference

Scene manager class for loading and managing objects in the scene. More...

#include <SceneManager.hh>

Public Member Functions

 SceneManager ()
 Constructor. More...
 
 ~SceneManager ()
 Destructor. More...
 
std::map< std::string, math::Matrix4dActorMeshAnimationAt (Entity _id, std::chrono::steady_clock::duration _time) const
 Get the animation of actor mesh given an id. More...
 
rendering::MeshPtr ActorMeshById (Entity _id) const
 Get a rendering mesh given an id. More...
 
bool AddSensor (Entity _gazeboId, const std::string &_sensorName, Entity _parentGazeboId=0)
 Ignition sensors is the one responsible for adding sensors to the scene. Here we just keep track of it and make sure it has the correct parent. More...
 
rendering::VisualPtr CreateActor (Entity _id, const sdf::Actor &_actor, Entity _parentId=0)
 Create an actor. More...
 
rendering::VisualPtr CreateCollision (Entity _id, const sdf::Collision &_collision, Entity _parentId=0)
 Create a collision visual. More...
 
rendering::LightPtr CreateLight (Entity _id, const sdf::Light &_light, Entity _parentId)
 Create a light. More...
 
rendering::VisualPtr CreateLink (Entity _id, const sdf::Link &_link, Entity _parentId=0)
 Create a link. More...
 
rendering::VisualPtr CreateModel (Entity _id, const sdf::Model &_model, Entity _parentId=0)
 Create a model. More...
 
rendering::VisualPtr CreateVisual (Entity _id, const sdf::Visual &_visual, Entity _parentId=0)
 Create a visual. More...
 
Entity EntityFromNode (const rendering::NodePtr &_node) const
 Get the entity for a given node. More...
 
bool HasEntity (Entity _id) const
 Check if entity exists. More...
 
rendering::NodePtr NodeById (Entity _id) const
 Get a rendering node given an entity id. More...
 
void RemoveEntity (Entity _id)
 Remove an entity by id. More...
 
rendering::ScenePtr Scene () const
 Get the scene. More...
 
void SetScene (rendering::ScenePtr _scene)
 Set the scene to manage. More...
 
void SetWorldId (Entity _id)
 Set the world's ID. More...
 
rendering::NodePtr TopLevelNode (const rendering::NodePtr &_node) const
 Get the top level node for the given node, which is the ancestor which is a direct child to the root visual. Usually, this will be a model or a light. More...
 
rendering::VisualPtr TopLevelVisual (rendering::VisualPtr _visual) const
 Get the top level visual for the given visual, which is the ancestor which is a direct child to the root visual. Usually, this will be a model or a light. More...
 
rendering::VisualPtr VisualById (Entity _id)
 Retrieve visual. More...
 
Entity WorldId () const
 Get the world's ID. More...
 

Detailed Description

Scene manager class for loading and managing objects in the scene.

Constructor & Destructor Documentation

◆ SceneManager()

Constructor.

◆ ~SceneManager()

Destructor.

Member Function Documentation

◆ ActorMeshAnimationAt()

std::map<std::string, math::Matrix4d> ActorMeshAnimationAt ( Entity  _id,
std::chrono::steady_clock::duration  _time 
) const

Get the animation of actor mesh given an id.

Parameters
[in]_idEntity's unique id
[in]_timeTimepoint for the animation
Returns
Map from the skeleton node name to transforms

◆ ActorMeshById()

rendering::MeshPtr ActorMeshById ( Entity  _id) const

Get a rendering mesh given an id.

Parameters
[in]_idActor entity's unique id
Returns
Pointer to requested entity's mesh

◆ AddSensor()

bool AddSensor ( Entity  _gazeboId,
const std::string _sensorName,
Entity  _parentGazeboId = 0 
)

Ignition sensors is the one responsible for adding sensors to the scene. Here we just keep track of it and make sure it has the correct parent.

Parameters
[in]_gazeboIdEntity in Gazebo
[in]_sensorNameName of sensor node in Ignition Rendering.
[in]_parentGazeboIdParent Id on Gazebo.
Returns
True if sensor is successfully handled

◆ CreateActor()

rendering::VisualPtr CreateActor ( Entity  _id,
const sdf::Actor &  _actor,
Entity  _parentId = 0 
)

Create an actor.

Parameters
[in]_idUnique actor id
[in]_actorActor sdf dom
[in]_parentIdParent id
Returns
Actor object created from the sdf dom

◆ CreateCollision()

rendering::VisualPtr CreateCollision ( Entity  _id,
const sdf::Collision &  _collision,
Entity  _parentId = 0 
)

Create a collision visual.

Parameters
[in]_idUnique visual id
[in]_collisionCollision sdf dom
[in]_parentIdParent id
Returns
Visual (collision) object created from the sdf dom

◆ CreateLight()

rendering::LightPtr CreateLight ( Entity  _id,
const sdf::Light &  _light,
Entity  _parentId 
)

Create a light.

Parameters
[in]_idUnique light id
[in]_lightLight sdf dom
[in]_parentIdParent id
Returns
Light object created from the sdf dom

◆ CreateLink()

rendering::VisualPtr CreateLink ( Entity  _id,
const sdf::Link &  _link,
Entity  _parentId = 0 
)

Create a link.

Parameters
[in]_idUnique link id
[in]_linkLink sdf dom
[in]_parentIdParent id
Returns
Link visual created from the sdf dom

◆ CreateModel()

rendering::VisualPtr CreateModel ( Entity  _id,
const sdf::Model &  _model,
Entity  _parentId = 0 
)

Create a model.

Parameters
[in]_idUnique model id
[in]_modelModel sdf dom
[in]_parentIdParent id
Returns
Model visual created from the sdf dom

◆ CreateVisual()

rendering::VisualPtr CreateVisual ( Entity  _id,
const sdf::Visual &  _visual,
Entity  _parentId = 0 
)

Create a visual.

Parameters
[in]_idUnique visual id
[in]_visualVisual sdf dom
[in]_parentIdParent id
Returns
Visual object created from the sdf dom

◆ EntityFromNode()

Entity EntityFromNode ( const rendering::NodePtr &  _node) const

Get the entity for a given node.

Parameters
[in]_nodeNode to get the entity for.
Returns
The entity for that node, or kNullEntity for no entity.
Todo:
(anyone) Deprecate in favour of gz::rendering::Node::UserData once that's available.

◆ HasEntity()

bool HasEntity ( Entity  _id) const

Check if entity exists.

Parameters
[in]_idUnique entity id
Returns
true if exists, false otherwise

◆ NodeById()

rendering::NodePtr NodeById ( Entity  _id) const

Get a rendering node given an entity id.

Parameters
[in]_idEntity's unique id
Returns
Pointer to requested entity's node

◆ RemoveEntity()

void RemoveEntity ( Entity  _id)

Remove an entity by id.

Parameters
[in]_idEntity's unique id

◆ Scene()

rendering::ScenePtr Scene ( ) const

Get the scene.

Returns
Pointer to scene

◆ SetScene()

void SetScene ( rendering::ScenePtr  _scene)

Set the scene to manage.

Parameters
[in]_sceneScene pointer.

◆ SetWorldId()

void SetWorldId ( Entity  _id)

Set the world's ID.

Parameters
[in]_idWorld ID.

◆ TopLevelNode()

rendering::NodePtr TopLevelNode ( const rendering::NodePtr &  _node) const

Get the top level node for the given node, which is the ancestor which is a direct child to the root visual. Usually, this will be a model or a light.

Parameters
[in]_nodeChild node
Returns
Top level node containining this node

◆ TopLevelVisual()

rendering::VisualPtr TopLevelVisual ( rendering::VisualPtr  _visual) const

Get the top level visual for the given visual, which is the ancestor which is a direct child to the root visual. Usually, this will be a model or a light.

Parameters
[in]_visualChild visual
Returns
Top level visual containining this visual TODO(anyone) Make it const ref when merging forward

◆ VisualById()

rendering::VisualPtr VisualById ( Entity  _id)

Retrieve visual.

Parameters
[in]_idUnique visual (entity) id
Returns
Pointer to requested visual

◆ WorldId()

Entity WorldId ( ) const

Get the world's ID.

Returns
World ID

The documentation for this class was generated from the following file: