Gazebo Gazebo

API Reference

6.16.0
SdfEntityCreator Class Reference

Provides convenient functions to spawn entities and load their plugins from SDF elements, to remove them, and to change their hierarchy. More...

#include <SdfEntityCreator.hh>

Public Member Functions

 SdfEntityCreator (const SdfEntityCreator &_creator)
 Copy constructor. More...
 
 SdfEntityCreator (EntityComponentManager &_ecm, EventManager &_eventManager)
 Constructor. More...
 
 SdfEntityCreator (SdfEntityCreator &&_creator) noexcept
 Move constructor. More...
 
 ~SdfEntityCreator ()
 Destructor. More...
 
Entity CreateEntities (const sdf::Actor *_actor)
 Create all entities that exist in the sdf::Actor object and load their plugins. More...
 
Entity CreateEntities (const sdf::Collision *_collision)
 Create all entities that exist in the sdf::Collision object and load their plugins. More...
 
Entity CreateEntities (const sdf::Joint *_joint)
 Create all entities that exist in the sdf::Joint object and load their plugins. More...
 
Entity CreateEntities (const sdf::Joint *_joint, bool _resolved)
 Create all entities that exist in the sdf::Joint object and load their plugins. More...
 
Entity CreateEntities (const sdf::Light *_light)
 Create all entities that exist in the sdf::Light object and load their plugins. More...
 
Entity CreateEntities (const sdf::Link *_link)
 Create all entities that exist in the sdf::Link object and load their plugins. More...
 
Entity CreateEntities (const sdf::Model *_model)
 Create all entities that exist in the sdf::Model object and load their plugins. Also loads plugins of child sensors. More...
 
Entity CreateEntities (const sdf::ParticleEmitter *_emitter)
 Create all entities that exist in the sdf::ParticleEmitter object. More...
 
Entity CreateEntities (const sdf::Sensor *_sensor)
 Create all entities that exist in the sdf::Sensor object. Sensor plugins won't be directly loaded by this function. More...
 
Entity CreateEntities (const sdf::Visual *_visual)
 Create all entities that exist in the sdf::Visual object and load their plugins. More...
 
Entity CreateEntities (const sdf::World *_world)
 Create all entities that exist in the sdf::World object and load their plugins. More...
 
SdfEntityCreatoroperator= (const SdfEntityCreator &_creator)
 Copy assignment operator. More...
 
SdfEntityCreatoroperator= (SdfEntityCreator &&_creator) noexcept
 Move assignment operator. More...
 
void RequestRemoveEntity (const Entity _entity, bool _recursive=true)
 Request an entity deletion. This will insert the request into a queue. The queue is processed toward the end of a simulation update step. More...
 
void SetParent (Entity _child, Entity _parent)
 Set an entity's parent entity. This function takes care of updating the EntityComponentManager and necessary components. More...
 

Detailed Description

Provides convenient functions to spawn entities and load their plugins from SDF elements, to remove them, and to change their hierarchy.

ignition/gazebo/SdfEntityCreator.hh This class provides wrappers around entities and components which are more convenient and straight-forward to use than dealing with the EntityComponentManager directly.

Constructor & Destructor Documentation

◆ SdfEntityCreator() [1/3]

SdfEntityCreator ( EntityComponentManager _ecm,
EventManager _eventManager 
)
explicit

Constructor.

Parameters
[in]_ecmEntity component manager. This class keeps a pointer to it, but doesn't assume ownership.
[in]_eventManagerEvent manager. This class keeps a pointer to it, but doesn't assume ownership.

◆ SdfEntityCreator() [2/3]

SdfEntityCreator ( const SdfEntityCreator _creator)

Copy constructor.

Parameters
[in]_creatorSdfEntityCreator to copy.

◆ SdfEntityCreator() [3/3]

SdfEntityCreator ( SdfEntityCreator &&  _creator)
noexcept

Move constructor.

Parameters
[in]_creatorSdfEntityCreator to move.

◆ ~SdfEntityCreator()

Destructor.

Member Function Documentation

