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

RFC: Sensor Systems: Vulnerability testing, advanced noise models, raw sensor data callbacks, decoupling transport

Open bperseghetti opened this issue 1 year ago • 2 comments

RFC

Sensor Systems: Vulnerability testing, advanced noise models, raw sensor data callbacks, decoupling transport

This is a request for comment on the following suggested implementation method changes for how gz-sensors works with gz-sim systems plugins.

Support for this effort is being brought forward from the DARPA FIRE program through Purdue University for the testing of system robustness to novel sensor attacks/modulation. This requires the ability to dynamically change a gz-sensor noise model that proves difficulty with the current gz-sensor implementation of publishing directly to gz-transport and also only taking the noise model from the passed SDF fragment.

Multiple methods of allowing for dynamic noise models have been considered in two meetings with gz-sim and gz-sensor stakeholders. The methods most discussed were as follows:

  1. Pushing noise back down through the ECM to sensor (gz-sensors)
  2. Create "core sensor models (gz-sensors)" and have system (gz-sim) plugin manage the noise models and sensor data publishing.

From the last discussion method 2 has been so far selected as the preferred approach (benefits discussed below in Objectives).

Objective:

  • Allow for changing the sensor model noise and output through gz-sim system plugin dynamically.
  • De-tangle/simplify gz-sensors by implementing callback mechanisms instead of pub-sub.
  • Reduce the the difficulty around ABI breaking changes for new sensor noise models and SDF specific dependencies.
  • Allow for easier changes to make sensor models more realistic on dependent states and more reusable (as a core library-like component for gz-sim).

Approach:

  • gz-sim:

    • Read the raw sensor data from gz-sensors.
    • Change the gz-sim systems plugin for sensors to publish data that is transformed by the user defined noise model (including from a transport (message based) noise model.
  • gz-sensors:

    • Create set of core-models free from transport.
    • Expose raw sensor data that can be called from gz-sim system plugins.

bperseghetti avatar Apr 10 '24 20:04 bperseghetti

This seems a great idea, especially decoupling gz-sensors and transport. I guess https://github.com/gazebosim/gz-sim/issues/2268 is kind of related.

traversaro avatar Apr 10 '24 23:04 traversaro

All the suggestions sound great. It would however be good to rethink how noise is specified in sdf because currently, adding a new type of noise is quite cumbersome (requiring sdf standard changes).

peci1 avatar May 06 '24 20:05 peci1