Skip to content

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

Return to the regular view of this page.

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

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

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.

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.

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

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.

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.

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