Ubuntu22.04上源码构建ROS noetic_base
起因
最近在研究VINS-Mono从ROS移植到ROS2,发现在编写feature_tracker的CMakeList.txt后,会出现找不到包含文件的问题,于是向先用ROS把VINS编译跑一下看看,便有了在Ubuntu 22.04虚拟机上再构建一个ROS的环境的想法,本来是想按照官网一步一步做就行了,然而到ROS的官方下载地址发现没有Ubuntu 22.04(jammy)版本和对应的Debian 12(Bookworm)的仓库。
所以按照ros官网安装步骤,在sudo apt update
这一步就止步了,原因就是Ros Noetic主要针对Ubuntu 20.04,并且不正式支持任何更新的发布了。
所以通过Google找到一个源码安装的方法,亲自验证后,在此分享给大家。
准备环境
- 安装docker
- 安装python3
- 安装pip3
- 安装git
- 下载ROS Noetic基础包源码(此次可能需要借助梯子)
创建工作目录并下载源码
mkdir -p ~/ros_noetic_base_2204/catkin_ws/src
在src目录下执行脚本,下载ROS 包
#!/bin/bash
git clone https://github.com/ros/actionlib.git -b 1.14.0
git clone https://github.com/ros/bond_core.git -b 1.8.6
git clone https://github.com/ros/catkin.git -b 0.8.10
git clone https://github.com/ros/class_loader.git -b 0.5.0
git clone https://github.com/ros/cmake_modules.git -b 0.5.0
git clone https://github.com/ros/common_msgs.git -b 1.13.1
git clone https://github.com/ros/dynamic_reconfigure.git -b 1.7.3
git clone https://github.com/ros/gencpp.git -b 0.7.0
git clone https://github.com/jsk-ros-pkg/geneus.git -b 3.0.0
git clone https://github.com/ros/genlisp.git -b 0.4.18
git clone https://github.com/ros/genmsg.git -b 0.6.0
git clone https://github.com/RethinkRobotics-opensource/gennodejs.git -b 2.0.1
git clone https://github.com/ros/genpy.git -b 0.6.16
git clone https://github.com/ros/message_generation.git -b 0.4.1