Go to the documentation of this file.
47 config(
"update", update_);
50 config(
"successRequired", successRequired_);
75 auto ptr =
dynamic_cast<T *
>(observer_.get());
79 mc_rtc::type_name<T>());
87 return const_cast<T &
>(
static_cast<const PipelineObserver *
>(
this)->observer<T>());
90 bool update() const noexcept {
return update_; }
92 bool log() const noexcept {
return log_; }
94 bool gui() const noexcept {
return gui_; }
97 bool success() const noexcept {
return success_; }
109 bool successRequired_ =
true;
110 bool success_ =
true;
163 inline bool success() const noexcept {
return success_; }
172 auto it = std::find_if(pipelineObservers_.begin(), pipelineObservers_.end(),
173 [&name](
const PipelineObserver & obs) { return obs.observer().name() == name; });
174 if(it == pipelineObservers_.end())
187 const std::vector<PipelineObserver> &
observers()
const {
return pipelineObservers_; }
189 std::vector<PipelineObserver> &
observers() {
return pipelineObservers_; }
200 return std::find_if(pipelineObservers_.begin(), pipelineObservers_.end(),
201 [&name](
const PipelineObserver & obs) { return obs.observer().name() == name; })
202 != pipelineObservers_.end();
216 return std::find_if(pipelineObservers_.begin(), pipelineObservers_.end(),
217 [&type](
const PipelineObserver & obs) { return obs.observer().type() == type; })
218 != pipelineObservers_.end();
222 inline const std::string &
desc() const noexcept {
return desc_; }
225 inline const std::string &
name() const noexcept {
return name_; }
234 std::string name_ = {
"DefaultObserverPipeline"};
236 std::string desc_ = {
""};
237 bool runObservers_ =
true;
238 bool updateObservers_ =
true;
239 bool success_ =
false;
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
bool hasObserver(const std::string &name) const
Checks whether this pipeline has an observer.
Definition: ObserverPipeline.h:198
PipelineObserver & observer(const std::string &name)
Definition: ObserverPipeline.h:182
bool runObservers() const noexcept
Definition: ObserverPipeline.h:136
#define MC_OBSERVERS_DLLAPI
Definition: api.h:47
const std::string & desc() const noexcept
Short description of the pipeline.
Definition: ObserverPipeline.h:222
T & observer()
Definition: ObserverPipeline.h:85
bool hasObserverType(const std::string &type) const
Checks if there is an observer of a specific type in the pipeline.
Definition: ObserverPipeline.h:214
Observer & observer()
Definition: ObserverPipeline.h:61
std::vector< PipelineObserver > & observers()
Definition: ObserverPipeline.h:189
std::shared_ptr< mc_observers::Observer > ObserverPtr
Definition: Observer.h:206
Logs controller data to disk.
Definition: Logger.h:29
State observation pipeline.
Definition: ObserverPipeline.h:37
std::vector< PipelineObserver > pipelineObservers_
Definition: ObserverPipeline.h:242
mc_control::MCController & ctl_
Definition: ObserverPipeline.h:233
bool update() const noexcept
Definition: ObserverPipeline.h:90
State observation API.
Definition: Observer.h:50
Definition: StateBuilder.h:27
const std::string & name() const noexcept
Definition: ObserverPipeline.h:225
PipelineObserver(const mc_observers::ObserverPtr &observer, const mc_rtc::Configuration &config)
Definition: ObserverPipeline.h:44
void error_and_throw(Args &&... args)
Definition: logging.h:47
const PipelineObserver & observer(const std::string &name) const
Definition: ObserverPipeline.h:170
bool success() const noexcept
Definition: ObserverPipeline.h:97
void runObservers(bool status)
Whether to run the observers in this pipeline.
Definition: ObserverPipeline.h:143
Definition: ObserverPipeline.h:40
Definition: BodySensorObserver.h:13
const Observer & observer() const
Definition: ObserverPipeline.h:58
bool log() const noexcept
Definition: ObserverPipeline.h:92
const T & observer() const
Definition: ObserverPipeline.h:73
void updateObservers(bool status)
Whether to update the observers in this pipeline.
Definition: ObserverPipeline.h:156
bool updateObservers() const
Definition: ObserverPipeline.h:147
bool successRequired() const noexcept
Definition: ObserverPipeline.h:102
Definition: CompletionCriteria.h:10
bool gui() const noexcept
Definition: ObserverPipeline.h:94
Definition: generic_gripper.h:14
const std::vector< PipelineObserver > & observers() const
Definition: ObserverPipeline.h:187
bool success() const noexcept
Checks whether the last run of the pipeline succeeded.
Definition: ObserverPipeline.h:163
MCController is the base class to implement all controllers. It assumes that at least two robots are ...
Definition: MCController.h:98