Gazebo | Ignition | Community
Ask Your Question

change Maximum number of contacts , max_contacts, allowed between two entities gazebo ros

asked 2015-04-06 05:15:46 -0600

nomad gravatar image

updated 2015-04-14 13:06:57 -0600

nkoenig gravatar image

Calling service

rosservice call /gazebo/set_physics_properties

and setting max_contacts to 100 does not work.

After calling service

rosservice call /gazebo/get_physics_properties

the max_contacts is still 20.

Calling rosparam set /gazebo/max_contacts 100 does not work.

How can I overwrite the max_contacts parameter?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-04-09 04:32:50 -0600

AndreiHaidu gravatar image

Hi there,

have you tried using max_contacts from the physics tag or max_contacts from the collision tag?

Cheers, Andrei

edit flag offensive delete link more


Hi! Did not work. <maxContacts>100 </maxContacts> or <maxcontacts>100</maxcontacts> in urdf under collision or physics or gazebo tag. Thanks for helping.

nomad gravatar imagenomad ( 2015-04-14 07:55:48 -0600 )edit

might be the issue of the urdf parser as well, have you tried it with sdf?

AndreiHaidu gravatar imageAndreiHaidu ( 2015-04-14 09:05:24 -0600 )edit

I had a really quick look at the maxcontact setters and find it strange the way the value is set compared to other set value : this->sdf->GetElement("maxcontacts")->GetValue()->Set(value); [EDIT] Apparently this is ok as getvalue retrieves a paramPtr which can be set

guihome gravatar imageguihome ( 2015-04-14 12:03:02 -0600 )edit

answered 2015-04-14 14:42:01 -0600

the solution suggested by Andrei works on my side in gazebo2 on trusty if the <max_contacts>100</max_contacts> is put in the .world config after the physics tag (not in the urdf)

but I looked deeper to understand why the service to set physics properties does not work. I found the reason and this is a problem only before gazebo 3.0. From gazeboros the set physics properties service calls the generic PhysicsEngine setMaxContacts which does not in turn call the derived ODEPhysicsEngine setMaxContacts due to a mismatch between the arguments types between the class and its parent class (double vs unsigned int) This fix and the following probably solved the issue in gazebo 3.0

recompiling gazebo2.2 from source with the double to unsigned int worked for me, I could set max contacts with the setphysicsproperties

edit flag offensive delete link more

Question Tools


Asked: 2015-04-06 05:15:46 -0600

Seen: 2,585 times

Last updated: Apr 14 '15