Public Member Functions | Private Attributes | List of all members
kobuki::EventManager Class Reference

#include <event_manager.hpp>

Public Member Functions

 EventManager ()
 
void init (const std::string &sigslots_namespace)
 
void update (bool is_plugged, bool is_alive)
 
void update (const CoreSensors::Data &new_state, const std::vector< uint16_t > &cliff_data)
 
void update (const uint16_t &digital_input)
 

Private Attributes

uint16_t last_digital_input
 
RobotEvent::State last_robot_state
 
CoreSensors::Data last_state
 
ecl::Signal< const BumperEvent & > sig_bumper_event
 
ecl::Signal< const ButtonEvent & > sig_button_event
 
ecl::Signal< const CliffEvent & > sig_cliff_event
 
ecl::Signal< const InputEvent & > sig_input_event
 
ecl::Signal< const PowerEvent & > sig_power_event
 
ecl::Signal< const RobotEvent & > sig_robot_event
 
ecl::Signal< const WheelEvent & > sig_wheel_event
 

Detailed Description

Definition at line 118 of file event_manager.hpp.

Constructor & Destructor Documentation

◆ EventManager()

kobuki::EventManager::EventManager ( )
inline

Definition at line 122 of file event_manager.hpp.

Member Function Documentation

◆ init()

void kobuki::EventManager::init ( const std::string &  sigslots_namespace)

Definition at line 32 of file event_manager.cpp.

◆ update() [1/3]

void kobuki::EventManager::update ( bool  is_plugged,
bool  is_alive 
)

Emit events if the robot gets online/offline.

Parameters
is_pluggedIs the USB cable connected?.
is_aliveIs the robot alive?.

Definition at line 287 of file event_manager.cpp.

◆ update() [2/3]

void kobuki::EventManager::update ( const CoreSensors::Data new_state,
const std::vector< uint16_t > &  cliff_data 
)

Update with incoming data and emit events if necessary.

Parameters
new_stateUpdated core sensors state
cliff_dataCliff sensors readings (we include them as an extra information on cliff events)

Definition at line 47 of file event_manager.cpp.

◆ update() [3/3]

void kobuki::EventManager::update ( const uint16_t &  new_digital_input)

Emit events if something changed in the digital input port.

Parameters
new_digital_inputNew values on digital input port.

Definition at line 265 of file event_manager.cpp.

Member Data Documentation

◆ last_digital_input

uint16_t kobuki::EventManager::last_digital_input
private

Definition at line 140 of file event_manager.hpp.

◆ last_robot_state

RobotEvent::State kobuki::EventManager::last_robot_state
private

Definition at line 141 of file event_manager.hpp.

◆ last_state

CoreSensors::Data kobuki::EventManager::last_state
private

Definition at line 139 of file event_manager.hpp.

◆ sig_bumper_event

ecl::Signal<const BumperEvent&> kobuki::EventManager::sig_bumper_event
private

Definition at line 144 of file event_manager.hpp.

◆ sig_button_event

ecl::Signal<const ButtonEvent&> kobuki::EventManager::sig_button_event
private

Definition at line 143 of file event_manager.hpp.

◆ sig_cliff_event

ecl::Signal<const CliffEvent&> kobuki::EventManager::sig_cliff_event
private

Definition at line 145 of file event_manager.hpp.

◆ sig_input_event

ecl::Signal<const InputEvent&> kobuki::EventManager::sig_input_event
private

Definition at line 148 of file event_manager.hpp.

◆ sig_power_event

ecl::Signal<const PowerEvent&> kobuki::EventManager::sig_power_event
private

Definition at line 147 of file event_manager.hpp.

◆ sig_robot_event

ecl::Signal<const RobotEvent&> kobuki::EventManager::sig_robot_event
private

Definition at line 149 of file event_manager.hpp.

◆ sig_wheel_event

ecl::Signal<const WheelEvent&> kobuki::EventManager::sig_wheel_event
private

Definition at line 146 of file event_manager.hpp.


The documentation for this class was generated from the following files:


kobuki_driver
Author(s): Daniel Stonier , Younghun Ju , Jorge Santos Simon
autogenerated on Wed Mar 2 2022 00:26:14