upkie 6.1.0
Open-source wheeled biped robots
|
Base class for sensors. More...
#include <Sensor.h>
Public Member Functions | |
virtual | ~Sensor () |
Destructor is virtual to deallocate lists of observers properly. | |
virtual std::string | prefix () const noexcept |
Prefix of output in the observation dictionary. More... | |
virtual void | write (Dictionary &observation) |
Write output to a dictionary. More... | |
Base class for sensors.
Sensors run before observers. They write their observations without reading other observations from the pipeline, although they may of course read data from other media (such as the file system).
|
inlinevirtualnoexcept |
Prefix of output in the observation dictionary.
This prefix is looked up by the spine to feed observation(prefix)
to the write function.
Reimplemented in upkie::cpp::sensors::CpuTemperature, upkie::cpp::sensors::Joystick, and upkie::cpp::sensors::Keyboard.
|
inlinevirtual |
Write output to a dictionary.
[out] | observation | Dictionary to write observations to. |
Reimplemented in upkie::cpp::sensors::CpuTemperature, upkie::cpp::sensors::Joystick, and upkie::cpp::sensors::Keyboard.