【自动驾驶】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})"
相关推荐
Moshow郑锴5 小时前
人工智能中的(特征选择)数据过滤方法和包裹方法
人工智能
TY-20255 小时前
【CV 目标检测】Fast RCNN模型①——与R-CNN区别
人工智能·目标检测·目标跟踪·cnn
CareyWYR6 小时前
苹果芯片Mac使用Docker部署MinerU api服务
人工智能
地平线开发者7 小时前
ReID/OSNet 算法模型量化转换实践
算法·自动驾驶
失散137 小时前
自然语言处理——02 文本预处理(下)
人工智能·自然语言处理
地平线开发者7 小时前
开发者说|EmbodiedGen:为具身智能打造可交互3D世界生成引擎
算法·自动驾驶
mit6.8247 小时前
[1Prompt1Story] 滑动窗口机制 | 图像生成管线 | VAE变分自编码器 | UNet去噪神经网络
人工智能·python
sinat_286945197 小时前
AI应用安全 - Prompt注入攻击
人工智能·安全·prompt
迈火8 小时前
ComfyUI-3D-Pack:3D创作的AI神器
人工智能·gpt·3d·ai·stable diffusion·aigc·midjourney
Moshow郑锴9 小时前
机器学习的特征工程(特征构造、特征选择、特征转换和特征提取)详解
人工智能·机器学习