当前位置:首页 > 编程笔记 > 正文
已解决

【ROS】ROS2-humble安装navigation2与使用

来自网友在路上 186886提问 提问时间:2023-11-10 05:05:44阅读次数: 86

最佳答案 问答题库868位专家为你答疑解惑

Part 0. 准备

安装gazebo
sudo apt install ros-humble-gazebo-*
测试gazebo:
ros2 launch gazebo_ros gazebo.launch.py

Part 1. [安装] 直接安装Navigation2

下载与安装:

sudo apt install ros-humble-navigation2
sudo apt install ros-humble-nav2-bringup
sudo apt install ros-humble-turtlebot3-gazebo

启动nav2:

source /opt/ros/humble/setup.bash
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models
ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False

使用nav2

首先,通过2d_pose_estimate按键画一个初始节点的大概位置

然后,通过Nav2_Goal按键选择一个目标,则开始运行

Part 2. [安装] 源码编译-navigation2

step 0. 设置环境:

    source /opt/ros/humble/setup.bash

step 1. 进入工作环境

    cd /ROS_Workstationmkdir src

step 2. 下载Nav2项目的对应版本

    cd srcgit clone https://github.com/ros-planning/navigation2.git --branch humble ./src/navigation2

在工作环境ROS_Workstation中运行指令:
sudo rosdep install -y --from-paths src --ignore-src --rosdistro humble -r

step 4. 编译工作空间

source /opt/ros/humble/setup.bash
export CC=/usr/bin/gcc-9
export CXX=/usr/bin/g++-9
colcon build --symlink-install --cmake-clean-cache

报错:如果有编译错误,主要修改CMakeLists.txt文件

Part 2. 启动源码编译的nav2,

  source install/setup.bashexport TURTLEBOT3_MODEL=waffleexport GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/modelsros2 launch nav2_bringup tb3_simulation_launch.py headless:=False

ros2与turtlebot3仿真教程-启动gazebo不同环境

参考链接:  https://blog.51cto.com/u_1790502/6087725
查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"【ROS】ROS2-humble安装navigation2与使用":http://eshow365.cn/6-36911-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!