◆ CreateEntities() [1/11]

Entity CreateEntities ( const sdf::Actor *  _actor)

Create all entities that exist in the sdf::Actor object and load their plugins.

Parameters
[in]_actorSDF actor object.
Returns
Actor entity.

◆ CreateEntities() [2/11]

Entity CreateEntities ( const sdf::Collision *  _collision)

Create all entities that exist in the sdf::Collision object and load their plugins.

Parameters
[in]_collisionSDF collision object.
Returns
Collision entity.

◆ CreateEntities() [3/11]

Entity CreateEntities ( const sdf::Joint *  _joint)

Create all entities that exist in the sdf::Joint object and load their plugins.

Parameters
[in]_jointSDF joint object.
Returns
Joint entity.

◆ CreateEntities() [4/11]

Entity CreateEntities ( const sdf::Joint *  _joint,
bool  _resolved 
)

Create all entities that exist in the sdf::Joint object and load their plugins.

Parameters
[in]_jointSDF joint object.
[in]_resolvedTrue if all frames are already resolved
Returns
Joint entity.

◆ CreateEntities() [5/11]

Entity CreateEntities ( const sdf::Light *  _light)

Create all entities that exist in the sdf::Light object and load their plugins.

Parameters
[in]_lightSDF light object.
Returns
Light entity.

◆ CreateEntities() [6/11]

Entity CreateEntities ( const sdf::Link *  _link)

Create all entities that exist in the sdf::Link object and load their plugins.

Parameters
[in]_linkSDF link object.
Returns
Link entity.

◆ CreateEntities() [7/11]

Entity CreateEntities ( const sdf::Model *  _model)

Create all entities that exist in the sdf::Model object and load their plugins. Also loads plugins of child sensors.

Parameters
[in]_modelSDF model object.
Returns
Model entity.

◆ CreateEntities() [8/11]

Entity CreateEntities ( const sdf::ParticleEmitter *  _emitter)

Create all entities that exist in the sdf::ParticleEmitter object.

Parameters
[in]_emitterSDF ParticleEmitter object.
Returns
ParticleEmitter entity.
See also
CreateEntities(const sdf::Link *)

◆ CreateEntities() [9/11]

Entity CreateEntities ( const sdf::Sensor *  _sensor)

Create all entities that exist in the sdf::Sensor object. Sensor plugins won't be directly loaded by this function.

Parameters
[in]_sensorSDF sensor object.
Returns
Sensor entity.
See also
CreateEntities(const sdf::Model *)

◆ CreateEntities() [10/11]

Entity CreateEntities ( const sdf::Visual *  _visual)

Create all entities that exist in the sdf::Visual object and load their plugins.

Parameters
[in]_visualSDF visual object.
Returns
Visual entity.

◆ CreateEntities() [11/11]

Entity CreateEntities ( const sdf::World *  _world)

Create all entities that exist in the sdf::World object and load their plugins.

Parameters
[in]_worldSDF world object.
Returns
World entity.

◆ operator=() [1/2]

SdfEntityCreator& operator= ( const SdfEntityCreator _creator)

Copy assignment operator.

Parameters
[in]_creatorSdfEntityCreator to copy.
Returns
Reference to this.

◆ operator=() [2/2]

SdfEntityCreator& operator= ( SdfEntityCreator &&  _creator)
noexcept

Move assignment operator.

Parameters
[in]_creatorSdfEntityCreator component to move.
Returns
Reference to this.

◆ RequestRemoveEntity()

void RequestRemoveEntity ( const Entity  _entity,
bool  _recursive = true 
)

Request an entity deletion. This will insert the request into a queue. The queue is processed toward the end of a simulation update step.

Parameters
[in]_entityEntity to be removed.
[in]_recursiveWhether to recursively delete all child entities. True by default.

◆ SetParent()

void SetParent ( Entity  _child,
Entity  _parent 
)

Set an entity's parent entity. This function takes care of updating the EntityComponentManager and necessary components.

Parameters
[in]_childEntity which should be parented.
[in]_parentEntity which should be _child's parent.

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