It looks like you can set the simulator to use wall clock time by setting the parameter '/use_sim_time' to false in the gazebo world launch file (i.e. gazebo_worlds/launch/empty_world.launch).
Alternatively, you can set the update rate of the simulation to match the dt simulation step time (see gazebo_worlds/worlds/empty_throttled.world --line 10)
<physics type="ode" update_rate="1000">
<ode>
<solver type="quick" dt="0.001" iters="10" sor="1.3" />
...
</ode>
</physics>
This should also produce (at least roughly) the behavior you're looking for.
Originally posted by pgrice with karma: 196 on 2012-08-16
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by hsu on 2012-08-16:
actually, setting /use_sim_time to false in simulation has unexpected results. But you are correct, update_rate * dt = upper bound of the real-time factor of the simulation. e.g. 1000 * 0.001 = 1 throttles simulation to be real-time at the maximum.
Comment by Mario Garzon on 2012-08-17:
I tried the solution, the simulator runs with the correct real-time factor, but when i try to spawn any object it gives a message "waiting for service spawn_urdf_model" and doesn't put the model on the simulator
Comment by hsu on 2012-08-17:
@Mario Garzon: there is a bug in 1.6.12 where the gazebo node name needs to be "gazebo". see http://answers.ros.org/question/41646/spawning-problems-with-fuerte-ubuntu-1204/. anticipate fixes in next release 1.6.13.
Comment by Mario Garzon on 2012-08-20:
Thanks a lot.. it works fine!