gz-sensors icon indicating copy to clipboard operation
gz-sensors copied to clipboard

Move trigger logic to base Sensor class and enable trigger for all ca…

Open shameekganguly opened this issue 9 months ago • 0 comments

…mera sensors

🦟 Bug fix

Fixes https://github.com/gazebosim/gz-sensors/issues/426

Summary

This PR ensures that when a camera sensor is triggered, it will publish a new image on the next update call. Additionally, if Update() is called with _force = true, data will be always generated irrespective of whether a trigger is pending or not. To do this, the following changes are made:

  • Moved trigger logic to base Sensor class
  • Added new Sensor class methods EnableTriggered, DisableTriggered and HasPendingTrigger
  • Set all camera-type sensors to correctly enable triggered mode if it is specified in the SDF
  • Update integration tests

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

shameekganguly avatar May 10 '24 19:05 shameekganguly