This commit is contained in:
äHuang77 2026-05-06 02:34:33 +00:00
parent ca23b944f1
commit c859acaeb6
3 changed files with 9 additions and 13 deletions

View File

@ -7,7 +7,6 @@
- Ubuntu 22.04 - Ubuntu 22.04
- ROS2 Humble - ROS2 Humble
- Gazebo Sim Harmonic - Gazebo Sim Harmonic
--- ---
### 编译 ### 编译
@ -16,7 +15,7 @@
cd /workspace cd /workspace
colcon build --symlink-install colcon build --symlink-install
source /opt/ros/humble/setup.bash source /opt/ros/humble/setup.bash
source ~/ros_ws/install/setup.bash source install/setup.bash
``` ```
### 确认 package 能被 ROS2 找到 ### 确认 package 能被 ROS2 找到
@ -24,6 +23,7 @@ source ~/ros_ws/install/setup.bash
```bash ```bash
ros2 pkg list | grep explore ros2 pkg list | grep explore
``` ```
预计打印结果explore_lite
### 注意事项 ### 注意事项
@ -33,7 +33,6 @@ ros2 pkg list | grep explore
source /opt/ros/humble/setup.bash source /opt/ros/humble/setup.bash
source install/setup.bash source install/setup.bash
export TURTLEBOT3_MODEL=burger export TURTLEBOT3_MODEL=burger
export NAV2_MAP_PATH=~/ros_ws/src/VLM-semantic-nav2/turtlebot3_simulations/turtlebot3_gazebo/map/office_map.yaml
``` ```
为了方便,也可以写入 `~/.bashrc` 为了方便,也可以写入 `~/.bashrc`
@ -42,26 +41,23 @@ export NAV2_MAP_PATH=~/ros_ws/src/VLM-semantic-nav2/turtlebot3_simulations/turtl
echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc
echo 'source ~/ros_ws/install/setup.bash' >> ~/.bashrc echo 'source ~/ros_ws/install/setup.bash' >> ~/.bashrc
echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc
echo 'export NAV2_MAP_PATH=~/ros_ws/src/VLM-semantic-nav2/turtlebot3_simulations/turtlebot3_gazebo/map/office_map.yaml' >> ~/.bashrc
source ~/.bashrc source ~/.bashrc
``` ```
## 2. 启动仿真, Nav2导航栈 SLAM Toolbox异步建图 rviz2 ## 2. 启动仿真, Nav2导航栈 SLAM Toolbox异步建图 rviz2
```bash ```bash
ros2 launch turtlebot3_gazebo turtlebot3_office.launch.py \ ./gzsim_run.sh
x_pose:=0.0 y_pose:=0.0 use_sim_time:=true use_rviz:=false headless:=true
ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True headless:=False
ros2 launch slam_toolbox online_async_launch.py use_sim_time:=True ros2 launch slam_toolbox online_async_launch.py use_sim_time:=True
ros2 run rviz2 rviz2 -d /opt/ros/humble/share/nav2_bringup/rviz/nav2_default_view.rviz ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True headless:=False
ros2 run rviz2 rviz2 -d /opt/ros/humble/share/nav2_bringup/rviz/nav2_default_view.rviz --ros-args -p use_sim_time:=true
``` ```
## 3. 启动explore_lite 自主探索节点如果机器人在探索时在某一点长时间卡住可以在rviz中使用Nav2 Goal进行单点导航探索。
## 3. 启动explore_lite 自主探索节点
```bash ```bash
ros2 launch explore_lite explore.launch.py ros2 launch explore_lite explore.launch.py
``` ```
@ -73,8 +69,8 @@ ros2 launch explore_lite explore.launch.py
机器人完成环境全区域探索后,新开终端执行地图保存命令,地图将保存至$NAV2_MAP_PATH指定路径 机器人完成环境全区域探索后,新开终端执行地图保存命令,地图将保存至$NAV2_MAP_PATH指定路径
```bash ```bash
export NAV2_MAP_PATH=/workspace/src/turtlebot3_simulations/turtlebot3_gazebo/map/office_map.yaml export NAV2_MAP_PATH=/workspace/src/turtlebot3_simulations/turtlebot3_gazebo/map
ros2 run nav2_map_server map_saver_cli -f $NAV2_MAP_PATH ros2 run nav2_map_server map_saver_cli -f ${NAV2_MAP_PATH}/office_map
``` ```
## 5. 模型说明 ## 5. 模型说明