Skip to content

This is the multi-page printable view of this section. .

Return to the regular view of this page.

Projects

Projects I have participated in or studied in depth—practice and exploration.

Projects I have participated in or studied in depth. Open a project to browse its documentation. The two competition projects below are available in English.

1 - 2026 RAICOM Reconnaissance

ROS software architecture, operating guide, and module notes for the vehicle. Read alongside the raicom2026 GitHub repository.

Vehicle ROS documentation for the RAICOM Intelligent Reconnaissance event. Source: RyanYhy/raicom2026.

Reading order

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.

→ Read the overview

Usage

Environment, three workspaces, conda, build, and the two-stage start.

→ Read the usage guide

Hardware and drivers

Devices, udev, driver packages, EKF, and the TF tree.

→ Read hardware and drivers

Mapping

Match maps map2.yaml / map2.pbstream and the Cartographer toolchain.

→ Read mapping

Localization

Cartographer pure localization, AMCL, and the loc_mode switch.

→ Read localization

Navigation

move_base, costmaps, the anti-tank point cloud, and the cmd_vel chain.

→ Read navigation

Match tasks

Person detection and shooting, mine counting, anti-tank avoidance, and the 6-line report.

→ Read match tasks

Summary

Module dependencies, where to change things, and the main entry points.

→ Read the summary

Appendix

Unfinished features and a function-to-file index.

→ Read the appendix

1.1 - Overview

RAICOM 2026 Intelligent Reconnaissance — mission, layers, data flow, and runtime state.

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:

  1. Navigation — cruise the preset waypoints (move_base + Cartographer)
  2. Perception — at a task waypoint, run vision (people / mines / anti-tank)
  3. 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.

Seven layers
Layers from hardware up to the match tasks

Layers

LayerContentsMain location
M1 HardwareMecanum chassis, IMU, 2D lidar, gimbal gun, webcam, Orbbecconfig/udev/
M2 DriversSerial, lidar, and camera drivers, odometrychassis_driver, imu_driver, leishen/, orbbec_camera
M3 FusionEKF: odom_raw + IMU → /odomrobot_localization
M4 ModelURDF and static TFrobot_description
M5 Localization and navigationMap, Cartographer, move_baseraicom2026/launch/, robot_navigation/
M6 Match tasksNavigation orchestration, vision, reportraicom2026/scripts/
M7 Operationsprep/go and calibration toolsscripts/, test/

Data flow

Data flow
Sensors to fusion, localization, planning, and the chassis. Navigation calls vision through services.

Sensors → fusion → localization → planning → chassis

  • Lidar /scan, IMU, and odom_raw pass through the EKF to produce /odom
  • Cartographer publishes map → odom
  • move_base outputs /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

Two cameras
CameraMountModelTask
Gimbal webcamTurns with the servosperson.onnxPerson detection and water-pellet shooting in zones A–D
Gimbal webcamSame mountmine.onnxMine counting in zones A/B
Orbbec DCW2Fixed on the noseantitank.onnxAnti-tank detection, then costmap avoidance

prep / go

prep and go
StageCommandWhat it does
prepstart_match_prep.shBackground main launch: sensors, models, localization, move_base
gostart_match_go.shClear 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).

1.2 - Usage

Environment, build, udev, the prep/go start sequence, and syncing the PC with the robot.

The default workspace is ~/1raicom_ws (same layout as raicom2026).

Requirements

ComponentNotes
OSUbuntu 18.04
ROSMelodic
This repository1raicom_ws (catkin root)
~/cartographer_wsCartographer localization (not in this repository)
~/cv_bridge_wsPython 3 cv_bridge for the YOLO node
Conda yolov8ONNX inference
Environment overlay
Overlay order in setup_env.sh

One environment entry

In every new terminal:

source ~/1raicom_ws/scripts/setup_env.sh

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

cd ~/1raicom_ws
source /opt/ros/melodic/setup.bash
catkin_make
First parallel build of lslidar

If it fails, run catkin_make once more.

Devices and udev

Rules live in config/udev/:

