【Nav2】Ubuntu18+ROS2 Eloquent跑通Navigation2仿真示例

【背景】

打算通过Navigation2来了解ROS2的核心两大件——LifeCircle和BehaviorTree,结果根据官网的教程一顿鼓捣,这个Turtlbot3的仿真就是跑不起来,这怎么能忍?虽然在Ubuntu20上使用Foxy版本可以非常容易就跑通demo,但是我这个人就是不信邪,我偏要在Ubuntu18上把这小乌龟跑起来!于是就开始了漫漫DEBUG路。

【干货】

系统环境

  • Ubuntu 18.04
  • ROS2 Eloquent

软件代码栈

1、手动下载 Nav2 源码包

GitHub - ros-planning/navigation2 at eloquent-develROS2 Navigation Framework and System. Contribute to ros-planning/navigation2 development by creating an account on GitHub.https://github.com/ros-planning/navigation2/tree/eloquent-devel2、手动下载 BehaviorTree 源码包

Release 3.5.6 · BehaviorTree/BehaviorTree.CPP · GitHubBehavior Trees Library in C++. Batteries included. - Release 3.5.6 · BehaviorTree/BehaviorTree.CPPhttps://github.com/BehaviorTree/BehaviorTree.CPP/releases/tag/3.5.63、将上述两个包解压到 ~/nav2_ws/src/ 目录中,运行以下命令

colcon build

4、编译过程遇到有依赖缺失,则运行以下命令(pkg-name替换为缺失的包名)

sudo apt install ros-eloquent-<pkg-name>

5、安装 Turtlebot3 仿真环境

sudo apt install ros-eloquent-turtlebot3*

【开跑】

cd ~/nav2_ws/
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/eloquent/share/turtlebot3_gazebo/models
source install/setup.bash
ros2 launch nav2_bringup nav2_tb3_simulation_launch.py

RViz打开后,点击左下角的 startup ,并给机器人一个初始位置,然后就可以给 goal ,让乌龟动了

 【问题】

  1. 如果启动Gazebo的时候,终端冒出来一行红字“Err:LibCul:xxxxx”,就执行以下操作
gedit .ignition/fuel/config.yaml

将里面内容改成下面这样:
---
# The list of servers.
servers:
  -
    name: osrf
#    url: https://api.ignitionfuel.org
    url: https://api.ignitionrobotics.org

  # -
    # name: another_server
    # url: https://myserver

# Where are the assets stored in disk.
# cache:
#   path: /tmp/ignition/fuel

 2、ROS Eloquent的源码存在一个bug,当我们长时间让 Turtlebot 处于 idle 状态时,planner_server就会报一个错

https://github.com/ros2/rclcpp/issues/1266icon-default.png?t=N2N8https://github.com/ros2/rclcpp/issues/1266

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值