Gazebo Sim

API Reference

9.0.0
UserCommands Class Referencefinal

This system provides a Gazebo Transport interface to execute commands while simulation is running. More...

#include <UserCommands.hh>

Public Member Functions

 UserCommands ()
 Constructor.
 
 ~UserCommands () final
 Destructor.
 
void Configure (const Entity &_entity, const std::shared_ptr< const sdf::Element > &_sdf, EntityComponentManager &_ecm, EventManager &_eventMgr) override
 Configure the system.
 
System::PriorityType ConfigurePriority () final
 Documentation inherited.
 
void PreUpdate (const UpdateInfo &_info, EntityComponentManager &_ecm) final
 All received commands are queued in order of reception and executed in order during PreUpdate.
 
- Public Member Functions inherited from System
 System ()=default
 Constructor.
 
virtual ~System ()=default
 Destructor.
 

Additional Inherited Members

- Public Types inherited from System
using PriorityType = int32_t
 Signed integer type used for specifying priority of the execution order of PreUpdate and Update phases.
 
- Static Public Attributes inherited from System
static constexpr PriorityType kDefaultPriority = {0}
 Default priority value for execution order of the PreUpdate and Update phases.
 
static constexpr std::string_view kPriorityElementName
 Name of the XML element from which the priority value will be parsed.
 

Detailed Description

This system provides a Gazebo Transport interface to execute commands while simulation is running.

Todo:
(louise) In the future, an interface undo/redo commands will also be provided.

Spawn entity

  • Service: /world/<world name>/create
  • Request type: gz.msgs.EntityFactory
  • Response type: gz.msgs.Boolean

Spawn multiple entities

This service can spawn multiple entities in the same iteration, thereby eliminating simulation steps between entity spawn times.

  • Service: /world/<world name>/create_multiple
  • Request type: gz.msgs.EntityFactory_V
  • Response type: gz.msgs.Boolean

Set entity pose

This service set the pose of entities

  • Service: /world/<world name>/set_pose
  • Request type: gz.msgs.Pose
  • Response type: gz.msgs.Boolean

Set multiple entity poses

This service set the pose of multiple entities

  • Service: /world/<world name>/set_pose_vector
  • Request type: gz.msgs.Pose_V
  • Response type: gz.msgs.Boolean

Try some examples described in examples/worlds/empty.sdf

Constructor & Destructor Documentation

◆ UserCommands()

UserCommands ( )
explicit

Constructor.

◆ ~UserCommands()

~UserCommands ( )
final

Destructor.

Member Function Documentation

◆ Configure()

void Configure ( const Entity _entity,
const std::shared_ptr< const sdf::Element > &  _sdf,
EntityComponentManager _ecm,
EventManager _eventMgr 
)
overridevirtual

Configure the system.

Parameters
[in]_entityThe entity this plugin is attached to.
[in]_sdfThe SDF Element associated with this system plugin.
[in]_ecmThe EntityComponentManager of the given simulation instance.
[in]_eventMgrThe EventManager of the given simulation instance.

Implements ISystemConfigure.

◆ ConfigurePriority()

System::PriorityType ConfigurePriority ( )
finalvirtual

Documentation inherited.

Implements ISystemConfigurePriority.

◆ PreUpdate()

void PreUpdate ( const UpdateInfo _info,
EntityComponentManager _ecm 
)
finalvirtual

All received commands are queued in order of reception and executed in order during PreUpdate.

Parameters
[in]_infoContains information about the current simulation iteration.
[in]_ecmThe entity component manager.

Implements ISystemPreUpdate.


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