Mapping and Navigation Example
Description
- This example uses a Livox LiDAR to implement SLAM mapping and autonomous navigation for the robot: first build a map manually in the target area, then save and load the map, and set navigation goals in RViz to make the robot move autonomously.
Procedure
Prerequisites
- The host computer needs to have the
Leju_head_ARM (1.5.0)repository deployed.
cd ~/Leju_head_ARM
git fetch
git stash
git checkout 1.5.0
catkin build
- Modify the deployment script
~/Leju_head_ARM/systemd/install.shto disable voice control deployment by commenting out line 291 of the file, as shown below:
export RUN_USER USER_HOME WS_ROOT DDS_LIB_DIR ROS_HOST_IP
bash "$WS_ROOT/src/ros_dds_bridge/service/ros_dds_bridge_deploy_script.sh"
bash "$WS_ROOT/src/planarmwebsocketservice/service/websocket_deploy_script.sh"
bash "$WS_ROOT/src/kuavo_audio_receiver/service/mic_receiver_deploy_script.sh"
# bash "$WS_ROOT/src/voice_control_node/deploy/voice_control_deploy_script.sh"
echo ""
echo "=============================================="
echo "✅ 四个上位机服务部署并验收完成"
echo " ros-dds-bridge / planarm-websocket / mic-receiver / voice-control-node"
echo "=============================================="
- Deploy the communication bridge between the upper and lower computers.
cd ~/Leju_head_ARM
sudo bash systemd/install.sh1. Compilation and Startup-on-Boot Setup
- The slam package must be compiled the first time it is used.
cd ~/kuavo_ros_application
# 如有本地修改,需先暂存再更新代码
git stash .
git checkout beta
git pull
cd src/kuavo_slam_ws
bash build_kuavo_slam_ws.sh2. Mapping
-
Use realVNC to remotely connect to the robot's host computer.
Address:
192.168.8.101:5902(for a simulation environment, change it to the actual IP) Password:leju_kuavo
-
Terminal 1: start the mapping program.
cd ~/kuavo_ros_application/src/kuavo_slam_ws
source devel/setup.bash
roslaunch kuavo_mapping build_map.launch-
Use the controller to drive the robot around the area to build the map.
Mapping requirements:
- Try to keep moving sources out of the 1-meter radius around the robot; moving sources will interfere with the newly built map.
- A single scan should not exceed 5 minutes.
-
Terminal 2: save the map to
~/maps.
cd ~/kuavo_ros_application/src/kuavo_slam_ws
source devel/setup.bash
rosrun kuavo_mapping save_map.sh3. Navigation
-
Use realVNC to remotely connect to the robot's host computer, changing the IP to the actual IP of the robot's host computer.
Address:
192.168.8.101:5902Password:leju_kuavo -
Terminal 1: start the navigation service
# roslaunch启动
cd ~/kuavo_ros_application/src/kuavo_slam_ws
source devel/setup.bash
roslaunch kuavo_mapping navigation_service.launch
- Terminal 2: load the saved map: replace the file name in the command below with the map file actually saved in
~/maps.
cd ~/kuavo_ros_application/src/kuavo_slam_ws
source devel/setup.bash
#加载地图
rosservice call /load_map "map_2026-08-24_14-23-18"
#打开rviz导航可视化
rviz -d "$(rospack find kuavo_mapping)/rviz/load_map.rviz"
-
Initial pose calibration: select 2D Pose Estimate in the RViz top toolbar, then click and drag on the map to calibrate the robot's initial position and orientation.

-
Set a navigation goal: select 2D Nav Goal in the RViz top toolbar, click the target point on the map and drag to set the orientation; the robot will then start autonomous navigation.