Observer pipeline.
More...
#include <ObserverPipeline.h>
|
void | reset (const Dictionary &config) |
| Reset observers. More...
|
|
void | connect_sensor (std::shared_ptr< Sensor > sensor) |
| Add a sensor at the beginning of the pipeline. More...
|
|
void | append_observer (std::shared_ptr< Observer > observer) |
| Append an observer at the end of the pipeline. More...
|
|
std::vector< std::shared_ptr< Sensor > > & | sensors () |
| Sensors of the pipeline.
|
|
size_t | nb_sensors () |
| Number of sensors in the pipeline.
|
|
std::vector< std::shared_ptr< Observer > > & | observers () |
| Observers of the pipeline. Order matters.
|
|
size_t | nb_observers () |
| Number of observers in the pipeline.
|
|
void | run (Dictionary &observation) |
| Run observer pipeline on an observation dictionary. More...
|
|
Observer pipeline.
An observer pipeline is a list of sensors and observers, to be executed in that order. Observers further down the pipeline may depend on the results of those that precede them, which are written to the observation dictionary. The pipeline is thus assumed to be topologically sorted.
◆ append_observer()
void upkie::cpp::observers::ObserverPipeline::append_observer |
( |
std::shared_ptr< Observer > |
observer | ) |
|
|
inline |
Append an observer at the end of the pipeline.
- Parameters
-
◆ connect_sensor()
void upkie::cpp::observers::ObserverPipeline::connect_sensor |
( |
std::shared_ptr< Sensor > |
sensor | ) |
|
|
inline |
Add a sensor at the beginning of the pipeline.
- Parameters
-
[in] | sensor | Sensor to append. |
- Note
- Contrary to observers, the order in which sensors are executed is not guaranteed. If a sensor needs to run after another, consider splitting it into one sensor and one observer.
◆ reset()
void upkie::cpp::observers::ObserverPipeline::reset |
( |
const Dictionary & |
config | ) |
|
Reset observers.
- Parameters
-
[in] | config | Overall configuration dictionary. |
◆ run()
void upkie::cpp::observers::ObserverPipeline::run |
( |
Dictionary & |
observation | ) |
|
Run observer pipeline on an observation dictionary.
- Parameters
-
[in,out] | observation | Observation dictionary. |
The documentation for this class was generated from the following files:
- upkie/cpp/observers/ObserverPipeline.h
- upkie/cpp/observers/ObserverPipeline.cpp