ubuntu20.04安装ros2(humble)版本,源码安装

ubuntu20.04安装ros2(humble)版本,源码安装

满足gcc 版本 > 7
提前下载源码ros2_humble
以下是官方文档地址,进入后按步骤操作:

https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html#

在这里插入图片描述在/etc/hosts下添加

185.199.109.133 raw.githubusercontent.com

修改编码格式:

locale  # check for UTF-8

sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

locale  # verify settings

您需要将ROS2 apt存储库添加到您的系统中,确保Ubuntu Universe存储库已启用。

sudo apt install software-properties-common
sudo add-apt-repository universe

现在添加带有apt的ROS 2 GPG密钥:

sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

然后将存储库添加到源列表中。

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

20.04版本选择:

python3 -m pip install -U \
   flake8-blind-except \
   flake8-builtins \
   flake8-class-newline \
   flake8-comprehensions \
   flake8-deprecated \
   flake8-import-order \
   flake8-quotes \
   "pytest>=5.3" \
   pytest-repeat \
   pytest-rerunfailures

使用rosdep安装依赖:

sudo apt upgrade

使用魔法(建议换手机热点)

sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers"

最后源码编译:

cd ~/ros2_humble/
colcon build --symlink-install

./bashrc中设置:

echo "ros: noetic(1)  humble(2) ?"
read choose
case $choose in
1) source /opt/ros/noetic/setup.bash;;
2) source /home/ros2_humble/install/setup.bash;;
esac
  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值