mc_observers::ObserverPipeline Struct Reference

State observation pipeline. More...

#include <mc_observers/ObserverPipeline.h>

Collaboration diagram for mc_observers::ObserverPipeline:

Classes

struct  PipelineObserver
 

Public Member Functions

 ObserverPipeline (mc_control::MCController &ctl, const std::string &name)
 
 ObserverPipeline (mc_control::MCController &ctl)
 
 ~ObserverPipeline ()=default
 
void create (const mc_rtc::Configuration &config, double dt)
 
void reset ()
 
bool run ()
 
bool runObservers () const noexcept
 
void runObservers (bool status)
 Whether to run the observers in this pipeline. More...
 
bool updateObservers () const
 
void updateObservers (bool status)
 Whether to update the observers in this pipeline. More...
 
bool success () const noexcept
 Checks whether the last run of the pipeline succeeded. More...
 
const PipelineObserverobserver (const std::string &name) const
 
PipelineObserverobserver (const std::string &name)
 
const std::vector< PipelineObserver > & observers () const
 
std::vector< PipelineObserver > & observers ()
 
bool hasObserver (const std::string &name) const
 Checks whether this pipeline has an observer. More...
 
bool hasObserverType (const std::string &type) const
 Checks if there is an observer of a specific type in the pipeline. More...
 
const std::string & desc () const noexcept
 Short description of the pipeline. More...
 
const std::string & name () const noexcept
 
void addToLogger (mc_rtc::Logger &)
 
void removeFromLogger (mc_rtc::Logger &)
 
void addToGUI (mc_rtc::gui::StateBuilder &)
 
void removeFromGUI (mc_rtc::gui::StateBuilder &)
 

Protected Attributes

mc_control::MCControllerctl_
 
std::string name_ = {"DefaultObserverPipeline"}
 Name of this pipeline. More...
 
std::string desc_ = {""}
 
bool runObservers_ = true
 Whether to run this pipeline. More...
 
bool updateObservers_ = true
 Whether to update real robots from estimated state. More...
 
bool success_ = false
 Whether the pipeline successfully executed. More...
 
std::vector< PipelineObserverpipelineObservers_
 

Detailed Description

State observation pipeline.

Observers are responsible for estimating some of the robot properties from sensor measurements and/or fusing several source of information (e.g the EncoderObserver estimates the joint position and velocity based on joint sensors, the KinematicInertialObservers the state of the floating base from kinematics and IMU information, BodySensorObserver uses BodySensor information to update the floating base, etc). The ObserverPipeline groups them into a "State observation pipeline", that will run each observer sequentially. Some observers may be used to update the state of the real robots instances used by the controller, while others may only be used for logging estimated values for comparison purposes.

Constructor & Destructor Documentation

◆ ObserverPipeline() [1/2]

mc_observers::ObserverPipeline::ObserverPipeline ( mc_control::MCController ctl,
const std::string &  name 
)

◆ ObserverPipeline() [2/2]

mc_observers::ObserverPipeline::ObserverPipeline ( mc_control::MCController ctl)

◆ ~ObserverPipeline()

mc_observers::ObserverPipeline::~ObserverPipeline ( )
default

Member Function Documentation

◆ addToGUI()

void mc_observers::ObserverPipeline::addToGUI ( mc_rtc::gui::StateBuilder )

◆ addToLogger()

void mc_observers::ObserverPipeline::addToLogger ( mc_rtc::Logger )

◆ create()

void mc_observers::ObserverPipeline::create ( const mc_rtc::Configuration config,
double  dt 
)

◆ desc()

const std::string& mc_observers::ObserverPipeline::desc ( ) const
inlinenoexcept

Short description of the pipeline.

◆ hasObserver()

bool mc_observers::ObserverPipeline::hasObserver ( const std::string &  name) const
inline

Checks whether this pipeline has an observer.

Parameters
nameName of the observer
Returns
True if the observer is in the pipeline

◆ hasObserverType()

bool mc_observers::ObserverPipeline::hasObserverType ( const std::string &  type) const
inline

Checks if there is an observer of a specific type in the pipeline.

There may be more than one

Parameters
typeType of the observer
Returns
True if there is at least one observer of this type in the pipeline

◆ name()

const std::string& mc_observers::ObserverPipeline::name ( ) const
inlinenoexcept

◆ observer() [1/2]

PipelineObserver& mc_observers::ObserverPipeline::observer ( const std::string &  name)
inline

◆ observer() [2/2]

const PipelineObserver& mc_observers::ObserverPipeline::observer ( const std::string &  name) const
inline

◆ observers() [1/2]

std::vector<PipelineObserver>& mc_observers::ObserverPipeline::observers ( )
inline

◆ observers() [2/2]

const std::vector<PipelineObserver>& mc_observers::ObserverPipeline::observers ( ) const
inline

◆ removeFromGUI()

void mc_observers::ObserverPipeline::removeFromGUI ( mc_rtc::gui::StateBuilder )

◆ removeFromLogger()

void mc_observers::ObserverPipeline::removeFromLogger ( mc_rtc::Logger )

◆ reset()

void mc_observers::ObserverPipeline::reset ( )

◆ run()

bool mc_observers::ObserverPipeline::run ( )

◆ runObservers() [1/2]

bool mc_observers::ObserverPipeline::runObservers ( ) const
inlinenoexcept
Returns
True if the observers are running

◆ runObservers() [2/2]

void mc_observers::ObserverPipeline::runObservers ( bool  status)
inline

Whether to run the observers in this pipeline.

Parameters
statusTrue if the observers should be run

◆ success()

bool mc_observers::ObserverPipeline::success ( ) const
inlinenoexcept

Checks whether the last run of the pipeline succeeded.

Returns
True when the last call to run() succeeded

◆ updateObservers() [1/2]

bool mc_observers::ObserverPipeline::updateObservers ( ) const
inline
Returns
True if the observers are updating the real robots instance. The update does not occur if runObservers() is false.

◆ updateObservers() [2/2]

void mc_observers::ObserverPipeline::updateObservers ( bool  status)
inline

Whether to update the observers in this pipeline.

Parameters
statusTrue if the real robot instances should be update from the observers's result. Update occurs only if runObservers() is true, and the observer succeeded.

Member Data Documentation

◆ ctl_

mc_control::MCController& mc_observers::ObserverPipeline::ctl_
protected

◆ desc_

std::string mc_observers::ObserverPipeline::desc_ = {""}
protected

◆ name_

std::string mc_observers::ObserverPipeline::name_ = {"DefaultObserverPipeline"}
protected

Name of this pipeline.

◆ pipelineObservers_

std::vector<PipelineObserver> mc_observers::ObserverPipeline::pipelineObservers_
protected

Observers that will be run by the pipeline.

◆ runObservers_

bool mc_observers::ObserverPipeline::runObservers_ = true
protected

Whether to run this pipeline.

◆ success_

bool mc_observers::ObserverPipeline::success_ = false
protected

Whether the pipeline successfully executed.

◆ updateObservers_

bool mc_observers::ObserverPipeline::updateObservers_ = true
protected

Whether to update real robots from estimated state.


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