How yogangsingh/gui-for-marus works
Core Components
• ROS Environment & Nodes: This includes the fundamental ROS setup (as noted by package.xml, launch files, and srv definitions). It hosts the control algorithms (like the PID controller for USV path following) and provides sensor and command data.
• gRPC Adapter: Found in the “grpc_ros_adapter” directory, this module contains the Python code for translating messages between ROS and Unity. It includes submodules for different services (ping service, parameter server, simulation control, visualization, etc.), message translators, and utilities that manage ROS callbacks and topic streaming.
• Graphical User Interface (GUI): Residing in the “gui” directory, this component (developed in C++ using Qt – evident from the .ui files and mainwindow files) displays real‑time USV metrics, enables waypoint selection, and acts as the user interaction layer.
• Unity Simulation: An external simulation component (referenced in the README and associated with the MARUSimulator ecosystem) where the Unity project consumes gRPC messages, translates them via Protobuf, and renders the dynamics of the USV.
• Configuration & Build Tools: Supplementary components include configuration files (config/server.yaml) and build systems (CMakeLists.txt, package.xml, setup.py) that integrate and manage both the ROS and GUI portions.
Relationships & Interactions
• The GUI sends commands (e.g. selected waypoints and mode changes) to the ROS system via the gRPC adapter.
• The gRPC adapter receives these requests, translates them into ROS messages (using Protobuf), and routes them to the appropriate ROS nodes or services (like the simulation control or sensor callbacks).
• The ROS nodes process these messages using onboard controllers (including the PID control) and publish USV telemetry such as location, heading, and other sensor data.
• Processed telemetry data is routed back through the gRPC adapter, converted to a protobuf message format, and transmitted to both the GUI and the Unity simulation, thereby ensuring real-time feedback.
• External setups (like the Unity scene and simulation configuration) connect to the gRPC server to maintain synchronization with the ROS system.
• The configuration file (server.yaml) holds necessary parameters for the gRPC server’s operation and might dictate communication ports/IP addresses.
Architectural Patterns & Technologies
• Service/Adapter Pattern: The gRPC adapter is a central bridge that decouples the ROS backend from the Unity-based simulation and GUI front-end.
• Client-Server Architecture: The ROS system runs as a “server” handling various services (exposed via gRPC) that are triggered by “clients” – notably the GUI and external Unity simulation.
• Integration of Diverse Stacks:
• ROS (specifically Noetic) for distributed control and communication.
• gRPC and Protobuf for efficient, structured message passing.
• Qt/C++ for the GUI interface.
• Unity (with the MARUSimulator ecosystem) for real-time simulation.
• CMake and Python-based build and configuration tools to integrate these components.