How hkwns6otyn/burger_war works
Project Overview & Context
• This project is a robotics game where robots (turtlebot3 based “burger” robots) compete by “reading” AR markers rather than firing actual weapons. It supports both real-world deployments (実機) and Gazebo simulation.
• There are separate ROS packages for robot navigation and battle (burger_navigation and burger_war) as well as a dedicated server for managing scores and game state (the judge folder).
Key Components
a. Core ROS Packages:
• burger_war: Contains launch files, simulation scripts, models (URDF/xacro and Gazebo SDF), world definitions, and ROS nodes (Python scripts and some C++ code) that control the robots.
• burger_navigation: Provides navigation stack functionality including different planning parameters, costmap configuration, and rviz configurations.
b. Simulator & Environment:
• Gazebo world files in burger_war/world and associated model definitions (inside burger_war/models) that configure the virtual battlefield (burger_field).
• Launch files to start the simulation (setup_sim.launch) and robot run (sim_robot_run.launch).
c. Judge Server:
• Located under the judge directory, it is responsible for handling game rules, state logging, and providing a visual interface to monitor the game.
• It includes the main judgeServer.py, test scripts, marker set configurations, and client-side web templates/static files to show results.
d. Supporting Launch & Script Components:
• Top-level launch files (e.g., your_burger.launch, setup.launch) that initialize ROS nodes, configure namespaces, and control simulation/real robot startup.
• Python scripts under burger_war/scripts serving different roles (e.g., teleoperation, sensor handling, AR marker reading, state publishing).
Relationships and Data Flow
• The robot system (either simulation or actual) communicates with:
• Navigation nodes (for local/global planning) provided by burger_navigation
• Robot control nodes (e.g., teleop, enemy, and dedicated battle scripts)
• Hardware drivers (camera sensors, potentially LIDAR, etc.)
• The Judge Server subsystem (in the judge folder):
• Connects to the robots via ROS topics (publishing state messages such as war_state.msg and CvRect.msg).
• May use HTTP (Flask) to serve a visual interface and handle game management.
• Data flows include:
• Sensor data (from cameras for AR marker detection) flowing from the robot to processing nodes.
• Navigation commands and telemetry between robot control nodes in their dedicated namespaces.
• Higher-level game state updates between the robots and the judge server.
1. ROS Master: Central to the entire system.
2. Robot Subsystem (burger_war):
• Node Group for robot initialization (launch files for real and simulated robots).
• Navigation module (burger_navigation) that includes costmap configurations and planning parameters.
• Simulation Environment: Gazebo world environment along with defined models.
3. Judge Server:
• JudgeServer node (Python script) managing the game rules and state.
• Supporting components for logging, marker configuration, and visualization (e.g., visualizing window and web templates).
4. External Integration and Startup Scripts:
• Startup and one-click execution scripts (in scripts/ and judge/test_scripts) that tie together launching of robots, simulation, and the judge server.
• Interactions:
• Data flows (topics, parameters, service calls) between robot nodes and the judge server should be shown.
• How namespace separation for the two competing robots (red_bot and blue_bot) affects topic/message routing.
Architectural Patterns and Technologies
• That the project leverages ROS’s node and topic architecture to create a loosely coupled system where simulation nodes, navigation, sensor processing, and game adjudication are all independent yet interconnected.
• Usage of:
• ROS launch files to parameterize the robot’s behavior (via arguments such as side and robot_name).
• Standard ROS message types (war_state.msg, CvRect.msg) for inter-node communication.
• Gazebo simulation for the virtual environment.
• The separation between simulation (burger_navigation, gazebo launch files) and game logic (burger_war scripts and judge server).