0
$\begingroup$

Gazebo Answers logo

The gazebo threading model requires all sensors and plugins to effectively operate within their own threads, with an assumption that no one is clobbering the others data. As far as it seems, this is OK as long as physics is running, as I believe the physics update happens outside of the sensor updates.

In the case of a plugin modifying the position of an object, in real-time, however, the sensor does not necessary know the true state of the world at the time it was run in its own thread.

Thread A: updates a pose manually (i.e. manually setting the pose of a body or the position of a joint)

Thread B: a laser scanner or camera viewing the scene

If A wakes up at t=0.5 and performs its update, while B also wakes up at t=0.5, it is very difficult to know whether the sensor collected data before or after A did its action.

Are there any built-in methods to allow such synchronization and make these changes atomic?


Originally posted by gm on Gazebo Answers with karma: 1 on 2013-05-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

Most sensors should collect data after a physics update. The method used by each sensor varies slightly but they mainly generate sensor data based on timestamped physics data published by the physics thread after an update. The same timestamp is attached to the message the sensors publish. In gazebo 1.8, a similar mechanism is put in place for rendering based sensors such as gpu ray sensor and camera. Sensors that do not enforce this yet are the physics based ray sensor and rfid sensor.


Originally posted by iche033 with karma: 1018 on 2013-05-23

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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