This commit is contained in:
robofish 2025-07-07 02:48:47 +08:00
parent d3c6cf5c0a
commit 432c839c6e
5 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,69 @@
# RC2025 自动定位瞄准代码
基于ROS2的机器人自动定位与瞄准系统支持激光雷达建图和导航功能。
## 系统要求
- Ubuntu 22.04
- ROS2 Humble
- 激光雷达MID360
## 快速开始
### 1. 编译项目
```bash
./build.sh
```
### 2. 建图模式
用于创建环境地图和点云数据:
```bash
./mapping.sh
```
**建图前配置:**
1. 修改 `mapping.sh` 中的地图保存文件名(将 `RC2025` 改为您的项目名)
2. 同步修改 `src/rm_nav_bringup/config/reality/fastlio_mid360_real.yaml` 中的 pcd 文件名
**建图操作:**
- 保存点云文件:`ros2 service call /map_save std_srvs/srv/Trigger`
- 保存地图:确保地图名称保持一致
### 3. 导航模式
使用已建立的地图进行导航:
```bash
./nav.sh
```
## 重要参数配置
### 激光雷达安装位置
**位置参数配置:**
- 文件:`src/rm_nav_bringup/config/reality/measurement_params_real.yaml`
- 修改:`x`, `y`, `z` 坐标
- 注意:不要修改 `rpy` 参数
**姿态参数配置:**
- 文件:`src/rm_nav_bringup/config/reality/MID360_config.json`
- 修改:`yaw`, `pitch`, `roll` 角度
- 注意:不要修改 `xyz` 参数
### 地面点云分割
- 文件:`src/rm_nav_bringup/config/reality/segmentation_real.yaml`
- 参数:`sensor_height`(激光雷达距离地面的高度)
- 参数:`max_dist_to_line`(地面点云分割的最低高度)
- 说明:此参数影响地面点云的正确分割
### 目标点设定
- 文件:`nav.sh`
- 参数:篮筐目标点的 `x``y` 坐标
- 用途:设定机器人瞄准的目标点

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

16
mapping.sh Normal file
View File

@ -0,0 +1,16 @@
source install/setup.bash
commands=(
"ros2 launch rm_nav_bringup bringup_real.launch.py \
world:=RC2025 \
mode:=mapping \
lio:=fastlio \
localization:=icp \
lio_rviz:=false \
nav_rviz:=true"
)
for cmd in "${commands[@]}"; do
gnome-terminal -- bash -c "source install/setup.bash; $cmd; exec bash"
sleep 0.5
done