change Maximum number of contacts , max_contacts, allowed between two entities gazebo ros
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?
Asked by nomad on 2015-04-06 05:15:46 UTC
Answers
Hi there,
have you tried using max_contacts
from the physics
tag or max_contacts
from the collision
tag?
Cheers, Andrei
Asked by AndreiHaidu on 2015-04-09 04:32:50 UTC
Comments
Hi! Did not work.
Asked by nomad on 2015-04-14 07:55:48 UTC
might be the issue of the urdf parser as well, have you tried it with sdf?
Asked by AndreiHaidu on 2015-04-14 09:05:24 UTC
I had a really quick look at the max_contact setters and find it strange the way the value is set compared to other set value : this->sdf->GetElement("max_contacts")->GetValue()->Set(value); [EDIT] Apparently this is ok as getvalue retrieves a paramPtr which can be set
Asked by guihome on 2015-04-14 12:03:02 UTC
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 gazebo_ros 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 https://bitbucket.org/osrf/gazebo/diff/gazebo/physics/PhysicsEngine.hh?diff2=b15c2c925cb1&at=minor_abi_3.0
recompiling gazebo2.2 from source with the double to unsigned int worked for me, I could set max contacts with the set_physics_properties
Asked by guihome on 2015-04-14 14:42:01 UTC
Comments