Ignition Gazebo

API Reference

5.0.0
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...
 
AnimationUpdateData ActorAnimationAt (Entity _id, std::chrono::steady_clock::duration _time) const
 Get the actor animation update data given an id. Use this function to let the render engine handle the actor animation. by setting the animation name to be played. 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 Use this function if you are animating the actor manually by its skeleton node pose. More...
 
rendering::MeshPtr ActorMeshById (Entity _id) const
 Get a rendering mesh given an id. More...
 
common::SkeletonPtr ActorSkeletonById (Entity _id) const
 Get a skeleton given an id. More...
 
std::map< std::string, math::Matrix4dActorSkeletonTransformsAt (Entity _id, std::chrono::steady_clock::duration _time) const
 Get the skeleton local transforms of actor mesh given an id. Use this function if you are animating the actor manually by its skeleton node pose. 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 CreateLightVisual (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::ParticleEmitterPtr CreateParticleEmitter (Entity _id, const msgs::ParticleEmitter &_emitter, Entity _parentId)
 Create a particle emitter. 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 (const 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::ParticleEmitterPtr UpdateParticleEmitter (Entity _id, const msgs::ParticleEmitter &_emitter)
 Update an existing particle emitter. 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

◆ ActorAnimationAt()

AnimationUpdateData ActorAnimationAt ( Entity  _id,
std::chrono::steady_clock::duration  _time 
) const

Get the actor animation update data given an id. Use this function to let the render engine handle the actor animation. by setting the animation name to be played.

Parameters
[in]_idEntity's unique id
[in]_timeSimulation time
Returns
Data needed to update the animation, including the name and time of animation to play, and trajectory animation info.

◆ 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 Use this function if you are animating the actor manually by its skeleton node pose.

Parameters
[in]_idEntity's unique id
[in]_timeSimulation time
Returns
Map from the skeleton node name to transforms
Deprecated:
see ActorSkeletonTransformAt

◆ 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

◆ ActorSkeletonById()

common::SkeletonPtr ActorSkeletonById ( Entity  _id) const

Get a skeleton given an id.

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

◆ ActorSkeletonTransformsAt()

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

Get the skeleton local transforms of actor mesh given an id. Use this function if you are animating the actor manually by its skeleton node pose.

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

◆ 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]_parentIdParent 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]_visualActor 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

◆ CreateLightVisual()

rendering::VisualPtr CreateLightVisual ( 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

◆ CreateParticleEmitter()

rendering::ParticleEmitterPtr CreateParticleEmitter ( Entity  _id,
const msgs::ParticleEmitter _emitter,
Entity  _parentId 
)

Create a particle emitter.

Parameters
[in]_idUnique particle emitter id
[in]_emitterParticle emitter data
[in]_parentIdParent id
Returns
Default particle emitter object created

◆ 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 ignition::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 ( const 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

◆ UpdateParticleEmitter()

rendering::ParticleEmitterPtr UpdateParticleEmitter ( Entity  _id,
const msgs::ParticleEmitter _emitter 
)

Update an existing particle emitter.

_id Emitter id to update _emitter Data to update the particle emitter

Returns
Particle emitter updated

◆ 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: