0
$\begingroup$

Rosanswers logo

Where and how can we set maximum number of contacts in Gazebo?

By default the max. num. of contacts is 20 "rosparam get /gazebo/max_contacts" Setting the parameter to any other ( ex. 100) " rosparam set /gazebo/max_contacts 100 " does not affect the simulation results, I am always getting 20 contacts using gazebo plugin bumpers.


Originally posted by Nomad on ROS Answers with karma: 53 on 2015-03-31

Post score: 0


Original comments

Comment by Nomad on 2015-04-06:
Calling service rosservice call /gazebo/setphysicsproperties and setting maxcontacts to 100 does not work. After calling service rosservice call /gazebo/getphysicsproperties the maxcontacts is still 20.

Comment by GuiHome on 2015-04-08:
in https://bitbucket.org/osrf/gazebo/src/e01e520d15603b87efaffa26817bf6224f00f320/gazebo/physics/Contact.hh?at=gazebo_2.2

#define MAX_CONTACT_JOINTS 32

might be one reason which limits the number of contacts generated ?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I think gazebo would react to a service call, not to a parameter change on the parameter server

maybe try using the

rosservice call /gazebo/set_physics_properties

and copy the current properties that you get with

rosservice call /gazebo/get_physics_properties

something like

rosservice call /gazebo/set_physics_properties "time_step: 0.001
max_update_rate: 1000.0
gravity: 
  x: 0.0
  y: 0.0
  z: 0.0
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: 100"

Originally posted by GuiHome with karma: 242 on 2015-03-31

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Nomad on 2015-04-01:
@guiHome the objects in Gazebo freeze after calling this service. However in RVIZ, I see that frames move and there even collisions. It seems that simulation is working but the visualization in Gazebo fails. The maximum number of contacts is still 20.

Comment by GuiHome on 2015-04-08:
my suggested parameters have no gravity and settings that work on my side. You should copy the settings that worked for you using the get_physics_properties I double checked and indeed the maximum contact does not change after setting it

$\endgroup$

Your Answer

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