How robocup-ssl-china/rocos works
Main Components
• Client Module:
– Contains GUI elements (Qt/QML files), resource files, and simulation plugins.
• Controller Module:
– Provides interfaces for user input and remote control via gamepads or other devices.
– This module uses QML for control widgets and integrates libraries to process serial and radio communication.
• Core Module:
– Acts as the computational heart of the framework.
– It is divided into many subcomponents including:
▪ Algorithm (ball/robot tracking, collision checking)
▪ MotionControl (dynamics, control models, equations solvers)
▪ PathPlan (trajectory planning and obstacle avoidance)
▪ Vision (vision processing, ball and robot prediction, collision simulation)
▪ WorldModel (maintaining game state, referee information, and robot capabilities)
▪ Simulator and RefereeBox for interfacing with external simulation and referee systems
▪ LuaModule for extensibility and scripting skills.
• Shared/Support Libraries:
– The “share” directory and “cmake” modules include communication protocols (protobuf definitions) and geometric utilities.
– These components are key for integrating various modules and ensuring smooth data flow.
• ZBin and Related Scripts:
– This houses logs, binaries, test scripts, parameters, and additional utilities for running, debugging, and tweaking the overall system.
• External Integrations:
– Integration with continuous integration workflows (.github sub-folders), Sphinx/doc configuration, and third-party libraries (found in “OtherLibs” and “tactics”) are evidence of the system’s integrated development workflow and simulation of game tactics.
Relationships and Interactions
• The Client (frontend) displays simulation data, sends user commands to the Core, and receives visualization output from core processing modules.
• The Controller gathers and converts real-time user inputs (from a gamepad or other controllers) and passes those inputs to the Core – via defined communication protocols (potentially over serial or network interfaces).
• The Core module processes inputs from both the Client and Controller:
– The Algorithm subcomponent computes real-time ball and robot states.
– MotionControl and PathPlan generate movement trajectories and commands which are then possibly fed to the wireless module to control actual robots.
– Vision captures visual data, runs prediction and tracking, and then updates the world model.
– The RefereeBox and Simulator modules ensure that decisions conform to game rules and simulate tactical strategies.
• Shared libraries ensure consistency in data formats (e.g., protobuf-based messages) across all these modules.
Architectural Patterns and Technologies
• Layered/MVC Approach:
– The separation of GUI (Client), control input (Controller), and business logic (Core) suggests a separation akin to Model-View-Controller, where the Core acts as the Model, the Client serves as the View, and the Controller module provides the input mechanism.
• Plug-in Architecture:
– The “Client/plugins” directory (and even within Core’s Lua modules) shows that functionality can be extended or changed by swapping modules (e.g., different physics objects and tactics).
• Use of CMake:
– Centralized build configuration via CMakeLists.txt files across many directories suggests a modular build that compiles these individual components and integrates them.
• Scripting Integration:
– Lua scripting files under Core/tactics and in ZBin/lua_scripts indicate that many high-level decisions and behaviors are configured through script files, making the system adaptable.
• Communication Protocols:
– Data/instruction flow from Controller and Client to Core.
– Feedback flow (e.g., simulation results, log updates, display data) from Core back to Client.
– Inter-component dependencies such as offline analysis, Lua scripting interactions, and shared utilities.
• Annotations to call out key architectural design patterns (e.g., plugin extensibility in Lua modules, modular build with CMake, communication via Protocol Buffers).