Home | Tutorials | Wiki | Issues
Ask Your Question

Speeding Up Gazebo Physics Simulation (Considering ROS Plugin usage)

asked 2016-02-01 09:50:09 -0600

shantia gravatar image

Dear All,

I was not sure whether to post this question here or on ROS answers page. But I think it is closer to gazebo than ROS.

My Objectives is to Speed up Physical simulation to the max speed (I use max_step_size=0.005 and real_time_update_rate=0.0). I have around 25xspeed up with a Pioneer 2 robot with a single camera, 4x bumper and an IMU sensor (NVIDIA Geforce GTX980 with i7-4790@3.60 GHz x8). I use Gazebo 2.2.3 which comes with ROS indigo.

I need MORE! The reason is that I do Reinforcement learning experiments with robots, and well, faster experiments mean easier life.

What I Need to have for My robot

  • Diff drive ( I use libgazebo_ros_diff_drive )
  • Camera ( liggazebo_ros_camera)
  • 4x Bumpers (I use 4 different link connected to chassis with libgazebo_ros_bumper)
  • IMU ( I use libgazebo_ros_imu or libhector_gazebo_ros_imu)

My Questions:

  • Why the speed of simulation drops so much when a robot is added? I have around 100x speed when an environment is loaded without a robot. Is this because of ROS plugins?
  • Does anyone know of any faster ROS plugins if they are the bottleneck?
  • Is there any other way for me to update the speed further without increasing more max_step_size?
  • Is there perhaps a faster physics engine that I can use? I tried bullet, but nothing really changed.


  • I already use very simple collision meshes both for my environment and my robot.
  • My environment texture does not use lighting reflection/effects.
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-01 17:02:32 -0600

nkoenig gravatar image
  • Simulation slows down when a robot is added because the collision detection and dynamics engines now have work to do.

    • The bottleneck is most likely not ROS plugins. You can always profile the code using valgrind, or some other tool.

    • There is not an easy way to speed up simulation without changing the max_step_size. You can try a newer version of Gazebo (version 2 is over two years old).

As an alternative, you could run multiple simulations in parallel.

edit flag offensive delete link more


I see. Does gazebo use CPU to calculate the collision and dynamic engines or GPU? Because my GPU utilization is at 8%, while gazebo is using 4 of my 8 CPU cores (4 processes with usage 2.5+1.0+0.55+0.18 CPUs based on htop results). I will try installing the latest version. I am already using 10 machines to run separate simulations. Is it possible to run multiple gazebo's on the same machine?

shantia gravatar imageshantia ( 2016-02-02 02:22:13 -0600 )edit

I did increase the max_step_size to 0.01 (it means 100Hz update rate, right?), and I have the following problem: After some time, the gazebo SensorManager.cc gives an assertion failure. It says "Took over 1.0 seconds to update a sensor". I have to see whether this happens on gazebo7 as well or not.

shantia gravatar imageshantia ( 2016-02-02 09:16:49 -0600 )edit

Yes, the CPU is used by the collision and dynamic engines. the GPU is used by image-based sensors. The assertion you mention is an error that we are working on fixing.

nkoenig gravatar imagenkoenig ( 2016-02-02 09:27:16 -0600 )edit

Pull request that fixes the assert problem: https://bitbucket.org/osrf/gazebo/pull-requests/2115

nkoenig gravatar imagenkoenig ( 2016-02-02 16:09:27 -0600 )edit

Oh, great thanks. I guess then this is it. I got my answer. Thank you for you efforts.

shantia gravatar imageshantia ( 2016-02-03 06:42:18 -0600 )edit

I can confirm that with Gazebo 7.0 (compiled from source), I have no sensor assert problems, and I could speed up a very simple Pioneer 2 DX up to 430 times the real time speed with max_step_size of 0.05.

shantia gravatar imageshantia ( 2016-02-04 05:35:32 -0600 )edit
Login/Signup to Answer

Question Tools



Asked: 2016-02-01 09:47:45 -0600

Seen: 2,135 times

Last updated: Feb 01 '16