Gazebo | Ignition | Community
Ask Your Question

Atomically update robot joints and position without affecting sensors

asked 2013-05-22 19:09:57 -0600

gm gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-05-23 01:12:55 -0600

iche033 gravatar image

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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-05-22 19:09:57 -0600

Seen: 124 times

Last updated: May 23 '13