gz/sim/Server.hh
Configuration parameters for a Server. An instance of this object can be used to construct a Server w...
Definition: gz/sim/ServerConfig.hh:43
std::optional< Entity > EntityByName(const std::string &_name, const unsigned int _worldIndex=0) const
Get an Entity based on a name.
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light....
Definition: gz/sim/Entity.hh:59
This library is part of the Ignition Robotics project.
STL class.
bool Running() const
Get whether the server is running. The server can have zero or more simulation worlds,...
gz::plugin::SpecializedPluginPtr< System, ISystemConfigure, ISystemPreUpdate, ISystemUpdate, ISystemPostUpdate > SystemPluginPtr
Definition: gz/sim/SystemPluginPtr.hh:33
std::optional< size_t > EntityCount(const unsigned int _worldIndex=0) const
Get the number of entities on the server.
std::optional< bool > AddSystem(const SystemPluginPtr &_system, const unsigned int _worldIndex=0)
Add a System to the server. The server must not be running when calling this.
bool RunOnce(const bool _paused=true)
Run the server once, all systems will be updated once and then this returns. This is a blocking call.
std::optional< size_t > SystemCount(const unsigned int _worldIndex=0) const
Get the number of systems on the server.
void SetUpdatePeriod(const std::chrono::steady_clock::duration &_updatePeriod, const unsigned int _worldIndex=0)
Set the update period. The update period is the wall-clock time between ECS updates....
bool SetPaused(const bool _paused, const unsigned int _worldIndex=0) const
Set whether a world simulation instance is paused. When paused is true, then simulation for the world...
Server(const ServerConfig &_config=ServerConfig())
Construct the server using the parameters specified in a ServerConfig.
bool HasEntity(const std::string &_name, const unsigned int _worldIndex=0) const
Return true if the specified world has an entity with the provided name.
The server instantiates and controls simulation.
Definition: gz/sim/Server.hh:114
std::optional< uint64_t > IterationCount(const unsigned int _worldIndex=0) const
Get the number of iterations the server has executed.
bool RequestRemoveEntity(const std::string &_name, bool _recursive=true, const unsigned int _worldIndex=0)
Return true if the specified world has an entity with the provided name and the entity was queued for...
bool Run(const bool _blocking=false, const uint64_t _iterations=0, const bool _paused=true)
Run the server. By default this is a non-blocking call, which means the server runs simulation in a s...
std::optional< bool > Paused(const unsigned int _worldIndex=0) const
Get whether a world simulation instance is paused. When paused is true, then simulation for the world...