跳转至

ROS 2自主导航:让机器人运动自由

9.3.1 Nav2安装方法

$ sudo apt update 
$ sudo apt install ros-jazzy-navigation2 
$ sudo apt install ros-jazzy-nav2-bringup 

9.3.2 Nav2案例体验

# Turtlebot3 导航示例 
$ ros2 launch nav2_bringup tb3_simulation_launch.py 
# Turtlebot4 导航示例 
$ ros2 launch nav2_bringup tb4_simulation_launch.py 

机器人自主导航仿真

9.4.3 机器人自主导航仿真

$ ros2 launch learning_gazebo_harmonic load_mbot_lidar_into_maze_gazebo_harmonic.launch.py
$ ros2 launch originbot_navigation nav_bringup_gazebo.launch.py 

机器人自主导航实践

9.5.3 机器人自主导航实践

# 机器人的终端1 
$ ros2 launch originbot_bringup originbot.launch.py use_lidar:=true 

# 机器人的终端2 
$ ros2 launch originbot_navigation nav_bringup.launch.py

# 计算机端 
$ ros2 launch originbot_viz display_navigation.launch.py

机器人自主导航编程

9.6.1 功能运行

# 终端1 
$ ros2 launch learning_gazebo_harmonic load_mbot_lidar_into_maze_gazebo_harmonic.launch.py 
# 终端2 
$ ros2 launch originbot_navigation nav_bringup_gazebo.launch.py 

$ ros2 run originbot_send_goal send_goal_node

机器人自主探索应用

9.7.1 Nav2+SLAM Toolbox自主探索应用

slam = LaunchConfiguration('slam', default='True') 
#终端1:启动仿真环境 
$ ros2 launch learning_gazebo_harmonic load_mbot_lidar_into_maze_gazebo_harmonic.launch.py 

#终端2:启动Nav2 导航建图算法 
$ ros2 launch originbot_navigation nav_bringup_gazebo.launch.py 

9.7.2 Nav2+Cartographer 自主探索应用

#终端1:启动仿真环境 
$ ros2 launch learning_gazebo_harmonic load_mbot_lidar_into_maze_gazebo_harmonic.launch.py 
#终端2:启动Nav2 导航建图算法 
$ ros2 launch originbot_navigation nav2_carto.launch.py

图片1