Sensor Interface

robot_interfaces also provides base classes for a pure sensor interface. In contrast to a robot, a sensor only provides observations but does not take actions. Apart from that, the overall structure is mostly the same as for a robot. That is, there are SensorBackend and SensorFrontend which communicate via SensorData (either single- or multi-process).

For implementing an interface for your sensor, you only need to implement an observation type and a driver class based on SensorDriver. Then simply create data/backend/frontend using those custom types as template arguments.

Optionally, your driver class can also provide a “sensor info” object by implementing get_sensor_info(). This object is then accessible by the user via get_sensor_info(). You may use this, to provide static information about the sensor, that does not change over time (e.g. frame rate of a camera). If you don’t implement the corresponding method in the driver, the front end will return an empty struct as placeholder.