Gazebo | Ignition | Community
Ask Your Question

no collision data after some time

asked 2017-06-01 05:10:03 -0600

felix gravatar image

updated 2017-06-01 07:11:30 -0600


I was trying to get the contact forces of my robot by listening at the /gazebo/default/physics/contacts topic. The results were quite unrealistic : when I summed all external contact forces on my robot, I got an average of 170N (will my robot weight 73kg), and with quite big oscillations and some contacts not present at each time step. So I tried to reduce the problem as simpler one, and I finished with a single box on the ground and I still have the problem, in particular after some time (about 1 second simulation time) I get no more contact data (only the time steps as if no collision).

The world file : C:\fakepath\world_test.sdf to listen to the topic : run gz topic -e /gazebo/default/physics/contacts in the terminal, or even beter gz topic -e /gazebo/default/physics/contacts > contact.txt because it is generating lots of data (several MB per second).

In my case, I stopped getting contacts at 1s and 400000ns, which corresponded to line 685133 of the contact.txt file (C:\fakepath\contact.txt.7z.c : sorry, the file was so big the site refused it, so I had to compress it : to get it, download it, rename it in contact.txt.7z (I had to add the .c because the site refused archives) and uncompress it).

Do you have some idea where the problem may come from? Thank you very much in advance Felix

EDIT : I tested by launching gazebo without specifying a world file, and just adding a cube from the GUI : even if the time step isn't the same, it's still after 1 second that I get no longer the collisions : is it some kind of optimization to stop considering contacts after 1 second without movement? If so, how to disable it?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-06-01 09:56:00 -0600

felix gravatar image

If the cube hits the floor at time t, a first message is published at time t, and then each time step up to (t + 1 second + timestep), and then nothing until the cube moves again. If I change the time step, it's still 1 second.

So I suppose it is a kind of optimization in order to stop simulating non moving objects (the collision shown in the GUI also disappear). I suppose (hope) there is a way to disable this optimization, but I found a work around : if I add a contact sensor to my link, it I get the collision data in both topics (the one of the sensor and /gazebo/default/physics/contacts)

<sensor name='contact_cube' type='contact'>
edit flag offensive delete link more


I think the behavior you're seeing is an optimization and can be disabled with the SDF tag <allow_auto_disable>

sloretz gravatar imagesloretz ( 2017-06-02 09:41:59 -0600 )edit

Thanks !!!

felix gravatar imagefelix ( 2017-06-02 11:02:17 -0600 )edit

Question Tools

1 follower


Asked: 2017-06-01 05:10:03 -0600

Seen: 338 times

Last updated: Jun 01 '17