ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Limit Gazebo Real Time Factor

asked 2012-08-16 06:01:31 -0500

Hi All

I'm trying to teleoperate a robot using the gazebo simulator. I need to slow down the simulation, because mannually controling the robot is very hard when it is running 3 or more times faster than the real time.

is there any tag or property in gazebo to limit the simulation to a maximum of real time?

thanks a lot

Mario

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-08-16 06:26:12 -0500

pgrice gravatar image

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.

edit flag offensive delete link more

Comments

2

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.

hsu gravatar image hsu  ( 2012-08-16 19:54:03 -0500 )edit

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

Mario Garzon gravatar image Mario Garzon  ( 2012-08-17 05:25:32 -0500 )edit

@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.

hsu gravatar image hsu  ( 2012-08-17 07:41:17 -0500 )edit

Thanks a lot.. it works fine!

Mario Garzon gravatar image Mario Garzon  ( 2012-08-20 05:12:51 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2012-08-16 06:01:31 -0500

Seen: 4,303 times

Last updated: Aug 16 '12