Source:

Report:


Introduction

The event scheduler module provides functionality pertaining to publishing scheduled events for the Cyborg. The module is also responsible for detecting and publishing other system events like when the Cyborg battery is starting to run low. The scheduler function previously found in module cyborg_ navigation is isolated and moved to this module. A context diagram for the module is seen in Figure 8.1 (AB = Areg Babayan's masters thesis 2019)

Design

The event scheduler is designed as a single ROS node, all communication with other modules is through ROS protocols. The node subscribes to state data published by the state machine, location data published by the navigation module, and battery status published by the ros_arnl node. If a scheduled event at another location than the current one is found, the rest of the Cyborg state machine is notified, if the battery gets below a set limit while the Cyborg is not already charging or on its way to the charger, a corresponding event is published. The scheduler itself is almost identical to the function previously found in the navigation module, with some slight modifications done in order to make it fit the overall system structure. A class diagram, with corresponding ROS protocols is presented in Figure 8.2 (AB).

Implementation

The event scheduler is implemented as a single ROS node, containing the scheduler function previously mentioned, and in addition callbacks for the topics it subscribes to:

FunctionDescription
schedulerChecks for ongoing events, by searching through the database of events provided in the navigation module. If an event at another location than the current one is found, a navigationscheduler_ event is published on the event topic of the controller module.
callback_current_locationCallback for the location subscriber, updates the current location of the module.
callback_subscriber_stateCallback for the state subscriber, updates the module with the current state.
callback_battery_statusCallback for the battery status subscriber. If the battery percentage is below a set value while the Cyborg is not already charging og moving to the dock, a powerlow_ event is published on the event topic of the controller module.
  • No labels