DeviceNode
Chassis/dev/carserial
IMU/dev/imu
Lidar/dev/lslidar
Gimbal gun/dev/gun
Webcam/dev/video*
OrbbecUSB 2bc5
bash ~/1raicom_ws/scripts/check_devices.sh

Match start (two stages)

prep and go

prep

source ~/1raicom_ws/scripts/setup_env.sh
bash ~/1raicom_ws/scripts/start_match_prep.sh
  • Background nav_competition_2026.launch (start_nav:=false, loc_mode:=cartographer)
  • The script exits after person_detect_service is ready. The prep process keeps running.
  • Log: /tmp/prep.log

go

bash ~/1raicom_ws/scripts/start_match_go.sh
  • Clears src/raicom2026/data/reports/
  • Starts only match_go.launch → nav_competition.py

Clean up

bash ~/1raicom_ws/scripts/clean_ros.sh

Maps and models

AssetPath
Match mapsrc/raicom2026/data/maps/map2.yaml
pbstreamsrc/raicom2026/data/maps/map2.pbstream
ONNXdata/models/person.onnx, mine.onnx, antitank.onnx
Waypointsparam/nav_competition.yaml
Reportdata/reports/report.txt

Read these first after clone

FileRole
scripts/setup_env.shEnvironment
scripts/start_match_*.shMatch entry points
launch/nav_competition_2026.launchMain launch
param/nav_competition.yamlWaypoint course
scripts/nav_competition.pyNavigation orchestrator

Sync the PC and the robot

  1. Edit on the PC, then git push
  2. PC → robot: scp src/, scripts/, and config/
  3. On the robot, catkin_make and source setup_env.sh
Note

The robot usually cannot reach GitHub. Do not git push from the robot.

1.3 - Hardware and drivers

On-robot devices, udev, driver packages, EKF fusion, and the TF tree.

Hardware

DeviceRoleudev node
Mecanum chassisOmnidirectional motion/dev/carserial
Wit IMUAttitude and angular rate/dev/imu
Leishen N10_P2D lidar/dev/lslidar
Gimbal and water-pellet gunAim and fire/dev/gun
USB cameraPeople and mines (on the gimbal)/dev/video*
Orbbec DCW2Anti-tank RGB and depthUSB 2bc5
Hardware and drivers

Driver packages

