I can control the length of a Gazebo step size through the world's SDF. Example with max_step_size
=4 ms :
<physics name="4ms" type="ode">
<max_step_size>0.004</max_step_size>
<real_time_factor>-1.0</real_time_factor>
<real_time_update_rate>250</real_time_update_rate>
</physics>
But, can I also set this value through an API call ?
Another simulation parameter, the Update rate, can be controlled through the .SDF or programmatically with a call to gz::sim::ServerConfig::SetUpdateRate
. Example:
// Object to pass custom configuration to the server
gz::sim::ServerConfig serverConfig;
// Populate with some configuration, for example, the SDF file to load
serverConfig.SetSdfFile(config["world_sdf_path"].as<std::string>());
serverConfig.SetUpdateRate(update_rate); // in Hz
I would like to do the same for max_step_size
.
Note 1: Gazebo's SimulationRunner
seem to have this capability (see this method), but I don't know how to access it from a "user" point of view.
Note 2: Transfer from unanswered answers.gazebosim question
max_step_size
. For now, I have to inject the user choice in the .sdf file, but this is ugly XML editing, which is less elegant than an API call. The wayREAL_TIME_update_rate
can be changed is way more convenient and readable, but clearly this is just for comfort as it still can be done with xml editing. $\endgroup$