Getting contacts from a world plugin at a fixed rate

asked 2017-07-30 12:02:56 -0600

hamzamerzic gravatar image

I am having some issues with the collision sensor that makes the updates last longer than 1 second when gzclient is not open, so I am trying to explore a different strategy of obtaining contacts a fixed rate. What would be the most proper way to do this?

One idea that comes to mind is to create a world plugin and access the ContactManager from there. Since I have at most two objects present during the whole simulation, there is no need to create filters, so I can just get all the contacts directly. The question is now how to do it in such a way that I get the contacts at a fixed rate? One option would be to attach an OnUpdate event that compares the sim time vs last sim time and publishes the contact information.

Is there a better way to do it? I was also considering using Timers, but they seem to be tied to the wall time.

edit retag flag offensive close merge delete

Comments

1

I think manual throttling like you described may be the way to go. Currently I don't think there is a way to change the publish rate of the contact manager.

iche033 gravatar imageiche033 ( 2017-08-01 10:30:05 -0600 )edit