当前位置: 首页 > 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: giturl: https://github.com/ament/ament_cmake.gitversion: humbleament/ament_index:type: giturl: https://github.com/ament/ament_index.gitversion: humbleament/ament_lint:type: giturl: https://github.com/ament/ament_lint.gitversion: humbleament/ament_package:type: giturl: https://github.com/ament/ament_package.gitversion: humbleament/google_benchmark_vendor:type: giturl: https://github.com/ament/google_benchmark_vendor.gitversion: humbleament/googletest:type: giturl: https://github.com/ament/googletest.gitversion: humbleament/uncrustify_vendor:type: giturl: https://github.com/ament/uncrustify_vendor.gitversion: humbleeProsima/Fast-CDR:type: giturl: https://github.com/eProsima/Fast-CDR.gitversion: v1.0.24eProsima/Fast-DDS:type: giturl: https://github.com/eProsima/Fast-DDS.gitversion: 2.6.xeProsima/foonathan_memory_vendor:type: giturl: https://github.com/eProsima/foonathan_memory_vendor.gitversion: mastereclipse-cyclonedds/cyclonedds:type: giturl: https://github.com/eclipse-cyclonedds/cyclonedds.gitversion: releases/0.10.xeclipse-iceoryx/iceoryx:type: giturl: https://github.com/eclipse-iceoryx/iceoryx.gitversion: release_2.0ignition/ignition_cmake2_vendor:type: giturl: https://github.com/ignition-release/ignition_cmake2_vendor.gitversion: humbleignition/ignition_math6_vendor:type: giturl: https://github.com/ignition-release/ignition_math6_vendor.gitversion: humbleosrf/osrf_pycommon:type: giturl: https://github.com/osrf/osrf_pycommon.gitversion: masterosrf/osrf_testing_tools_cpp:type: giturl: https://github.com/osrf/osrf_testing_tools_cpp.gitversion: humbleros-perception/image_common:type: giturl: https://github.com/ros-perception/image_common.gitversion: humbleros-perception/laser_geometry:type: giturl: https://github.com/ros-perception/laser_geometry.gitversion: humbleros-planning/navigation_msgs:type: giturl: https://github.com/ros-planning/navigation_msgs.gitversion: humbleros-tooling/keyboard_handler:type: giturl: https://github.com/ros-tooling/keyboard_handler.gitversion: humbleros-tooling/libstatistics_collector:type: giturl: https://github.com/ros-tooling/libstatistics_collector.gitversion: humbleros-visualization/interactive_markers

http://www.mrgr.cn/news/98284.html

相关文章:

  • 深入详解MYSQL的MVCC机制
  • CAP理论 与 BASE理论
  • python——正则表达式
  • C++17模板编程与if constexpr深度解析
  • C# net CMS相关开源软件 技术选型 可行性分析
  • flutter 桌面应用之右键菜单
  • 【Python全栈】应用开发实战案例解析
  • 39.[前端开发-JavaScript高级]Day04-函数增强-argument-额外知识-对象增强
  • 【docker】--部署--安装docker教程
  • 【HD-RK3576-PI】Docker搭建与使用
  • 【第41节】windows的中断与异常及异常处理方式
  • 记录一个虚拟机分配资源的问题
  • 第二十四:查看当前 端口号是否被占用
  • Open-TeleVision源码解析——宇树摇操方案的重要参考:VR控制人形机器人采集数据
  • 高并发内存池(三):PageCache(页缓存)的实现
  • python基础:数据类型转换、运算符(算术运算符、比较运算符、逻辑运算符、三元运算符、位运算符)
  • CTF--bp
  • Kubernetes服务注册到consul流程实践
  • ArkTS语言入门之接口、泛型、空安全、特殊运算符等
  • vulkanscenegraph显示倾斜模型(5.9)-vsg中vulkan资源的编译