Utilities
helper scripts of the utilities folder.
Environment Helper
This helper module contains many static variables that are used and shared by all the nodes in the script section.
- utilities.patrol_robot.environment.Map_C = {'-1.0,2.0': 'C2', '-2.0,1.0': 'R3', '-2.0,3.0': 'R4', '0.0,0.0': 'E', '1.0,2.0': 'C1', '2.0,1.0': 'R1', '2.0,3.0': 'R2'}
ROS parameters for the environment size and time interval for the random battery notifier function in the battery.py script.
- utilities.patrol_robot.environment.RND_BATTERY_TIME = 'config/random_battery_time'
Declaration of ROS-Node names, ROS-Service names and ROS-Action names
Interface Helper
This Module implements specific methods necessary for many program funcionalities:
ROS service-clients
ROS action-clients
ROS messages Callbacks
Functions to return the FSM transition states
Other generic functions used in more than one script
- class utilities.patrol_robot.helper.InterfaceHelper[source]
Class representing the Helper Object comprehensive of every necessary methods summarized above.
- __init__(self)[source]
Initialization of parameters:
- mutex:Lock()
mutex to protected variable access
- client:ros_action_client
Armor-Client to set-up the Ontology
- planner_client:ros_action_client
the client of the motion/planner action
- controller_client:ros_action_client
the client of the motion/controller action
- sub_battery:ros_msg_subscriber
subscriber to the ros message regarding the battery state , topic: state/battery_low
- start_client(self)[source]
Simple client of the Empty service /start to load and initialize the Ontology
- reason_client(self)[source]
Simple client of the custom service /reason to decide which room should be pointed, the target room is saved in a variable to be further used in the Planning request.
- recharge_client(self)[source]
Simple client of the empty service /recharge to start the robot’s battery charging.
- _battery_cb(self, battery_value)[source]
Callback of the ros message that describes the battery states on the topic state/battery_low, the value is simply stored in a variable to be checked from the FSM.
- send_planner_goal(self, low)[source]
motion/planner Action Client, it sends the target location to the server in order to generate the correct set of via points, it takes into account the state of the battery in the argument (low) to force the robot the the DOC location whenever the battery is low and the robot can reach this desired location.
- send_controller_goal(self)[source]
motion/controller Action Client, it sends the planner via points to the Controller Node in order to move the robot toward a target location.
- is_battery_full(self)[source]
Method to return weather the transition that ends the recharging state should be returned
- is_battery_low(self)[source]
Method to return weather the transition that start the recharging state should be returned
- should_reasoning_start(self)[source]
Method to return weather the transition that start the reasoning state should be returned
- should_pointing_start(self)[source]
Method to return weather the transition that start the pointing state should be returned