State observation pipeline. More...
#include <mc_observers/ObserverPipeline.h>
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 PipelineObserver & | observer (const std::string &name) const |
PipelineObserver & | observer (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::MCController & | ctl_ |
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< PipelineObserver > | pipelineObservers_ |
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.
mc_observers::ObserverPipeline::ObserverPipeline | ( | mc_control::MCController & | ctl, |
const std::string & | name | ||
) |
mc_observers::ObserverPipeline::ObserverPipeline | ( | mc_control::MCController & | ctl | ) |
|
default |
void mc_observers::ObserverPipeline::addToGUI | ( | mc_rtc::gui::StateBuilder & | ) |
void mc_observers::ObserverPipeline::addToLogger | ( | mc_rtc::Logger & | ) |
void mc_observers::ObserverPipeline::create | ( | const mc_rtc::Configuration & | config, |
double | dt | ||
) |
|
inlinenoexcept |
Short description of the pipeline.
|
inline |
Checks whether this pipeline has an observer.
name | Name of the observer |
|
inline |
Checks if there is an observer of a specific type in the pipeline.
There may be more than one
type | Type of the observer |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
void mc_observers::ObserverPipeline::removeFromGUI | ( | mc_rtc::gui::StateBuilder & | ) |
void mc_observers::ObserverPipeline::removeFromLogger | ( | mc_rtc::Logger & | ) |
void mc_observers::ObserverPipeline::reset | ( | ) |
bool mc_observers::ObserverPipeline::run | ( | ) |
|
inlinenoexcept |
|
inline |
Whether to run the observers in this pipeline.
status | True if the observers should be run |
|
inlinenoexcept |
Checks whether the last run of the pipeline succeeded.
|
inline |
|
inline |
Whether to update the observers in this pipeline.
status | True if the real robot instances should be update from the observers's result. Update occurs only if runObservers() is true, and the observer succeeded. |
|
protected |
|
protected |
|
protected |
Name of this pipeline.
|
protected |
Observers that will be run by the pipeline.
|
protected |
Whether to run this pipeline.
|
protected |
Whether the pipeline successfully executed.
|
protected |
Whether to update real robots from estimated state.