当前位置: 首页 > news >正文

ubuntu 20.04 安装源码编译 ros humble过程

公司要兼容ros1还需要ros2 这个时候不得不使用ubuntu20.04 安装 humble 但实际上在20.04上安装humble是需要在源码编译的。
根据这个帖子 https://blog.csdn.net/m0_62353836/article/details/129730981 重写一份,以应对无法下载的问题
系统配置

#检查是否为UTF-8编码,是则跳过!
locale  


#非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  

增加带有apt 的ros2 gpg秘钥

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

这里由于无法通过githubusercontent下载,所以这么改

sudo curl -sSL https://raw.gitmirror.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

安装开发工具和ROS工具
安装通用软件包

sudo apt update && sudo apt install -y \
  python3-flake8-docstrings \
  python3-pip \
  python3-pytest-cov \
  ros-dev-tools

安装Ubuntu20.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

获取ros2源码

mkdir -p ~/ros2_humble/src
cd ~/ros2_humble
vcs import --input https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos src

这里还是无法下载需要手动下载https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos这个文件,我们可以通过在镜像网站上下载此文件然后把github.com 改成bgithub.xyz。即可首先我们下载这个文件

wget https://raw.gitmirror.com/ros2/ros2/humble/ros2.repos

其内容为

repositories:
  ament/ament_cmake:
    type: git
    url: https://github.com/ament/ament_cmake.git
    version: humble
  ament/ament_index:
    type: git
    url: https://github.com/ament/ament_index.git
    version: humble
  ament/ament_lint:
    type: git
    url: https://github.com/ament/ament_lint.git
    version: humble
  ament/ament_package:
    type: git
    url: https://github.com/ament/ament_package.git
    version: humble
  ament/google_benchmark_vendor:
    type: git
    url: https://github.com/ament/google_benchmark_vendor.git
    version: humble
  ament/googletest:
    type: git
    url: https://github.com/ament/googletest.git
    version: humble
  ament/uncrustify_vendor:
    type: git
    url: https://github.com/ament/uncrustify_vendor.git
    version: humble
  eProsima/Fast-CDR:
    type: git
    url: https://github.com/eProsima/Fast-CDR.git
    version: v1.0.24
  eProsima/Fast-DDS:
    type: git
    url: https://github.com/eProsima/Fast-DDS.git
    version: 2.6.x
  eProsima/foonathan_memory_vendor:
    type: git
    url: https://github.com/eProsima/foonathan_memory_vendor.git
    version: master
  eclipse-cyclonedds/cyclonedds:
    type: git
    url: https://github.com/eclipse-cyclonedds/cyclonedds.git
    version: releases/0.10.x
  eclipse-iceoryx/iceoryx:
    type: git
    url: https://github.com/eclipse-iceoryx/iceoryx.git
    version: release_2.0
  ignition/ignition_cmake2_vendor:
    type: git
    url: https://github.com/ignition-release/ignition_cmake2_vendor.git
    version: humble
  ignition/ignition_math6_vendor:
    type: git
    url: https://github.com/ignition-release/ignition_math6_vendor.git
    version: humble
  osrf/osrf_pycommon:
    type: git
    url: https://github.com/osrf/osrf_pycommon.git
    version: master
  osrf/osrf_testing_tools_cpp:
    type: git
    url: https://github.com/osrf/osrf_testing_tools_cpp.git
    version: humble
  ros-perception/image_common:
    type: git
    url: https://github.com/ros-perception/image_common.git
    version: humble
  ros-perception/laser_geometry:
    type: git
    url: https://github.com/ros-perception/laser_geometry.git
    version: humble
  ros-planning/navigation_msgs:
    type: git
    url: https://github.com/ros-planning/navigation_msgs.git
    version: humble
  ros-tooling/keyboard_handler

相关文章:

  • 基于混合编码器和边缘引导的拉普拉斯金字塔网络用于遥感变化检测
  • c# 数据结构 链表篇 有关单链表的一切
  • java 项目
  • AI多模态论文解读:OmniCaptioner:多领域视觉描述生成框架(附脑图)
  • C语言超详细指针知识(一)
  • 第八天 开始Unity Shader的学习之Blinn-Phong光照模型
  • 聊聊Spring AI的Tool Calling
  • 利用多GPU计算探索量子无序及AI拓展
  • 城市应急安防系统EasyCVR视频融合平台:如何实现多源视频资源高效汇聚与应急指挥协同
  • 力扣第206场周赛
  • 基于Streamlit的智能创业计划生成器开发实践
  • 面试经验分享 | 成都渗透测试工程师二面面经分享
  • 道可云人工智能每日资讯|广东省交通行业算力中心在韶关市揭牌
  • 千手观音题解(C++与Java)与拓扑排序讲解
  • 轻量级开源文件共享系统PicoShare本地部署并实现公网环境文件共享
  • Git 切换分支的完整指南
  • 使用Helm部署Nginx过程记录与问题解决
  • DevDocs:抓取并整理技术文档的MCP服务
  • 类型转换Java
  • 【操作系统(Linux)】——通过案例学习父子进程的线程异步性
  • 冀州网站建设/免费建站哪个最好
  • 网站开发员/如何网络推广
  • 子网站建设并绑定独立域名/百度关键词首页排名怎么上
  • 美术馆网站建设方案/正规的关键词优化软件
  • 免费b2b网站大全黄页/教你如何快速建站
  • 做旅游平台网站找哪家好/搜索引擎调词工具