docker环境编译navigation2-humble及cartographer


前言

ubuntu20.04不支持navigation2-humble版本编译,于是使用docker环境进行navigation2-humble版本编译


一、navigation2是什么?

navigation2是ros2中常用的导航模块,ros2版本众多,navigation2-humble是其中一个较新的版本,其支持的功能模块也最全。

二、使用步骤

1.docker环境准备

docker安装参考其他教程

2.镜像下载及容器启动

sudo docker pull osrf/ros:humble-simulation
docker run -it  --restart=always --name ros2humble --gpus all -v /home/xujin:/home/xujin  osrf/ros:humble-simulation /bin/bash

3.下载navigation2源码

navigation2源码

4.进行容器进行编译

docker exec -it a4b1d4cf2fc8 /bin/bash

进入navigation2-humble上一级目录进行依赖安装

apt-get update
rosdep install -i --from-path navigation2-humble --rosdistro humble -y

编译

colcon build

可能会遇到如下问题

在这里插入图片描述setuptools版本问题,需要重新安装版本

pip install setuptools==58.2.0

再次编译正常

5.cartographer编译

官网下载cartographer及cartographer-ros源码,将其添加至src目录
先编译abseil

cd scripts/
sudo apt install ninja-build
sudo apt install stow
sh install_abseil.sh

再安装相关依赖编译

sudo apt install libceres-dev
sudo apt install liblua5.3-dev
sudo apt install libcairo2-dev
sudo apt install libpcl-dev
sudo apt install ros-humble-pcl-conversions
sudo apt install python3-sphinx
colcon build

至此建图也编译成功

总结

安装过程中可能会遇到pull镜像失败问题,需要更换源

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值