Class ModeObserver

Class Documentation

class system_modes::ModeObserver

Mode observer provides a local system modes cache.

The mode observer serves as a local system modes cache, instantiated by a node. The mode observer will initially try to gain current states/modes from all observes entities and will then continuously monitor transitions to keep up to date.

Public Functions

explicit ModeObserver(std::weak_ptr<rclcpp::Node>)
virtual ~ModeObserver() = default
virtual StateAndMode get(const string &part_name)

Getter for observed state and mode.

Returns cached observed state and mode for requested system entity (system or node).

virtual void observe(const string &part_name)

Add part to list of observed parts.

virtual void stop_observing(const string &part_name)

Remove part from list of observed parts.

Protected Functions

virtual void transition_callback(const TransitionEvent::SharedPtr msg, const string &part_name)
virtual void mode_event_callback(const ModeEvent::SharedPtr msg, const string &part_name)