How ckyb63/ppe_gui_package works
Main Components
• GUI Frontend: Built using PyQt5 under the “gui_package/main_gui_modules” folder. This includes the main window, widget components (buttons, help dialogs, settings panels), and utility modules (e.g., logger, settings_handler).
• ROS2 Integration Layer: ROS2 nodes from “launch” files (e.g., main_ppe_gui.launch.py, dummy_nodes.launch.py) and scripts such as “ros_node.py” in main_gui_modules. This layer handles communication over topics like “ppe_status”, “pleaseDispense”, “ppeInventoryStatus”, etc.
• Hardware Control Modules: The “gui_package/gate” directory features the ESP32 Bluetooth communications and the safety_gate_controller that manages the physical safety gate.
• Avend API Connector: Located within “gui_package/avend” (avend_connector.py and logger.py), this module interacts with the AVend API for inventory management, dispensing requests, and logging.
• Simulation/Dummy Nodes: Found in “gui_package/dummy_test” (dummy_inventory_publisher.py and dummy_ppe_status.py) to simulate PPE detection and inventory changes.
Out Relationships and Interactions
• The PyQt5 GUI serves as the user interface where users interact (touchscreen-friendly design, settings, override commands).
• The GUI node, once launched, publishes or subscribes to various ROS2 topics (e.g., receiving live PPE status and inventory updates, sending dispense commands).
• Hardware events are managed via the safety_gate_controller and the ESP32 Bluetooth module. These modules communicate with the ROS2 backend, sending status updates (e.g., “gate” topic) that affect GUI behavior.
• The dummy nodes simulate real hardware and sensor data, allowing for testing and demonstration without needing the physical devices.
• The Avend connector integrates the external AVend API for retrieving or updating inventory and dispensing logs.
Architectural Patterns and Design Principals
• Separation of Concerns:
• The GUI is decoupled from the ROS2 backend, and hardware-specific logic is isolated in dedicated modules (gate, avend).
• Modularity:
• The file tree clearly separates simulation (dummy_test), actual hardware control (gate), and the main GUI modules. This modular design simplifies maintenance and future extensions.
• ROS2 Pub/Sub Model:
• The nodes interact via well-defined topics, ensuring that data flow (e.g., PPE status updates, dispense commands) is managed in a loosely coupled manner.