upkie 6.1.0
Open-source wheeled biped robots
Loading...
Searching...
No Matches
upkie::cpp::observers::Observer Class Reference

Base class for observers. More...

#include <Observer.h>

Public Member Functions

virtual ~Observer ()
 Destructor is virtual to deallocate lists of observers properly.
 
virtual std::string prefix () const noexcept
 Prefix of outputs in the observation dictionary. More...
 
virtual void reset (const Dictionary &config)
 Reset observer. More...
 
virtual void read (const Dictionary &observation)
 Read inputs from other observations. More...
 
virtual void write (Dictionary &observation)
 Write outputs, called if reading was successful. More...
 

Detailed Description

Base class for observers.

Member Function Documentation

◆ prefix()

virtual std::string upkie::cpp::observers::Observer::prefix ( ) const
inlinevirtualnoexcept

◆ read()

virtual void upkie::cpp::observers::Observer::read ( const Dictionary &  observation)
inlinevirtual

Read inputs from other observations.

Parameters
[in]observationDictionary to read other observations from.
Note
The base class reads nothing. We put an empty function here rather than making the class abstract to be able to instantiate vectors of it.

Reimplemented in upkie::cpp::observers::BaseOrientation, upkie::cpp::observers::FloorContact, upkie::cpp::observers::HistoryObserver< T >, and upkie::cpp::observers::WheelOdometry.

◆ reset()

virtual void upkie::cpp::observers::Observer::reset ( const Dictionary &  config)
inlinevirtual

◆ write()

virtual void upkie::cpp::observers::Observer::write ( Dictionary &  observation)
inlinevirtual

Write outputs, called if reading was successful.

Parameters
[out]observationDictionary to write observations to.
Note
The base class writes nothing. We put an empty function here rather than making the class abstract to be able to instantiate vectors of it.

Reimplemented in upkie::cpp::observers::BaseOrientation, upkie::cpp::observers::FloorContact, upkie::cpp::observers::HistoryObserver< T >, and upkie::cpp::observers::WheelOdometry.


The documentation for this class was generated from the following file: