This is the multi-page printable view of this section. .
2026 RAICOM Reconnaissance
- 1: Overview
- 2: Usage
- 3: Hardware and drivers
- 4: Mapping
- 5: Localization
- 6: Navigation
- 7: Match tasks
- 8: Summary
- 9: Appendix
Vehicle ROS documentation for the RAICOM Intelligent Reconnaissance event. Source: RyanYhy/raicom2026.
Follow the sidebar or the list on this page: overview, usage, each module, summary, then the appendix.
Overview
Layered architecture, data flow, prep/go, and runtime state.
Usage
Environment, three workspaces, conda, build, and the two-stage start.
Hardware and drivers
Devices, udev, driver packages, EKF, and the TF tree.
Mapping
Match maps map2.yaml / map2.pbstream and the Cartographer toolchain.
Localization
Cartographer pure localization, AMCL, and the loc_mode switch.
Navigation
move_base, costmaps, the anti-tank point cloud, and the cmd_vel chain.
Match tasks
Person detection and shooting, mine counting, anti-tank avoidance, and the 6-line report.
Summary
Module dependencies, where to change things, and the main entry points.
Appendix
Unfinished features and a function-to-file index.
1 - Overview
Vehicle ROS software for the RAICOM Intelligent Reconnaissance event. Within five minutes the robot crosses zones A–D, recognizes people and fires water pellets, counts mines, detects anti-tank obstacles and avoids them, then writes a byte-exact 6-line report.txt.
- Platform: ROS Melodic · Ubuntu 18.04 · catkin workspace
1raicom_ws - Repository: raicom2026
What the system does
The match is three pipelines:
- Navigation — cruise the preset waypoints (
move_base+ Cartographer) - Perception — at a task waypoint, run vision (people / mines / anti-tank)
- Output — each task writes a partial report, then the parts merge into a 6-line
report.txt
Startup has two stages. prep brings up every sensor and model. After the referee starts the clock, go starts only the navigation orchestrator, so the robot can leave within seconds.

Layers
| Layer | Contents | Main location |
|---|---|---|
| M1 Hardware | Mecanum chassis, IMU, 2D lidar, gimbal gun, webcam, Orbbec | config/udev/ |
| M2 Drivers | Serial, lidar, and camera drivers, odometry | chassis_driver, imu_driver, leishen/, orbbec_camera |
| M3 Fusion | EKF: odom_raw + IMU → /odom | robot_localization |
| M4 Model | URDF and static TF | robot_description |
| M5 Localization and navigation | Map, Cartographer, move_base | raicom2026/launch/, robot_navigation/ |
| M6 Match tasks | Navigation orchestration, vision, report | raicom2026/scripts/ |
| M7 Operations | prep/go and calibration tools | scripts/, test/ |
Data flow

Sensors → fusion → localization → planning → chassis
- Lidar
/scan, IMU, andodom_rawpass through the EKF to produce/odom - Cartographer publishes
map → odom move_baseoutputs/move_base/cmd_vel→cmd_vel_merge→/cmd_vel→ chassis
Task triggers are services, not continuous topics. nav_competition.py calls /person_detect_service, /mine_detect_service, and /antitank_check_service.
Two cameras

| Camera | Mount | Model | Task |
|---|---|---|---|
| Gimbal webcam | Turns with the servos | person.onnx | Person detection and water-pellet shooting in zones A–D |
| Gimbal webcam | Same mount | mine.onnx | Mine counting in zones A/B |
| Orbbec DCW2 | Fixed on the nose | antitank.onnx | Anti-tank detection, then costmap avoidance |
prep / go

| Stage | Command | What it does |
|---|---|---|
| prep | start_match_prep.sh | Background main launch: sensors, models, localization, move_base |
| go | start_match_go.sh | Clear reports and start only nav_competition.py |
See Usage.
Runtime state
stateDiagram-v2
[*] --> BOOT
BOOT --> NAV: map ready + move_base
NAV --> TASK: task waypoint
TASK --> NAV: detection done
NAV --> REPORT: course done or budget spent
REPORT --> DONE: assemble report.txt
DONE --> [*]State topic: /nav_competition/state (for example NAV:P3, TASK:人物A).
Related pages
2 - Usage
The default workspace is ~/1raicom_ws (same layout as raicom2026).
Requirements
| Component | Notes |
|---|---|
| OS | Ubuntu 18.04 |
| ROS | Melodic |
| This repository | 1raicom_ws (catkin root) |
~/cartographer_ws | Cartographer localization (not in this repository) |
~/cv_bridge_ws | Python 3 cv_bridge for the YOLO node |
Conda yolov8 | ONNX inference |

One environment entry
In every new terminal:
setup_env.sh overlays ROS, then cartographer, then 1raicom_ws, then cv_bridge, and forces 1raicom_ws to the front of ROS_PACKAGE_PATH.
Build
If it fails, run catkin_make once more.
Devices and udev
Rules live in config/udev/:
| Device | Node |
|---|---|
| Chassis | /dev/carserial |
| IMU | /dev/imu |
| Lidar | /dev/lslidar |
| Gimbal gun | /dev/gun |
| Webcam | /dev/video* |
| Orbbec | USB 2bc5 |
Match start (two stages)

prep
- Background
nav_competition_2026.launch(start_nav:=false,loc_mode:=cartographer) - The script exits after
person_detect_serviceis ready. The prep process keeps running. - Log:
/tmp/prep.log
go
- Clears
src/raicom2026/data/reports/ - Starts only
match_go.launch→nav_competition.py
Clean up
Maps and models
| Asset | Path |
|---|---|
| Match map | src/raicom2026/data/maps/map2.yaml |
| pbstream | src/raicom2026/data/maps/map2.pbstream |
| ONNX | data/models/person.onnx, mine.onnx, antitank.onnx |
| Waypoints | param/nav_competition.yaml |
| Report | data/reports/report.txt |
Read these first after clone
| File | Role |
|---|---|
scripts/setup_env.sh | Environment |
scripts/start_match_*.sh | Match entry points |
launch/nav_competition_2026.launch | Main launch |
param/nav_competition.yaml | Waypoint course |
scripts/nav_competition.py | Navigation orchestrator |
Sync the PC and the robot
- Edit on the PC, then
git push - PC → robot:
scpsrc/,scripts/, andconfig/ - On the robot,
catkin_makeandsource setup_env.sh
The robot usually cannot reach GitHub. Do not git push from the robot.
3 - Hardware and drivers
Hardware
| Device | Role | udev node |
|---|---|---|
| Mecanum chassis | Omnidirectional motion | /dev/carserial |
| Wit IMU | Attitude and angular rate | /dev/imu |
| Leishen N10_P | 2D lidar | /dev/lslidar |
| Gimbal and water-pellet gun | Aim and fire | /dev/gun |
| USB camera | People and mines (on the gimbal) | /dev/video* |
| Orbbec DCW2 | Anti-tank RGB and depth | USB 2bc5 |

Driver packages
| ROS package | Node | Output |
|---|---|---|
chassis_driver | base_controller.py | Serial chassis |
imu_driver | wit_multi_ros.py | /imu |
leishen/lslidar_driver | Lidar node | /scan |
car_bringup | base_node | odom_raw |
orbbec_camera | SDK driver | /camera/color/*, /camera/depth/* |
robot_bringup | bringup_robot.launch | Brings up the rows above, plus EKF and URDF |
Bringup chain
The main launch pulls this in with <include>.
EKF
| Item | Notes |
|---|---|
| Node | robot_localization / ekf_localization_node |
| Input | odom_raw + /imu |
| Output | /odom |
Parameters: robot_localization.yaml
URDF and TF
The webcam sits on the gimbal and has no TF frame of its own. Detection uses the servo angles.
Gimbal serial port
/dev/gun can be opened by only one process. gimbal_server.py owns it.
4 - Mapping
Match maps
| File | Role |
|---|---|
data/maps/map2.yaml | Occupancy grid for map_server |
data/maps/map2.pbstream | Cartographer pure localization |
Both files must come from the same mapping run. After replacing the map, remeasure the waypoints (nav_competition.yaml).
Toolchain
The mapper itself is the external workspace ~/cartographer_ws. This repository provides:
| Location | Contents |
|---|---|
config/cartographer/ | Lua configuration |
scripts/save_map.sh | Save yaml and pgm |
scripts/save_pbstream.sh | Save pbstream |
test/launch/cartographer_localization.launch | Debug pure localization |
Mapping steps
flowchart LR
A[robot laser+odom] --> B[cartographer_ros]
B --> C[map2.pbstream]
B --> D[map2.yaml]
D --> E[map_server]
C --> F[pure localization]- Map the field online with Cartographer
- Save pbstream and yaml
- Copy them into
raicom2026/data/maps/ - Mark waypoints with
mark_waypoint*.py
How the match launch uses the map
nav_competition_2026.launch defaults to:
map→map2.yamlpbstream→map2.pbstream- With
loc_mode:=cartographer,cartographer_nodeloads the pbstream
5 - Localization
nav_competition_2026.launch switches mode with loc_mode:
| Mode | Argument | Notes |
|---|---|---|
| Cartographer | loc_mode:=cartographer (match default) | Loads map2.pbstream |
| AMCL | loc_mode:=amcl | Particle filter on the static map |

prep always uses:
Cartographer helper nodes
| Node | Role |
|---|---|
odom_cleaner.py | Clean timestamps on /odom |
carto_init.py | Inject the starting pose |
carto_relocalize.py | Manual relocalization from RViz 2D Pose Estimate |
Configuration: config/cartographer/localization.lua
Handoff to nav_competition
When nav_competition.py starts it:
- Waits for
/map - Connects to
move_base - Publishes the initial pose
- Waits about 3 seconds for convergence
- Cruises the
course
In Cartographer mode, anti-tank detection also uses /tracked_pose to convert into the map frame.
6 - Navigation
Core pieces
| Piece | Role |
|---|---|
map_server | Publishes /map |
move_base | Global planner plus DWA local planner |
robot_navigation/param/ | Costmap and DWA parameters |
visual_layer_params.yaml | Local costmap subscribes to /visual_mine/obstacles |
The main launch owns move_base (clear_params=true) and loads the visual-layer parameters last.
Costmaps
| Layer | observation_sources | Notes |
|---|---|---|
| global | empty (static map only) | Avoid marking obstacles from localization drift |
| local | scan + visual_mine | Lidar plus the anti-tank cloud |
orbbec_mine_antitank.py publishes the anti-tank cloud once at P21 (map frame, republished every 0.5 s).
visual_mine_avoidance.py does start during prep, but enable_at=false, so it does not publish the match cloud.
cmd_vel chain

cmd_vel_merge.py currently has enable_line_follow=false and only forwards velocity.
nav and move_base
- Waypoints:
nav_competition.yaml - Goals go out through actionlib as
MoveBaseGoal. A failed stop is skipped and the report is filled with 0. - At a task stop the robot aligns its heading before vision runs.
7 - Match tasks
Most of this code is in the raicom2026 package. Repository

Orchestrator nav_competition
| Item | Notes |
|---|---|
| Config | nav_competition.yaml |
| go launch | match_go.launch |
| Task types | person (A–D), mine (A/B), antitank |
| Service | Node |
|---|---|
/person_detect_service | webcam_person_gun.py |
/mine_detect_service | orbbec_mine_antitank.py |
/antitank_check_service | orbbec_mine_antitank.py |
Gimbal service gimbal_server
- Exclusive owner of
/dev/gun /gun/aim,/gun/fire,/gun/home- People and mines share the gimbal
People and shooting
| Item | Notes |
|---|---|
| Camera | /usb_cam/image_raw (848×480 MJPG) |
| Model | person.onnx |
| Flow | Scan and count → exact report string → aim and fire at the enemy |
Shooting and recognition live in the same node. The node does not write the serial port itself.
Mines
The mine half of orbbec_mine_antitank.py:
| Item | Notes |
|---|---|
| Camera | Gimbal webcam |
| Gimbal | A (70,70), B (175,70) |
| Model | mine.onnx |
| Report | "A雷区未排雷数量x个,已经排雷数量x个" (ASCII comma) |
Anti-tank avoidance
The antitank half of the same script, plus move_base:
| Item | Notes |
|---|---|
| Camera | Orbbec color and depth |
| Trigger | P21 /antitank_check_service |
| Output | /visual_mine/obstacles → local costmap |
Report
report.py and assemble_report.py produce a report.txt of exactly 6 lines.

8 - Summary
Dependencies
flowchart TB
subgraph HW [hardware and drivers]
BR[robot_bringup]
end
subgraph LOC [localization]
CARTO[cartographer]
MAP[map_server]
end
subgraph NAV [navigation]
MB[move_base]
end
subgraph TASK [match tasks]
NAVCOMP[nav_competition]
PERSON[webcam_person_gun]
MINEAT[orbbec_mine_antitank]
end
BR --> CARTO
MAP --> MB
CARTO --> MB
NAVCOMP --> MB
NAVCOMP --> PERSON
NAVCOMP --> MINEAT
MINEAT --> MBWhere to change things
| Goal | Change |
|---|---|
| Waypoints or timeouts | Only nav_competition.yaml |
| Recognition | The matching scripts/*.py plus data/models/*.onnx |
| Navigation | robot_navigation/param/ and the launch files |
| A new feature | Prefer the raicom2026 package |
This site organizes the notes with Oink. Code changes belong in the GitHub repository. The file index is in the appendix.
Entry points
| Use | Path |
|---|---|
| Environment | scripts/setup_env.sh |
| prep/go | scripts/start_match_*.sh |
| Main launch | launch/nav_competition_2026.launch |
9 - Appendix
Unfinished features
Yellow-line following
| Piece | State |
|---|---|
visual_mine_avoidance.py | Starts in prep and publishes /visual_line/* |
cmd_vel_merge.py | enable_line_follow=false |
| Match effect | None. Velocity is only forwarded. |
visual_mine_avoidance
| Capability | State |
|---|---|
| Always-on anti-tank inference | enable_at=false |
| Match point cloud | Published by orbbec_mine_antitank |
| bench | roslaunch raicom2026 visual_mine_avoidance.launch |
Function to file
| To change or inspect | Path (from the repository root) |
|---|---|
| Waypoints and timeouts | src/raicom2026/param/nav_competition.yaml |
| Navigation orchestrator | src/raicom2026/scripts/nav_competition.py |
| People and shooting | src/raicom2026/scripts/webcam_person_gun.py |
| Mines and anti-tank | src/raicom2026/scripts/orbbec_mine_antitank.py |
| Gimbal | src/raicom2026/scripts/gimbal_server.py |
| Report | src/raicom2026/src/raicom2026/report.py |
| Main launch | src/raicom2026/launch/nav_competition_2026.launch |
| move_base parameters | src/robot_navigation/param/ |
| Maps | src/raicom2026/data/maps/map2.* |
| prep/go | scripts/start_match_*.sh |
The full tree is in the GitHub repository.
Topics and services
| Name | Notes |
|---|---|
/cmd_vel | To the chassis |
/usb_cam/image_raw | Gimbal camera |
/camera/color/image_raw | Orbbec |
/visual_mine/obstacles | Anti-tank cloud |
/person_detect_service | Person task |
/mine_detect_service | Mine task |
/antitank_check_service | Anti-tank |