ROS packageNodeOutput
chassis_driverbase_controller.pySerial chassis
imu_driverwit_multi_ros.py/imu
leishen/lslidar_driverLidar node/scan
car_bringupbase_nodeodom_raw
orbbec_cameraSDK driver/camera/color/*, /camera/depth/*
robot_bringupbringup_robot.launchBrings up the rows above, plus EKF and URDF

Bringup chain

bringup_robot.launch:

lslidar → imu → base_controller → odom_raw → EKF → /odom
       → static TF → robot_state_publisher

The main launch pulls this in with <include>.

EKF

ItemNotes
Noderobot_localization / ekf_localization_node
Inputodom_raw + /imu
Output/odom

Parameters: robot_localization.yaml

URDF and TF

map → odom → base_footprint → base_link → laser_link
                           → camera_link → camera_color_optical_frame

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.

1.4 - Mapping

Match maps map2.yaml / map2.pbstream and the Cartographer mapping toolchain.

Match maps

FileRole
data/maps/map2.yamlOccupancy grid for map_server
data/maps/map2.pbstreamCartographer 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:

LocationContents
config/cartographer/Lua configuration
scripts/save_map.shSave yaml and pgm
scripts/save_pbstream.shSave pbstream
test/launch/cartographer_localization.launchDebug 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]
  1. Map the field online with Cartographer
  2. Save pbstream and yaml
  3. Copy them into raicom2026/data/maps/
  4. Mark waypoints with mark_waypoint*.py

How the match launch uses the map

nav_competition_2026.launch defaults to:

  • map → map2.yaml
  • pbstream → map2.pbstream
  • With loc_mode:=cartographer, cartographer_node loads the pbstream

1.5 - Localization

AMCL and Cartographer pure localization, helper nodes, and the handoff to navigation.

nav_competition_2026.launch switches mode with loc_mode:

ModeArgumentNotes
Cartographerloc_mode:=cartographer (match default)Loads map2.pbstream
AMCLloc_mode:=amclParticle filter on the static map
Localization modes

prep always uses:

roslaunch raicom2026 nav_competition_2026.launch start_nav:=false loc_mode:=cartographer

Cartographer helper nodes

NodeRole
odom_cleaner.pyClean timestamps on /odom
carto_init.pyInject the starting pose
carto_relocalize.pyManual relocalization from RViz 2D Pose Estimate

Configuration: config/cartographer/localization.lua

Handoff to nav_competition

When nav_competition.py starts it:

  1. Waits for /map
  2. Connects to move_base
  3. Publishes the initial pose
  4. Waits about 3 seconds for convergence
  5. Cruises the course

In Cartographer mode, anti-tank detection also uses /tracked_pose to convert into the map frame.

1.6 - Navigation

move_base, costmaps, the anti-tank point cloud, and the cmd_vel chain.

Core pieces

PieceRole
map_serverPublishes /map
move_baseGlobal planner plus DWA local planner
robot_navigation/param/Costmap and DWA parameters
visual_layer_params.yamlLocal costmap subscribes to /visual_mine/obstacles

The main launch owns move_base (clear_params=true) and loads the visual-layer parameters last.

Costmaps

Layerobservation_sourcesNotes
globalempty (static map only)Avoid marking obstacles from localization drift
localscan + visual_mineLidar plus the anti-tank cloud

orbbec_mine_antitank.py publishes the anti-tank cloud once at P21 (map frame, republished every 0.5 s).

Note

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 chain
move_base → /move_base/cmd_vel → cmd_vel_merge → /cmd_vel → base_controller

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.

1.7 - Match tasks

Orchestrator, person, mine, and anti-tank detection, the gimbal service, and the 6-line report.

Most of this code is in the raicom2026 package. Repository

Task service flow

Orchestrator nav_competition

ItemNotes
Confignav_competition.yaml
go launchmatch_go.launch
Task typesperson (A–D), mine (A/B), antitank
ServiceNode
/person_detect_servicewebcam_person_gun.py
/mine_detect_serviceorbbec_mine_antitank.py
/antitank_check_serviceorbbec_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

webcam_person_gun.py

ItemNotes
Camera/usb_cam/image_raw (848×480 MJPG)
Modelperson.onnx
FlowScan 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:

ItemNotes
CameraGimbal webcam
GimbalA (70,70), B (175,70)
Modelmine.onnx
Report"A雷区未排雷数量x个,已经排雷数量x个" (ASCII comma)

Anti-tank avoidance

The antitank half of the same script, plus move_base:

ItemNotes
CameraOrbbec color and depth
TriggerP21 /antitank_check_service
Output/visual_mine/obstacles → local costmap

Report

report.py and assemble_report.py produce a report.txt of exactly 6 lines.

Two cameras

1.8 - Summary

Module dependencies, where to change the stack, and the main entry points.

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 --> MB

Where to change things

GoalChange
Waypoints or timeoutsOnly nav_competition.yaml
RecognitionThe matching scripts/*.py plus data/models/*.onnx
Navigationrobot_navigation/param/ and the launch files
A new featurePrefer the raicom2026 package
Site and repository

This site organizes the notes with Oink. Code changes belong in the GitHub repository. The file index is in the appendix.

Entry points

UsePath
Environmentscripts/setup_env.sh
prep/goscripts/start_match_*.sh
Main launchlaunch/nav_competition_2026.launch

1.9 - Appendix

Unfinished features and a function-to-file index.

Unfinished features

Yellow-line following

PieceState
visual_mine_avoidance.pyStarts in prep and publishes /visual_line/*
cmd_vel_merge.pyenable_line_follow=false
Match effectNone. Velocity is only forwarded.

visual_mine_avoidance

CapabilityState
Always-on anti-tank inferenceenable_at=false
Match point cloudPublished by orbbec_mine_antitank
benchroslaunch raicom2026 visual_mine_avoidance.launch

Function to file

To change or inspectPath (from the repository root)
Waypoints and timeoutssrc/raicom2026/param/nav_competition.yaml
Navigation orchestratorsrc/raicom2026/scripts/nav_competition.py
People and shootingsrc/raicom2026/scripts/webcam_person_gun.py
Mines and anti-tanksrc/raicom2026/scripts/orbbec_mine_antitank.py
Gimbalsrc/raicom2026/scripts/gimbal_server.py
Reportsrc/raicom2026/src/raicom2026/report.py
Main launchsrc/raicom2026/launch/nav_competition_2026.launch
move_base parameterssrc/robot_navigation/param/
Mapssrc/raicom2026/data/maps/map2.*
prep/goscripts/start_match_*.sh

The full tree is in the GitHub repository.

Topics and services

NameNotes
/cmd_velTo the chassis
/usb_cam/image_rawGimbal camera
/camera/color/image_rawOrbbec
/visual_mine/obstaclesAnti-tank cloud
/person_detect_servicePerson task
/mine_detect_serviceMine task
/antitank_check_serviceAnti-tank

2 - 2025 Smart Community

ROS navigation, multi-task vision, and match orchestration across three packages.

Vehicle ROS documentation for the Smart Community event of the Global AI Algorithm Elite Competition. National second prize, 2025. The code is three packages: community_nav, community_vision, and community_mission.

Reading order

Follow the sidebar or the list on this page: overview, usage, each module, summary, then the appendix.

Overview

What the robot does, how the three packages split the work, and how data moves.

→ Read the overview

Usage

Environment, dependencies, build, and the three terminals used in a match.

→ Read the usage guide

Hardware and drivers

Chassis, IMU, lidar, Orbbec camera, and the driver chain started by nav_multi.launch.

→ Read hardware and drivers

Navigation

Map, AMCL, move_base, and where the parameter files live.

→ Read navigation

Vision

Traffic lights, dolls, fire, license plates, trash bins, e-bikes, and the model for each.

→ Read vision

Match tasks

Waypoints in main_nav.py, the task at each stop, and the topics shared with vision.

→ Read match tasks

Summary

How the three packages fit together, and where to edit waypoints or models.

→ Read the summary

Appendix

A function-to-file index, plus scripts that the three-step start does not launch.

→ Read the appendix

2.1 - Overview

Smart Community event of the Global AI Algorithm Elite Competition — mission, three packages, data flow, and startup order.

National second prize, 2025, in the Smart Community event of the Global AI Algorithm Elite Competition. The robot cruises the community, runs recognition at set stops, and speaks the results. Localization is AMCL, planning is move_base, and vision is a separate ONNX node.

  • Platform: ROS Noetic · Ubuntu 20.04 · catkin workspace
  • Code: community_nav, community_vision, community_mission

What the system does

The match is three pipelines:

  1. Navigation — main_nav.py follows waypoints written into the script (move_base + AMCL)
  2. Perception — at a task stop, a topic asks the vision node to run once
  3. Speech — zone totals and some detection results are spoken with espeak

This stack does not use the later RAICOM prep/go scripts, and it does not write a report file. A match is three terminals, started in order.

Three packages

PackageRoleWhat starts it
community_navMap, chassis, IMU, lidar, EKF, AMCL, move_base, Orbbec cameraroslaunch community_nav nav_multi.launch
community_visionSubscribe to the camera and switch detection tasks by topicpython yolo_onnx.py (conda paddle_env)
community_missionWaypoints and the task at each stoppython main_nav.py (system Python)

orbbec_camera, lslidar_driver, and car_bringup are not in these three packages. They already lived in the robot workspace.

Software architecture
Six layers from hardware up to the match tasks

Data flow

Data flow
IMU and wheel odometry enter the EKF. Lidar enters AMCL. The camera goes only to the vision node.

Sensors → fusion → localization → planning → chassis

  • Lidar /scan, IMU, and odom_raw pass through the EKF to produce /odom
  • AMCL localizes with /scan and the map, and publishes map → odom
  • move_base sends velocity to the chassis

Task triggers are topics, not services. main_nav.py publishes /traffic, /person_detect, and the other commands. yolo_onnx.py answers on the matching status topic. During e-bike tracking, the vision node publishes /cmd_vel directly.

Camera

Every vision task uses the color image from an Orbbec Dabai DCW2, topic /camera/color/image_raw. nav_multi.launch includes dabai_dcw2.launch from orbbec_camera. The monocular usb_cam include in that launch is commented out.

Startup order

OrderTerminalCommand
1System Pythonroslaunch community_nav nav_multi.launch
2conda paddle_envpython yolo_onnx.py
3System Pythonpython main_nav.py

Wait until step 1 is publishing camera images and step 2 logs that the multi-task detector is ready, then run step 3. Details are in Usage.

What the mission node waits for

After main_nav.py connects to move_base, it walks the waypoints. A plain stop pauses for 0.5 seconds. A task stop blocks until the vision node replies, then the next waypoint starts. A traffic light blocks until the light is recognized as green. When the waypoint list ends, the mission ends.

2.2 - Usage

Environment, dependencies, build, and the navigation, vision, and mission terminals.

Treat the directory that contains src/community_nav, src/community_vision, and src/community_mission as the catkin workspace. You can also copy those three packages into an existing competition_ws/src and build there.

Requirements

ComponentNotes
OSUbuntu 20.04
ROSNoetic
This workspaceThe three packages above
orbbec_cameraDabai DCW2, not in this workspace
lslidar_driverLeishen lidar driver, not in this workspace
car_bringupOdometry node base_node, not in this workspace
Conda paddle_envOnly for yolo_onnx.py

If ros-noetic-desktop-full is already installed, navigation and RViz are usually present. Install anything still missing:

sudo apt update
sudo apt install -y \
  ros-noetic-navigation \
  ros-noetic-robot-localization \
  ros-noetic-robot-state-publisher \
  ros-noetic-xacro \
  ros-noetic-cv-bridge \
  espeak \
  espeak-data

Speech uses espeak -v zh. If the log says Full dictionary is not installed for 'zh', the Chinese voice data is incomplete. Speech will be unclear. Navigation and recognition still run.

Vision environment

environment.yml is at the workspace root. The environment name is paddle_env, Python 3.10. It is a full export from the match machine, so it is large.

conda env create -f environment.yml
conda activate paddle_env

yolo_onnx.py imports onnxruntime, opencv-python, numpy, pillow, ultralytics, cnocr, and cnstd. The OCR models for plates and building names download into ~/.cnstd on first run, which needed a network connection.

main_nav.py uses the ROS Python install. Do not enter paddle_env for it.

Build

cd /path/to/workspace
source /opt/ros/noetic/setup.bash
catkin_make
source devel/setup.bash

Every new terminal must source ROS, then this workspace’s devel/setup.bash.

Devices

DeviceNodeParameters
Chassis/dev/carserial115200, base_controller.py
IMU/dev/imu9600, wit_multi_ros.py
Lidar/dev/lslidarLeishen N10_P serial
CameraOrbbec Dabai DCW2/camera/color/image_raw

Match start (three terminals)

Three terminals
Navigation first, then vision, and only then the waypoints

1. Navigation

Do not enter conda.

source /opt/ros/noetic/setup.bash
source /path/to/workspace/devel/setup.bash
roslaunch community_nav nav_multi.launch

This starts the map, chassis, IMU, lidar, AMCL, move_base, the Orbbec camera, and RViz. To skip RViz:

roslaunch community_nav nav_multi.launch use_rviz:=false

2. Vision

Wait until the camera topic has data. This terminal must enter conda and still source ROS, or rospy and cv_bridge will not line up.

conda activate paddle_env
source /opt/ros/noetic/setup.bash
source /path/to/workspace/devel/setup.bash
cd /path/to/workspace/src/community_vision
python yolo_onnx.py
Run it from this directory

The script loads traffic.onnx and the other models by filename in the current directory. Do not rosrun it from another working directory.

Continue only after the log says the multi-task detector is ready. Snapshots and tracking videos are written to ro_test_img/ in that same directory.

3. Mission

Use system Python. Do not conda activate.

source /opt/ros/noetic/setup.bash
source /path/to/workspace/devel/setup.bash
cd /path/to/workspace/src/community_mission
python main_nav.py

rosrun community_mission main_nav.py also works. After it connects to move_base, it starts at waypoint 1.

Where the models live

All of them sit next to yolo_onnx.py in src/community_vision/:

FileRole
traffic.onnxTraffic lights
best.onnxDolls (good / bad)
fire.onnxFire
bin_new.onnxTrash-bin open or closed
rubbish.onnxTrash class
motorbike.onnxE-bike snapshot and tracking

License plates and building names do not use these files. They use CnOcr.

2.3 - Hardware and drivers

Chassis, IMU, Leishen lidar, Orbbec camera, and the driver chain started by nav_multi.

Hardware

DeviceRoleNode
ChassisMotion/dev/carserial, 115200
Wit IMUAttitude/dev/imu, 9600
Leishen N10_P2D lidar /scan/dev/lslidar
Orbbec Dabai DCW2Color image for every vision task/camera/color/image_raw

The body model is community_nav/urdf/mowen.urdf.xacro. The mesh is meshes/base_link.STL.

In this package, and outside it

Nodes that community_nav starts itself:

NodeRole
wit_multi_ros.pyIMU, publishes /imu
base_controller.pyChassis serial port
robot_state_publisherTF from the URDF
ekf_localization_nodeodom_raw + /imu → /odom

Three other packages are included from launch files. Their source is not in community_nav:

ROS packageRole
lslidar_driverLidar, lslidar_serial_multi.launch
car_bringupbase_node turns wheel speed into odom_raw
orbbec_cameradabai_dcw2.launch

Bringup chain

nav_multi.launch starts map_server first, includes bringup_robot.launch and move_base_multi.launch, then includes the Orbbec camera.

Order inside bringup_robot.launch:

lslidar → imu → base_controller → car_bringup/base_node
       → static TF → robot_state_publisher → EKF

Static TF:

TransformNotes
base_footprint → laser_link0.1 0 0.05, yaw of π
base_footprint → base_linkIdentity transform, for the IMU

EKF parameters are param/robot_localization.yaml. Inputs are remapped to odom_raw and imu. The output is remapped to odom. odom_frame and world_frame are both odom. base_link_frame is base_footprint.

Lidar angle mask

In lslidar_serial_multi.launch, truncated_mode is 1 and the masked sector is about 90° to 270°. Change that launch when the lidar mask changes. Do not change the vision script.

2.4 - Navigation

Map, AMCL, move_base, and the parameter files in community_nav.

roslaunch community_nav nav_multi.launch starts the whole navigation stack. Localization is AMCL, not Cartographer.

Core pieces

PieceRoleLocation
map_serverPublishes /mapmaps/multi_map.yaml, multi_map.pgm
AMCLmap → odommove_base_multi.launch
move_baseGlobal planner plus DWASame launch; parameters in param/
EKF/odombringup_robot.launch

Map resolution is 0.05 m and the origin is [-5, -5, 0]. After replacing the map, remeasure the waypoints in main_nav.py. They are written into the script and are not loaded from yaml.

Parameter files

All of them are in community_nav/param/:

FileContents
costmap_common_params.yamlLoaded for both global and local costmaps
global_costmap_params.yamlGlobal costmap
local_costmap_params.yamlLocal costmap
global_planner_params.yamlGlobal planner
dwa_local_planner_params.yamlDWA
move_base_params.yamlmove_base itself
robot_localization.yamlEKF, loaded by bringup

In move_base_multi.launch, AMCL odom_model_type defaults to omni.

Velocity

Most of the time velocity comes from move_base. At the e-bike tracking stop (waypoint 32), main_nav.py waits there. yolo_onnx.py publishes /cmd_vel directly, then publishes a zero twist, and the mission node continues with the later waypoints.

The RViz config is rviz/nav_riz.rviz. use_rviz:=false turns it off.

Mapping

The match launch loads the existing multi_map. To rebuild it, use launch/gmapping_multi.launch. That launch is not part of the three-step start. After mapping, replace maps/multi_map.yaml and multi_map.pgm, then check the waypoints again.

2.5 - Vision

The seven tasks in yolo_onnx.py, the model files, and the topics shared with the mission node.

The node name is multi_task_detector. The script is community_vision/yolo_onnx.py. It subscribes to /camera/color/image_raw and stays idle until a task topic arrives. It then runs once, or tracks for a stretch, and publishes the result.

Traffic lights, dolls, fire, and trash bins use a small ONNX Runtime wrapper. E-bikes use ultralytics on motorbike.onnx. License plates and building names use CnOcr.

Models

FileTaskClasses
traffic.onnxTraffic lightsRed, yellow, green
best.onnxDollsgood is a resident, bad is not
fire.onnxFireCount of detection boxes
bin_new.onnxBin open or closedKitchen, hazardous, other, recyclable; open or closed
rubbish.onnxTrash inside a binMapped by bin color, then marked correct or wrong
motorbike.onnxE-bikesUpright or fallen; snapshot or ByteTrack

Those six files must sit in the same directory as the script. Snapshots overwrite files in ro_test_img/, including result_person.jpg, result_fire.jpg, result_plate.jpg, result_trash.jpg, and result_bicycle_snapshot.jpg. Tracking also writes raw_record.mp4 and output_tracked.mp4.

Topics

TaskMission publishesVision replies
Traffic light/traffic/traffic_light_status
Dolls/person_detect/person_detect_status
Building / fire/fire_detect/fire_detect_status
License plate/plate_detect/plate_detect_status
Trash bins/trash_bin_detect/trash_bin_status
E-bike tracking/bicycle_detect/bicycle_detect_status
E-bike snapshot/bicycle_snapshot/bicycle_snapshot_status

Doll results are comma-separated good / bad. A snapshot looks like Total:1,Normal:0,Fallen:1. The mission node moves on from a traffic light only when the status string is 绿灯.

What each task does

Traffic light

When it sees green it publishes 绿灯. The mission node waits until that string arrives.

Dolls

good counts as a resident and bad as a non-resident. Totals and the spoken summary are accumulated by zone A or B inside main_nav.py. The vision node only returns the current frame.

Building and fire

OCR runs on the frame first and keeps building names such as 锦绣大厦 and 盛世大厦. fire.onnx then counts fire boxes. The reply to the mission node is one Chinese sentence with the building name and the hazard count.

License plate

CnOcr reads the plate and espeak speaks it. The mission node only waits for a completion signal.

Trash bins

bin_new.onnx sees whether each bin is open or closed. rubbish.onnx sees what is inside. The script checks that against the bin color, then speaks one sentence.

E-bikes

A snapshot is a single frame. It counts upright and fallen bikes and adds them to zone A or B.

Tracking has two stages:

  1. The vision node publishes /cmd_vel, drives, and records the raw frames to raw_record.mp4
  2. At the goal it stops, runs ByteTrack offline, counts upright and fallen bikes in the parking area, and tells the mission node

2.6 - Match tasks

Waypoints in main_nav.py, zone A/B totals, and which vision result each stop waits for.

The script is community_mission/main_nav.py. The node name is navigation_task_node. The points list at the top of the file has 36 poses in the map frame. Numbers start at 1, matching the log line “到达点 N”.

The script does not recognize anything itself. At a task stop it publishes a topic, blocks until vision replies, then goes to the next point. A stop it cannot reach logs a warning, and the loop continues.

Topics
The mission node sends the start signal. The vision node sends the result.

Tasks on the course

StopTask
1, 20Traffic light. Wait until /traffic_light_status is 绿灯
9Speak “前方是禁止直行指示牌”
3, 8, 12Zone A: dolls, then an e-bike snapshot
13, 18Zone B: dolls, then an e-bike snapshot
15, 19, 31Building name and fire
23, 25, 30License plate
27Trash bins and whether the trash was sorted correctly
32Moving e-bike tracking. Vision publishes velocity during this stretch
The restWaypoint only. Pause 0.5 seconds after arrival

Zone A speaks once, after all three of its detection stops. Zone B speaks once, after both of its stops. The sentence gives the resident count, the non-resident count, and the total e-bikes snapshotted at those doll stops (upright plus fallen).

A result token that starts with g counts as a resident. A token that starts with b counts as a non-resident.

Contract with vision

Mission publishesPayloadReply it waits for
/traffictraffic/traffic_light_status = 绿灯
/person_detectstart/person_detect_status
/bicycle_snapshotsnap/bicycle_snapshot_status
/fire_detectstart/fire_detect_status
/plate_detectstart/plate_detect_status
/trash_bin_detectstart/trash_bin_status
/bicycle_detectstart/bicycle_detect_status

The node sleeps 0.5 or 1 second before publishing, so the camera and the previous frame can settle. Right after doll detection, the same stop runs an e-bike snapshot, and that snapshot is added to the current zone, A or B.

Speech

speak() starts a thread that runs espeak -v zh. Zone A/B summaries, the no-straight-ahead sign, and the plate and trash sentences from the vision node all use that path. The Chinese building-and-fire sentence stays in the log. After the mission node receives it, the robot continues and does not speak it again.

2.7 - Summary

How the three packages fit together, and where to edit waypoints, models, or navigation.

Dependencies

Layers and data flow are in the overview. The start order cannot be reversed: move_base and the camera first, then the models, and only then the waypoints. If the vision node starts after the mission node, the mission waits forever at the first traffic light.

Where to change things

GoalEdit
Waypoints, headings, or which stop runs which taskpoints and the *_indices lists in community_mission/main_nav.py
A detection model or a thresholdcommunity_vision/yolo_onnx.py. Keep the model file beside that script
Costmaps, DWA, or AMCLcommunity_nav/param/ and launch/move_base_multi.launch
Serial ports, the lidar mask, or TFcommunity_nav/launch/
The match mapcommunity_nav/maps/multi_map.yaml and .pgm, then remeasure waypoints
Do not mix the two Pythons

yolo_onnx.py needs ONNX and ultralytics from conda. main_nav.py needs system rospy. On the vision terminal, conda activate paddle_env and then source ROS.

Entry points

UsePath
Navigation launchsrc/community_nav/launch/nav_multi.launch
Vision nodesrc/community_vision/yolo_onnx.py
Mission nodesrc/community_mission/main_nav.py
Modelssrc/community_vision/*.onnx
Conda environmentenvironment.yml at the workspace root

The file index is in the appendix.

2.8 - Appendix

A function-to-file index, and scripts that stay in the package but are not part of the three-step start.

Function to file

To change or inspectPath (from the workspace)
Full vehicle startsrc/community_nav/launch/nav_multi.launch
Chassis, IMU, EKF, URDFsrc/community_nav/launch/bringup_robot.launch
AMCL and move_basesrc/community_nav/launch/move_base_multi.launch
Lidar port and angle masksrc/community_nav/launch/lslidar_serial_multi.launch
Costmaps and DWAsrc/community_nav/param/
Mapsrc/community_nav/maps/multi_map.yaml
Waypoints and task stopssrc/community_mission/main_nav.py
Detection and speech detailssrc/community_vision/yolo_onnx.py
ONNXThe six files next to the script in src/community_vision/
Run snapshots and tracking videosrc/community_vision/ro_test_img/ (created at runtime)

Files the three-step start does not launch

These remain in community_nav for mapping or collecting points. nav_multi.launch does not start them.

FileNotes
launch/gmapping_multi.launchgmapping
launch/usb_cam-test.launchMonocular camera. Commented out of the main navigation launch
scripts/joy_bringup.py, joy_bringup_ros.py, joy_bringup_ros_yolo.py, joy_ros_tf.pyJoystick waypoint capture and photos
scripts/uwb_to_pose.py, param/robot_localization_uwb.yamlUWB. Not loaded by the current bringup

joy_bringup_ros.py and joy_ros_tf.py still save to absolute paths from the old machine.

Topics

NameNotes
/cmd_velTo the chassis. The vision node publishes it while tracking an e-bike
/scanLeishen lidar
/odomEKF output
/camera/color/image_rawOrbbec color image. The only vision input
/move_baseAction client used by the mission node
/traffic, /traffic_light_statusTraffic light
/person_detect, /person_detect_statusDolls
/fire_detect, /fire_detect_statusBuilding and fire
/plate_detect, /plate_detect_statusLicense plate
/trash_bin_detect, /trash_bin_statusTrash bins
/bicycle_detect, /bicycle_detect_statusE-bike tracking
/bicycle_snapshot, /bicycle_snapshot_statusSingle-frame e-bike snapshot