gz/sim/ServerConfig.hh
Go to the documentation of this file.
Information about a plugin that should be loaded by the server.
Definition: gz/sim/ServerConfig.hh:72
void SetSdf(const sdf::ElementPtr &_sdf)
Set the plugin XML elements associated with this plugin.
sdf::Plugin & Plugin()
Get a mutable version of the SDF plugin information.
PluginInfo(const std::string &_entityName, const std::string &_entityType, const std::string &_filename, const std::string &_name, const sdf::ElementPtr &_sdf)
Constructor with plugin information specified.
void SetName(const std::string &_name)
Set the name of the interface within the plugin library to load.
const std::string & Name() const
Name of the interface within the plugin library to load.
void SetFilename(const std::string &_filename)
Set the type of the entity which should receive this plugin. The type is used in conjuction with Enti...
PluginInfo(const std::string &_entityName, const std::string &_entityType, const sdf::Plugin &_plugin)
Constructor with plugin information specified.
const std::string & Filename() const
Get the plugin library filename.
const sdf::Plugin & Plugin() const
Get the SDF plugin information.
PluginInfo & operator=(const PluginInfo &_info)
Equal operator.
PluginInfo(const PluginInfo &_info)
Copy constructor.
void SetEntityName(const std::string &_entityName)
Set the name of the entity which should receive this plugin. The name is used in conjuction with _ent...
const std::string & EntityType() const
Get the entity type which should receive this plugin. The type is used in conjuction with EntityName ...
void SetEntityType(const std::string &_entityType)
Set the type of the entity which should receive this plugin. The type is used in conjuction with Enti...
const sdf::ElementPtr & Sdf() const
Plugin XML elements associated with this plugin.
void SetPlugin(const sdf::Plugin &_plugin) const
Set the SDF plugin information.
const std::string & EntityName() const
Get the name of the entity which should receive this plugin. The name is used in conjuction with _ent...
Configuration parameters for a Server. An instance of this object can be used to construct a Server w...
Definition: gz/sim/ServerConfig.hh:46
void SetRenderEngineGui(const std::string &_renderEngineGui)
Set the render engine gui plugin library.
PluginInfo LogRecordPlugin() const
Generate PluginInfo for Log recording based on the internal state of this ServerConfig object:
void SetLogRecordPeriod(const std::chrono::steady_clock::duration &_period)
Set time period to record states.
void SetNetworkSecondaries(unsigned int _secondaries)
Set the number of network secondary servers that the primary server should expect....
const std::vector< std::string > & LogRecordTopics() const
Get the topics to record that were added using AddLogRecordTopic.
bool SetSdfString(const std::string &_sdfString)
Set an SDF string to be used by the server.
void AddPlugins(const std::list< PluginInfo > &_plugins)
Add multiple plugins to the simulation.
std::string SdfString() const
Get the SDF String that has been set. An empty string will be returned if an SDF string has not been ...
void AddPlugin(const PluginInfo &_info)
Instruct simulation to attach a plugin to a specific entity when simulation starts.
void SetNetworkRole(const std::string &_role)
Set the network role, which is one of [primary, secondary]. If primary is used, then make sure to als...
unsigned int NetworkSecondaries() const
Get the number of secondary servers that a primary server should expect.
void SetHeadlessRendering(const bool _headless)
Set the headless mode.
void SetSdfRoot(const sdf::Root &_root) const
Set the SDF Root DOM object. The sdf::Root object will take precendence over ServerConfig::SdfString(...
bool LogRecordResources() const
Get whether meshes and material files are recorded.
SourceType
Type of SDF source.
Definition: gz/sim/ServerConfig.hh:49
const std::string & RenderEngineGui() const
Render engine plugin library to load.
void SetResourceCache(const std::string &_path)
Set the path to where simulation resources, such as models downloaded from fuel.gazebosim....
void SetPhysicsEngine(const std::string &_physicsEngine)
Set the physics engine plugin library.
const std::list< PluginInfo > & Plugins() const
Get all the plugins that should be loaded.
ServerConfig(const ServerConfig &_config)
Copy constructor.
std::optional< std::chrono::steady_clock::duration > UpdatePeriod() const
Get the update period duration.
const std::string LogRecordPath() const
Get path to place recorded states.
void SetUseLevels(const bool _levels)
Get whether the server is using the level system.
std::string SdfFile() const
Get the SDF file that has been set. An empty string will be returned if an SDF file has not been set.
std::optional< sdf::Root > & SdfRoot() const
Get the SDF Root DOM object.
void SetUseLogRecord(const bool _record)
Set whether the server is recording states.
std::string NetworkRole() const
Get the network role. See SetNetworkRole(const std::string &_role) for more information about distrib...
void SetLogRecordResources(bool _recordResources)
Set whether meshes and material files are recorded.
void SetLogRecordCompressPath(const std::string &_path)
Set file path to compress log files to.
bool UseLevels() const
Get whether the server is using the level system.
const std::string & ResourceCache() const
Path to where simulation resources, such as models downloaded from fuel.gazebosim....
bool UseDistributedSimulation() const
Get whether the server is using the distributed sim system.
void AddLogRecordTopic(const std::string &_topic)
Add a topic to record.
const std::string LogPlaybackPath() const
Get path to recorded states to play back.
std::optional< double > UpdateRate() const
Get the update rate in Hertz.
std::string LogRecordCompressPath() const
Get file path to compress log files to.
void ClearLogRecordTopics()
Clear topics to record. This will remove all topics set using AddLogRecordTopic.
void SetLogRecordPath(const std::string &_recordPath)
Set path to place recorded states.
bool SetSdfFile(const std::string &_file)
Set an SDF file to be used with the server.
const std::string & PhysicsEngine() const
Physics engine plugin library to load.
bool UseLogRecord() const
Get whether the server is recording states.
const std::string & RenderEngineServer() const
Render engine plugin library to load.
void SetLogPlaybackPath(const std::string &_playbackPath)
Set path to recorded states to play back.
bool HeadlessRendering() const
Get the headless mode.
const std::chrono::time_point< std::chrono::system_clock > & Timestamp() const
Get the timestamp of this ServerConfig. This is the system time when this ServerConfig was created....
void SetUpdateRate(const double &_hz)
Set the update rate in Hertz. Value <=0 are ignored.
void SetRenderEngineServer(const std::string &_renderEngineServer)
Set the render engine server plugin library.
PluginInfo LogPlaybackPlugin() const
Generate PluginInfo for Log playback based on the internal state of this ServerConfig object:
std::chrono::steady_clock::duration LogRecordPeriod() const
Get time period to record states.
ServerConfig & operator=(const ServerConfig &_cfg)
Equal operator.
std::list< ServerConfig::PluginInfo > loadPluginInfo(bool _isPlayback=false)
Load plugin information, following ordering.
std::list< ServerConfig::PluginInfo > parsePluginsFromString(const std::string &_str)
Parse plugins from XML configuration string.
std::list< ServerConfig::PluginInfo > parsePluginsFromFile(const std::string &_fname)
Parse plugins from XML configuration file.