【自动驾驶】Ubuntu22.04源码安装Autoware Core/Universe

【自动驾驶】Ubuntu22.04源码安装Autoware Core/Universe

官方源码安装教程

链接:https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/

前置条件

  1. Ubuntu 22.04
  2. CPU with 8 cores
  3. 16GB RAM
  4. Optional\] NVIDIA GPU (4GB RAM)

安装ROS2 Humble

使用鱼香ROS脚本进行安装

powershell 复制代码
wget http://fishros.com/install -O fishros && . fishros

安装Autoware Core/Universe

配置开发环境

选择一个目录,克隆autowarefoundation/autoware,并进入项目目录

powershell 复制代码
git clone https://github.com/autowarefoundation/autoware.git
cd autoware

使用官方提供的脚本自动安装依赖

powershell 复制代码
sudo ./setup-dev-env.sh

过程installing ansible from spec 'ansible==6.*'可能比较漫长,属于正常现象

若出现如下错误:

powershell 复制代码
fatal: [localhost]: FAILED! => {"changed": false, "dest": "/usr/share/keyrings/ros-archive-keyring.gpg", "elapsed": 0, "gid": 0, "group": "root", "mode": "01204", "msg": "Request failed: <urlopen error [Errno 111] Connection refused>", "owner": "root", "size": 1167, "state": "file", "uid": 0, "url": "https://raw.githubusercontent.com/ros/rosdistro/master/ros.key"}

与ROS 2 GPG 密钥访问链接失败有关,第一种解决方案是使用VPN;第二中解决方案需要查找raw.githubusercontent.com的IP地址并修改/etc/hosts,参考链接

配置工作空间

创建src目录并克隆存储库,使用vcstool创建工作空间

powershell 复制代码
cd autoware
mkdir src
vcs import src < autoware.repos

安装ROS依赖包

powershell 复制代码
source /opt/ros/humble/setup.bash
# Make sure all previously installed ros-$ROS_DISTRO-* packages are upgraded to their latest version
sudo apt update && sudo apt upgrade
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

安装和配置ccache,加快连续build

powershell 复制代码
# 安装ccache
sudo apt update && sudo apt install ccache

# 创建ccache的配置文件
mkdir -p ~/.cache/ccache
touch ~/.cache/ccache/ccache.conf

# 设置最大缓存大小
echo "max_size = 60G" >> ~/.cache/ccache/ccache.conf
powershell 复制代码
# 将下面内容加入到 `~/.bashrc` 文件中
export CC="/usr/lib/ccache/gcc"
export CXX="/usr/lib/ccache/g++"
export CCACHE_DIR="$HOME/.cache/ccache/"
powershell 复制代码
# 验证ccache是否可以正常运行
# # 查看此项:Cache size (GB): 0.00 / 60.00 (0.00 %)
source ~/.bashrc
ccache -s

构建工作空间,Autoware使用colon构建工作空间

powershell 复制代码
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release

设置控制台

默认情况下,ROS2的日志不会对输出着色。为了着色,需要将如下内容添加到~/.bashrc

powershell 复制代码
 export RCUTILS_COLORIZED_OUTPUT=1

为了自定义日志格式,可以将如下内容加入到~/.bashrc

powershell 复制代码
export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})"
相关推荐
稳稳C913 分钟前
02|Langgraph | 从入门到实战 | workflow与Agent
人工智能·langchain·agent·langgraph
聚梦小课堂13 分钟前
2025年11月4日 AI快讯
人工智能·新闻资讯·ai大事件
Dev7z14 分钟前
基于ResNet50和PyTorch的猫狗图像分类系统设计与实现
人工智能·pytorch·分类
lybugproducer16 分钟前
深度学习专题:模型训练的数据并行(三)
人工智能·深度学习·概率论
Gloria_niki22 分钟前
图像分割深度学习学习总结
人工智能
武子康1 小时前
AI研究-118 具身智能 Mobile-ALOHA 解读:移动+双臂模仿学习的开源方案(含论文/代码/套件链接)
人工智能·深度学习·学习·机器学习·ai·开源·模仿学习
长桥夜波1 小时前
机器学习日报12
人工智能·机器学习
AI柠檬1 小时前
机器学习:数据集的划分
人工智能·算法·机器学习
诸葛务农1 小时前
光刻胶分类与特性——g/i线光刻胶及东京应化TP-3000系列胶典型配方(上)
人工智能·材料工程
mm-q29152227291 小时前
YOLOv5(PyTorch)目标检测实战:TensorRT加速部署!训练自己的数据集(Ubuntu)——(人工智能、深度学习、机器学习、神经网络)
人工智能·深度学习·机器学习