Configuration parameters for a Server. An instance of this object can be used to construct a Server with a particular configuration. More...
#include <ignition/gazebo/ServerConfig.hh>
Classes | |
class | PluginInfo |
Information about a plugin that should be loaded by the server. Currently supports attaching a plugin to an entity given its type and name, but it can't tell apart multiple entities with the same name in different parts of the entity tree. More... | |
Public Member Functions | |
ServerConfig () | |
Constructor. More... | |
ServerConfig (const ServerConfig &_config) | |
Copy constructor. More... | |
~ServerConfig () | |
Destructor. More... | |
void | AddPlugin (const PluginInfo &_info) |
Instruct simulation to attach a plugin to a specific entity when simulation starts. More... | |
ServerConfig & | operator= (const ServerConfig &_cfg) |
Equal operator. More... | |
const std::list< PluginInfo > & | Plugins () const |
Get all the plugins that should be loaded. More... | |
const std::string & | ResourceCache () const |
Path to where simulation resources, such as models downloaded from fuel.ignitionrobotics.org, should be stored. More... | |
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. More... | |
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 set. More... | |
void | SetResourceCache (const std::string &_path) |
Set the path to where simulation resources, such as models downloaded from fuel.ignitionrobotics.org, should be stored. More... | |
bool | SetSdfFile (const std::string &_file) |
Set an SDF file to be used with the server. More... | |
bool | SetSdfString (const std::string &_sdfString) |
Set an SDF string to be used by the server. More... | |
void | SetUpdateRate (const double &_hz) |
Set the update rate in Hertz. Value <=0 are ignored. More... | |
void | SetUseDistributedSimulation (const bool _distributed) |
Set whether the server is using the distributed sim system. More... | |
void | SetUseLevels (const bool _levels) |
Get whether the server is using the level system. More... | |
std::optional< std::chrono::steady_clock::duration > | UpdatePeriod () const |
Get the update period duration. More... | |
std::optional< double > | UpdateRate () const |
Get the update rate in Hertz. More... | |
bool | UseDistributedSimulation () const |
Get whether the server is using the distributed sim system. More... | |
bool | UseLevels () const |
Get whether the server is using the level system. More... | |
Detailed Description
Configuration parameters for a Server. An instance of this object can be used to construct a Server with a particular configuration.
Constructor & Destructor Documentation
◆ ServerConfig() [1/2]
ServerConfig | ( | ) |
Constructor.
◆ ServerConfig() [2/2]
ServerConfig | ( | const ServerConfig & | _config | ) |
Copy constructor.
- Parameters
-
[in] _config ServerConfig to copy.
◆ ~ServerConfig()
~ServerConfig | ( | ) |
Destructor.
Member Function Documentation
◆ AddPlugin()
void AddPlugin | ( | const PluginInfo & | _info | ) |
Instruct simulation to attach a plugin to a specific entity when simulation starts.
- Parameters
-
[in] _info Information about the plugin to load.
◆ operator=()
ServerConfig& operator= | ( | const ServerConfig & | _cfg | ) |
◆ Plugins()
const std::list<PluginInfo>& Plugins | ( | ) | const |
Get all the plugins that should be loaded.
- Returns
- A list of all the plugins specified via AddPlugin(const PluginInfo &).
◆ ResourceCache()
const std::string& ResourceCache | ( | ) | const |
Path to where simulation resources, such as models downloaded from fuel.ignitionrobotics.org, should be stored.
- Returns
- Path to a location on disk. An empty string indicates that the default value will be used, which is currently ~/.ignition/fuel.
◆ SdfFile()
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.
- Returns
- The full path to the SDF file, or empty string.
◆ SdfString()
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 set.
- Returns
- The full contents of the SDF string, or empty string.
◆ SetResourceCache()
void SetResourceCache | ( | const std::string & | _path | ) |
Set the path to where simulation resources, such as models downloaded from fuel.ignitionrobotics.org, should be stored.
- Parameters
-
[in] _path Path to a location on disk. An empty string indicates that the default value will be used, which is currently ~/.ignition/fuel.
◆ SetSdfFile()
bool SetSdfFile | ( | const std::string & | _file | ) |
Set an SDF file to be used with the server.
Setting the SDF file will override any value set by SetSdfString
.
- Parameters
-
[in] _file Full path to an SDF file.
- Returns
- (reserved for future use)
◆ SetSdfString()
bool SetSdfString | ( | const std::string & | _sdfString | ) |
Set an SDF string to be used by the server.
Setting the SDF string will override any value set by SetSdfFile
.
- Parameters
-
[in] _file Full path to an SDF file.
- Returns
- (reserved for future use)
◆ SetUpdateRate()
void SetUpdateRate | ( | const double & | _hz | ) |
Set the update rate in Hertz. Value <=0 are ignored.
- Parameters
-
[in] _hz The desired update rate of the server in Hertz.
◆ SetUseDistributedSimulation()
void SetUseDistributedSimulation | ( | const bool | _distributed | ) |
Set whether the server is using the distributed sim system.
- Parameters
-
[in] _distributeSimulation Value to set.
◆ SetUseLevels()
void SetUseLevels | ( | const bool | _levels | ) |
Get whether the server is using the level system.
- Parameters
-
[in] _levels Value to set.
◆ UpdatePeriod()
std::optional<std::chrono::steady_clock::duration> UpdatePeriod | ( | ) | const |
Get the update period duration.
- Returns
- The desired update period, or nullopt if an UpdateRate has not been set.
◆ UpdateRate()
std::optional<double> UpdateRate | ( | ) | const |
Get the update rate in Hertz.
- Returns
- The desired update rate of the server in Hertz, or nullopt if an UpdateRate has not been set.
◆ UseDistributedSimulation()
bool UseDistributedSimulation | ( | ) | const |
Get whether the server is using the distributed sim system.
- Returns
- True if the server is set to use the distributed simulation system
◆ UseLevels()
bool UseLevels | ( | ) | const |
Get whether the server is using the level system.
- Returns
- True if the server is set to use the level system
The documentation for this class was generated from the following file: