0
$\begingroup$

I'm using Gazebo Sim Fortress with ROS 2 Humble to simulate my robot. While the simulation runs smoothly with the default simulation start time of 0.0, I want to start the simulation with a non-zero clock time. However, any changes I make to set a non-zero initial simulation time don’t seem to take effect, and the simulation time always starts at 0. What could be causing this issue? Thank you for your insights.

$ ign gazebo --version

ignition version: Gazebo Sim, version 6.16.0

<?xml version="1.0" ?>
<sdf version="1.6">
  <world name="10_ridges_farm">

    <scene>
      <grid>false</grid>
      <ambient>0.4 0.4 0.4 1</ambient>
      <background>0.7 0.7 0.7 1</background>
      <shadows>false</shadows>
    </scene>
    
    <state world_name="10_ridges_farm">
      <sim_time>100 0</sim_time>
      <real_time>50 0</real_time>
      <wall_time>50 0</wall_time>
    </state>

  </world>
</sdf>

or

<?xml version="1.0" ?>
<sdf version="1.6">
  <world name="10_ridges_farm">
    <state world_name="10_ridges_farm">
      <sim_time>15 0</sim_time>
      <real_time>15 0</real_time>
      <wall_time>0 0</wall_time>
    </state>
  </world>
</sdf>
$\endgroup$

1 Answer 1

0
$\begingroup$

I am not sure about the <sim_time> element, as it is indeed in the SDF specification. I filed an issue here.

However, a command line option to set the initial sim time was introduced in Garden, see this PR and this RSE thread).

Note that you are using Fortress (i.e. the version before Garden) so you will not have that functionality.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.