Go to the documentation of this file.
52 Observer(
const std::string & type,
double dt) : type_(type), dt_(dt) {}
98 inline void name(
const std::string & name) { name_ =
name; }
103 inline const std::string &
name() const noexcept {
return name_; }
108 addToLogger(ctl, logger, category +
"_" + name_);
114 removeFromLogger(logger, category +
"_" + name_);
120 std::vector<std::string> category = {})
122 category.push_back(name_);
123 addToGUI(ctl, gui, category);
132 category.push_back(name_);
133 removeFromGUI(gui, category);
146 inline const std::string &
desc() const noexcept {
return desc_; }
148 inline const std::string
type() const noexcept {
return type_; }
151 inline const std::string &
error() const noexcept {
return error_; }
154 inline double dt() const noexcept {
return dt_; }
172 virtual void removeFromLogger(
mc_rtc::Logger &,
const std::string & );
183 const std::vector<std::string> & )
211 # define OBSERVER_MODULE_API __declspec(dllexport)
214 # define OBSERVER_MODULE_API __attribute__((visibility("default")))
216 # define OBSERVER_MODULE_API
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
std::string type_
Observer type.
Definition: Observer.h:199
const std::string type() const noexcept
Definition: Observer.h:148
#define MC_OBSERVERS_DLLAPI
Definition: api.h:47
void name(const std::string &name)
Set the observer's name.
Definition: Observer.h:98
double dt() const noexcept
Definition: Observer.h:154
virtual void addToGUI(const mc_control::MCController &, mc_rtc::gui::StateBuilder &, const std::vector< std::string > &)
Add observer information the GUI.
Definition: Observer.h:181
const std::string & desc() const noexcept
Short description of the observer.
Definition: Observer.h:146
std::string name_
Observer name.
Definition: Observer.h:198
const std::string & error() const noexcept
Definition: Observer.h:151
std::shared_ptr< mc_observers::Observer > ObserverPtr
Definition: Observer.h:206
Logs controller data to disk.
Definition: Logger.h:29
const std::string & name() const noexcept
Returns the observer's name.
Definition: Observer.h:103
std::string desc_
Short description of the observer and its configuration.
Definition: Observer.h:200
void addToGUI_(const mc_control::MCController &ctl, mc_rtc::gui::StateBuilder &gui, std::vector< std::string > category={})
Add observer to the gui under category {category, name()}.
Definition: Observer.h:118
State observation API.
Definition: Observer.h:50
Definition: StateBuilder.h:27
void removeFromLogger_(mc_rtc::Logger &logger, const std::string &category="")
Remove observer from logger.
Definition: Observer.h:112
Definition: BodySensorObserver.h:13
double dt_
Timestep.
Definition: Observer.h:203
void addToLogger_(const mc_control::MCController &ctl, mc_rtc::Logger &logger, const std::string &category="")
Add observer entries to the logger under the categrory "category + name()".
Definition: Observer.h:106
virtual void addToLogger(const mc_control::MCController &, mc_rtc::Logger &, const std::string &)
Add observer from logger.
Definition: Observer.h:164
Definition: CompletionCriteria.h:10
Definition: generic_gripper.h:14
Observer(const std::string &type, double dt)
Definition: Observer.h:52
virtual void configure(const mc_control::MCController &, const mc_rtc::Configuration &)
Configure observer.
Definition: Observer.h:62
MCController is the base class to implement all controllers. It assumes that at least two robots are ...
Definition: MCController.h:98
void removeFromGUI_(mc_rtc::gui::StateBuilder &gui, std::vector< std::string > category={})
Remove observer from gui.
Definition: Observer.h:130
std::string error_
Descriptive error message to show if the observer failed.
Definition: Observer.h:201