Design and Implementation of a State Machine and GUI for the Megatron Robot System

Authors: Yaxun Yang, Fujing Xie, Bowen Xu
Emails: {yangyx12022, xiefj, xubw}@shanghaitech.edu.cn
Date: November 2023

Abstract

This project introduces a comprehensive solution for robot control and task coordination of the Megatron robot utilizing the FlexBe state machine within the ROS (Robot Operating System) framework. The primary focus is on enabling efficient management of essential robotic tasks of the Megatron robot such as Navigation, Pickup Panel, and Place Panel activities. A significant innovation of this project is the development of a user-centric Graphical User Interface (GUI), tailored to operators unfamiliar with the complexities of state machines. This GUI allows users to easily monitor and control the robot's status and operations, enhancing the interaction between human operators and robotic systems.

1. Introduction

The project involves the integration of FlexBE (Flexible Behavior Engine) [1] with ROS (Robot Operating System) to create an advanced robot control system, complemented by a user-friendly Graphical User Interface (GUI). FlexBE is a behavior engine for ROS that facilitates the creation of complex robot behaviors without the necessity of manually coding them. It employs state machines which can be easily composed via a drag-and-drop editor, providing an intuitive approach to defining robot behaviors. Once these behaviors are designed, FlexBE allows for their execution and real-time monitoring, offering a high degree of collaborative autonomy. This means the operator can influence the execution during runtime, such as forcing transitions, and the robot can request help or confirmation from the operator when needed.

Bolight Robot Work image widget. Press Enter to type after or press Shift + Enter to type before the widget

Figure 1: Bolight Robot Work Environment

The FlexBE behavior engine is a meta-package encompassing various packages that collectively enable the definition and running of robotic behaviors. This includes components like flexbe_core, flexbe_input, flexbe_mirror, and others, each serving specific roles in the behavior creation and execution process.

Complementing FlexBE, the project also integrates a user-friendly GUI developed through QT Creator [2]. The FlexBe GUI serves as an interface for both editing and runtime control of the FlexBE behavior engine. And the user GUI this project developed is tailored to users who may not be familiar with the intricacies of state machines, allowing them to monitor and control the robot's status and behavior in a more accessible manner. The GUI incorporates essential control features such as 'STOP', 'Pause/Unpause', and 'Confirm', facilitating user interaction and operational safety. Moreover, it supports different operational modes, like Semi-Autonomy and Full Autonomy, to cater to varying levels of robot autonomy and human intervention.

This combination of FlexBE's state machine capabilities with an user-friendly GUI interface aims to enhance the efficiency and usability of Megatron robot systems, making sophisticated robotic operations more accessible to a broader range of operators.

2. State of the Art

FlexBE represents the state of the art in robotic behavior engines due to its sophisticated features that enable the creation of complex robot behaviors without the need for manual coding. It offers a user-friendly interface through a drag-and-drop editor, allowing seamless composition of state machines based on the robot's capabilities and standard functionalities. One of the defining characteristics of FlexBE is its facilitation of collaborative autonomy, which means that human operators can influence the behavior execution in real-time, for instance, by manually triggering transitions or by the robot requesting operator confirmation for certain actions. This flexibility is especially beneficial in scenarios like rescue operations or remote manipulation tasks, where adaptability to unforeseen circumstances is crucial.

FlexBE's hierarchical state machine model ensures that states correspond to actionable behaviors and transitions are clearly defined in response to outcomes, setting it apart from other behavior engines. This approach allows for excellent operator integration and a comprehensive user interface. The system is designed to support both full autonomy and restricted manual intervention, empowering operators to modify the structure of behaviors dynamically during execution without the need for a restart.

Moreover, the FlexBE framework is developed to ensure non-blocking state execution, which is crucial for allowing remote operator interactions with the robot behavior during runtime, enhancing the flexibility and responsiveness of robotic systems.

For an understanding of how FlexBE compares with other state machines and behavior engines in terms of capabilities and applications, additional information can be found on the ROS Wiki page for FlexBE and the ROS Index page detailing FlexBE's functionality and usage. These resources provide insights into the benefits of using FlexBE over other state machines, as well as tutorials and examples of its application in various robotic systems.

3. System Description

3.1 FlexBe

The state machine depicted in the image outlines a robotic system's workflow for handling solar racks. Although the initial state is not explicitly visible, the flow includes a decision point that determines subsequent actions based on conditions or inputs. This leads to either automated navigation ("Waypoint Navigation Robot") or a series of interactions with solar racks, encompassing movements like driving to a location, picking up and placing solar racks on trucks or rods. This suggests a versatile, cyclic process in the robot's operations, governed by an internal state machine that handles detailed decision-making at each step.

FlexBE State Machine
Figure 2: FlexBE State Machine for the Megatron Robot
Navigation System
Figure 3: Navigation System Visualization

3.2 GUI

The GUI is designed for diverse levels of autonomy and manual control. It is structured into different sections for ease of use:

Control Buttons:

  • STOP: To halt all operations immediately.
  • Pause: Temporarily stops the robot.
  • Confirm: Confirms robot's actions or decisions.
  • Semi-Autonomy: Requires more operator input.
  • Next State: Advances the robot's task sequence in Semi-Autonomy mode.
  • Full Autonomy: Enables the robot to operate independently.

Operational Buttons:

  • Drive Joy: Joystick control for driving the robot.
  • Arm Joy: Controls the robot's arm.
  • Various Arm Movement Buttons: For specific tasks like "Arm home," "Arm truck pre," etc.

Status Panels:

  • FlexBE State: Shows the current state of the FlexBE state machine.
  • Robot Status: Displays wall time and other system information.
  • RViz Panel: Visualizes the robot's environment and data.

Record Functionality:

  • Record Bagfile: Records the robot's data streams for later analysis.
GUI Interface
Figure 4: User-friendly GUI Interface for Robot Control

4. Conclusions

This project successfully integrated FlexBE with ROS, enhancing the Megatron robot's control and coordination capabilities. The key achievement is the user-friendly GUI, which simplifies complex state machine operations for operators without in-depth technical knowledge. This GUI enhances real-time monitoring and interactive control, contributing to operational safety and flexibility.