Robotics StackExchange | Archived questions

Uncheck World | Physics | enable physics from command line, or at launch time?

I'm launching gazebo through ROS, I would like to be able to start it in a disabled physics state. Or barring that launch it paused and disable physics from the command line or otherwise programmatically.

rosservice call /gazebo/set_physics_properties seems like a good candidate as it has many fields in common with those that appear under the World | Physics property gui element, but no enable physics:

time_step: 0.001
pause: False
max_update_rate: 1000.0
gravity: 
  x: 0.0
  y: 0.0
  z: -9.8
ode_config: 
  auto_disable_bodies: False
  sor_pgs_precon_iters: 0
  sor_pgs_iters: 50
  sor_pgs_w: 1.3
  sor_pgs_rms_error_tol: 0.0
  contact_surface_layer: 0.001
  contact_max_correcting_vel: 100.0
  cfm: 0.0
  erp: 0.2
  max_contacts: 20

Is there another way to disable physics?

This is Gazebo 2.2.3.

Asked by Lucas Walter on 2015-01-13 18:20:24 UTC

Comments

Answers

Is starting Gazebo in a paused state what you are looking for? If so, you can pass a "-u" to Gazebo on the command line which will start Gazebo in a paused state.

Asked by nkoenig on 2015-01-15 11:31:53 UTC

Comments

No, what I see when I uncheck enable physics is that the simulation continues to run, the clock runs forward, I can set the model state of objects and they will hang in mid-air, virtual cameras get updated, and the rest of the gazebo machinery continues to operate. I haven't tried intersecting objects but I would assume the collision would be ignored.

Asked by Lucas Walter on 2015-01-15 11:38:12 UTC

You can send a physics.proto message to the ~/physics topic to enable/disable physics.

Asked by nkoenig on 2015-01-15 11:43:21 UTC

I tried that through gazebojs and the result is the same as http://answers.gazebosim.org/question/7637/toggle-visibility-of-a-link/ : nothing happens in gazebo in response. My msg is { "enable_physics" : false, "type" : 1 }, also tried "ODE" as the type.

Asked by Lucas Walter on 2015-01-16 11:11:12 UTC

Was this solved? I have the same problem (I want to disable the physics of Gazebo). I know I can uncheck it in the Gazebo GUI, but how could I do it programmatically? Thanks!

Asked by ROS_GAZEBO_USER on 2018-10-05 11:52:46 UTC