How utra-robosoccer/soccerbot works
Project type and purpose
• This is a full-stack robotics application built on ROS2.
• Purpose: from low-level firmware on an STM32 microcontroller, through sensor/actuator interface, perception, strategy, and control, all the way to simulation (Webots/Gazebo) and real-robot execution.
Main architectural components
a. Hardware layer
• STM32 microcontroller running the soccer_firmware
• Motors, IMU, encoders, USB device layer
b. Firmware interface
• soccer_firmware_interface ROS2 node (publishes raw sensors, subscribes motor commands)
c. Common libraries
• soccer_common (config, transformations, PID, helpers)
• soccer_msgs (custom ROS messages)
d. Game Controller Interface
• game_controller_interface nodes (gc_client, gamestate)
• Publishes /game_state, /robot_state topics
e. Perception layer
• soccer_object_detection (YOLO‐based detection, camera drivers)
• soccer_object_localization (field/object position estimation)
• soccer_localization (field line UKF)
f. Strategy layer
• soccer_strategy (behavior state machine, team communication, autopilot_context_ros)
• Subscribes perception & game_state, publishes high-level trajectory commands
g. Trajectory & Control layer
• soccer_trajectories (predefined CSV trajectories, managers, ROS interface)
• soccer_pycontrol (inverse kinematics, model, walk_engine, pybullet simulation)
• Publishes low-level joint commands
h. Simulation & Visualization
• soccer_description + soccer_webots (URDF, meshes, Webots bridge)
• Launchable Webots / Gazebo environments
• Rviz, Foxglove bridge
i. Orchestration & Tools
• launch files in soccerbot/launch/modules (sensors, control, strategy, gui, localization, webots)
• Docker Compose (compose.yaml + tools/docker/*)
• CI workflows, pre-commit, readthedocs
Interactions and data flows
• Hardware → firmware → soccer_firmware_interface → ROS topics
• Game controller → game_controller_interface → /game_state
• Camera → soccer_object_detection → /detections → soccer_object_localization → /objects, field lines → soccer_localization → /pose
• /pose & /game_state + team messages → soccer_strategy → /trajectory_command
• /trajectory_command + /common/config → soccer_trajectories → joint trajectories → soccer_pycontrol → low-level joint commands → soccer_firmware_interface
• Simulation components subscribe/publish same topics—replace physical hardware & firmware interface
Architectural patterns & principles
• Layered ROS-package decomposition
• Pub/Sub (topic) communication, clearly separate concerns
• Reusable libraries (soccer_common, soccer_msgs)
• Simulation parity: real hardware ↔ Webots/Gazebo swap
• Dockerized microservices approach