在Ubuntu20.04下安装Autoware.universe和Carla并进行联合仿真

这篇具有很好参考价值的文章主要介绍了在Ubuntu20.04下安装Autoware.universe和Carla并进行联合仿真。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

一、安装Carla0.9.13

1、安装 Carla 0.9.13

pip install --user pygame numpy
pip3 install --user pygame numpy
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1AF1527DE64CB8D9
sudo add-apt-repository "deb [arch=amd64] http://dist.carla.org/carla $(lsb_release -sc) main"
sudo apt-get update
sudo apt-get install carla-simulator=0.9.13

二、安装 UnrealEngine 4.26

1、进入UE网页,按照顺序完成以下6步。

https://www.unrealengine.com/en-US/ue-on-github

在Ubuntu20.04下安装Autoware.universe和Carla并进行联合仿真
2、进入EpicGame的Github
https://github.com/EpicGames

点击UnrealEngine
在Ubuntu20.04下安装Autoware.universe和Carla并进行联合仿真

2、直接clone出来是最新版,需要设置classic token,可以参考:
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

在Ubuntu20.04下安装Autoware.universe和Carla并进行联合仿真
3、复制密钥后,下载UnrealEngine

git clone --depth 1 -b carla https://github.com/CarlaUnreal/UnrealEngine.git ~/UnrealEngine_4.26

输入用户名和刚才的密钥

4、编译

cd UnrealEngine_4.26/
./Setup.sh
./GenerateProjectFiles.sh
make

make时报以下错:
ERROR: Platform Linux is not a valid platform to build. Check that the SDK is installed properly.
可以参考:
在编译UnrealEngine4.26时报错:ERROR: Platform Linux is not a valid platform to build. Check that the SDK is

5、检查是否安装成功

cd UnrealEngine_4.26/Engine/Binaries/Linux 
./UE4Editor

6、添加环境变量

echo "export UE4_ROOT=~/UnrealEngine_4.26" >> ~/.bashrc

三、安装Autoware.universe

在第3步自动安装依赖时,可以将ROS2 Galactic一并安装,也可以提前自己手动安装,参考如下:

在Ubuntu20.04下安装ROS2 Galactic

1、安装git

sudo apt-get -y update
sudo apt-get -y install git

2、克隆Autoware到本地

mkdir autoware_universe
cd autoware_universe/
git clone https://github.com/autowarefoundation/autoware.git -b galactic

3、自动安装相关依赖

cd autoware
./setup-dev-env.sh

如果有以下报错:
The following packages have unmet dependencies:“, " cuda-drivers : Depends: cuda-drivers-530 (= 530.30.02-1) but it is not going to be installed”]}

解决办法:

在Ubuntu20.04下安装Autoware.universe使用命令安装依赖时报错

4、创建 src 文件夹

mkdir src

5、修改 autoware.repos 文件

sudo gedit autoware.repos

在autoware.repos 文件中,28行位置加入以下内容

universe/external/open_planner:
    type: git
    url: https://github.com/ZATiTech/open_planner.git
    version: main

6、下载代码库到本地

vcs import src < autoware.repos

7、安装 Autoware 依赖包

rosdep update --include-eol-distros
source /opt/ros/galactic/setup.bash
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

在安装open3d时速度慢,报错,可以参考:
安装ROS依赖时,安装open3d速度慢,报错问题

遇到 Invalid version: ‘0.23ubuntu1’ (package: distro-info) 报错问题,可以参考:
安装ROS依赖时,Invalid version: ‘0.23ubuntu1报错

8、编译工作空间

colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release

在编译过程中卡死或者崩溃,或者其他问题,可以参考:

https://autowarefoundation.github.io/autoware-documentation/galactic/support/troubleshooting/#build-issues

四、设置 OpenPlanner

1、下载代码

cd ~/autoware_universe
mkdir op_carla
cd op_carla/
git clone https://github.com/hatem-darweesh/op_bridge.git -b ros2
git clone https://github.com/hatem-darweesh/op_agent.git -b ros2
git clone https://github.com/hatem-darweesh/scenario_runner.git

2、从google drive上下载Town01.pcdTown01.osm地图。

https://drive.google.com/drive/folders/1Or0CMS08AW8XvJtzzR8TfhqdY9MMUBpS

以下网盘链接中只有Town01.pcdTown01.osm地图,可供下载。

链接:https://pan.baidu.com/s/1xhUj71nMniECfQrM2MniPw
提取码:i4ll

创建 Town01 文件夹,将 Town01.pcd 和 Town01.osm 复制到Town01_map 文件夹中。
Town01.pcd重命名为pointcloud_map.pcd
Town01.osm重命名为lanelet2_map.osm

3、修改 run_exploration_mode_ros2.sh 文件

sudo gedit ~/autoware_universe/op_carla/op_bridge/op_scripts/run_exploration_mode_ros2.sh

在第8行
如果不在同一台电脑上运行仿真,需要设置运行仿真的电脑的 IP 地址。如下:
export SIMULATOR_LOCAL_HOST=“192.168.11.5”
如果在本机上运行仿真需要修改为:
export SIMULATOR_LOCAL_HOST=“localhost”

3、修改 start_ros2.sh 文件

sudo gedit ~/autoware_universe/op_carla/op_agent/start_ros2.sh 

在第15行
按照实际的安装路径修改。
source /home/username/autoware_universe/autoware/install/setup.bash
在第18行
按照实际的安装路径修改launch文件路径,按照Town01的路径修改map_path。
ros2 launch /home/username/autoware_universe/autoware/src/launcher/autoware_launch/autoware_launch/launch/autoware.launch.xml map_path:=/home/username/autoware_universe/autoware/src/${map_name} vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit

4、修改 autoware.launch.xml 文件

sudo gedit ~/autoware_universe/autoware/src/launcher/autoware_launch/autoware_launch/launch/autoware.launch.xml

在第11行
添加如下:

<arg name="launch_carla_interface" default="true" description="convert carla sensor data to autoware suitable format"/>

在第17行
launch_sensing_driver中的true改成false,可以直接复制以下替换第17行。

  <arg name="launch_sensing_driver" default="false" description="launch sensing driver"/>

在第23行
use_sim_time中的false改成true,可以直接复制以下替换第23行。

<arg name="use_sim_time" default="true" description="use_sim_time"/>

在第52行
添加如下:

  <!-- CARLA -->
    <group if="$(var launch_carla_interface)">
		<node pkg="carla_pointcloud" exec="carla_pointcloud_node" name="carla_pointcloud_interface" output="screen"/>
	</group>

5、修改 gnss.launch.xml 文件

sudo gedit ~/autoware_universe/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_launch/launch/gnss.launch.xml 

在第4行
coordinate_system中的1改成2,可以直接复制以下替换第4行。

<arg name="coordinate_system" default="2" description="0:UTM, 1:MGRS, 2:PLANE"/>

在第5行
添加如下:

<arg name="plane_zone" default="0"/>

5、修改 sensor_kit_calibration.yaml 文件

sudo gedit ~/autoware_universe/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensor_kit_calibration.yaml 

由于修改较多,可以直接全部替换:

sensor_kit_base_link:
  camera0/camera_link:
    x: 0.7
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  camera1/camera_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  camera2/camera_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  camera3/camera_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  camera4/camera_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  camera5/camera_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  traffic_light_right_camera/camera_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  traffic_light_left_camera/camera_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  velodyne_top_base_link:
    x: 0.0
    y: 0.0
    z: 0.8
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  velodyne_left_base_link:
    x: -0.5
    y: 0.0
    z: 0.8
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  velodyne_right_base_link:
    x: 0.5
    y: 0.0
    z: 0.8
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  gnss_link:
    x: 0.0
    y: 0.0
    z: 0.8
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  tamagawa/imu_link:
    x: 0.0
    y: 0.0
    z: 0.8
    roll: 0.0
    pitch: 0.0
    yaw: 0.0

6、修改 sensors_calibration.yaml 文件

sudo gedit ~/autoware_universe/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensors_calibration.yaml 

由于修改较多,可以直接全部替换:

base_link:
  sensor_kit_base_link:
    x: 0.0
    y: 0.0
    z: 1.6
    roll: 0.0
    pitch: 0.0
    yaw: 0.0
  velodyne_rear_base_link:
    x: 0.0
    y: 0.0
    z: 0.0
    roll: 0.0
    pitch: 0.0
    yaw: 0.0

7、修改环境变量

sudo gedit ~/.bashrc

根据安装位置修改路径后,再添加到环境变量中。

export CARLA_ROOT=/opt/carla-simulator
export SCENARIO_RUNNER_ROOT=/home/username/autoware_universe/op_carla/scenario_runner
export LEADERBOARD_ROOT=/home/username/autoware_universe/op_carla/op_bridge
export TEAM_CODE_ROOT=/home/username/autoware_universe/op_carla/op_agent
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/util
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/agents
export PYTHONPATH=$PYTHONPATH:$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.13-py3.8-linux-x86_64.egg

五、运行Carla和Autoware

cd $CARLA_ROOT
./CarlaUE4.sh -quality-level=Epic -world-port=2000 -resx=800 -resy=600

在Ubuntu20.04下安装Autoware.universe和Carla并进行联合仿真

再打开一个终端:

cd ~/autoware_universe/op_carla/op_bridge/op_scripts
source ~/autoware_universe/autoware/install/setup.bash
./run_exploration_mode_ros2.sh

如果报错,需要什么依赖,安装什么依赖:

pip install py-trees
pip install networkx
pip install tabulate
sudo apt-get install ros-galactic-sensor-msgs-py

在Ubuntu20.04下安装Autoware.universe和Carla并进行联合仿真

完成以上,可以实现选择终点,自动路径规划,自动寻迹,如果想加入NPC车辆测试感知,可以查看下面的博客。

在Carla+Autoware.universe仿真中加入NPC车辆文章来源地址https://www.toymoban.com/news/detail-413805.html

到了这里,关于在Ubuntu20.04下安装Autoware.universe和Carla并进行联合仿真的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【基于Ubuntu20.04的Autoware.universe安装过程】方案二:双系统 | 详细记录 | 全过程图文 by.Akaxi

    目录 一、Autoware.universe背景 Part-1:安装双系统教程 二、查看Windows引导方式 三、制作安装盘 四、设置电脑配置 1.关闭bitlocker 2.压缩硬盘分区 3.关闭Secure Boot 4.关闭intel RST 5.BIOS设置U盘引导 五、安装Ubuntu20.04 1.ventoy引导 2.安装配置 3.安装类型 4.完成安装 Part-2:在Ubuntu20.04上安装

    2024年04月11日
    浏览(49)
  • Carla 安装详细教程 —— Ubuntu 20.04 安装 Carla

    自动驾驶算法的调试和效果评测首先要在仿真环境中去做,因此,一个强大、灵活的仿真环境是开发、测试过程中必不可少的要素。我们在查找可用的仿真工具时主要关注以下几个特性: 开源,免费; 包含高速场景; 可以便捷的控制、切换场景的环境,且场景、环境尽可能

    2024年02月03日
    浏览(36)
  • Ubuntu20.04安装Carla0.9.15

    系统配置要求: 至少3G显存的GPU,推荐3060及以上的显卡进行Carla拟真。 预留足够的硬盘空间,推荐50G以上。 Ubuntu 14.04/16.04/18.04/20.04版本。 本教程使用的是压缩包下载方式(个人感觉这种方式比较方便),下载链接如右所示: https://github.com/carla-simulator/carla/releases 选择 [Ubun

    2024年02月22日
    浏览(45)
  • 【carla】ubuntu20.04 编译carla-ros-bridge 安装过程、报错及其解决方法

    下载后进行catkin_make会报错3个错误 Create a catkin workspace: Clone the ROS Bridge repository and submodules: Set up the ROS environment according to the ROS version you have installed: Install the required ros-dependencies: 安装rosdepc,然后运行: 7.创建虚拟环境 8.安装pip依赖 方法1:在conda环境中安装empy: conda instal

    2024年02月11日
    浏览(44)
  • ubuntu20.04 安装carla0.9.13预编译版以及carla ros bridge

    因为之前使用Anaconda的python3.7环境下,不论是carla0.9.11还是carla0.9.13都出现启动下面这个ros bridge的launch时会导致carla卡死,且在网上也未搜索到相关解决方案,换用ubuntu18.04安装时在安装ubuntu18.04的过程中出现没有安装类型选项,故想尝试直接在ubuntu20.04的python3.8环境下进行安装

    2024年01月23日
    浏览(52)
  • ubuntu20.04安装Carla并配置罗技G29方向盘使用

    环境 :ubuntu20.04+anaconda+python3.7+ros2 foxy+Logitech g29 一、安装Carla github地址: https://github.com/carla-simulator/carla 安装文档: https://carla.readthedocs.io/en/0.9.13/ 安装的版本:0.9.13 主要步骤: 1.1 将0.9.13版本的Carla安装包下载到本地并解压CARLA_0.9.13.tar.gz 1.2 测试是否能正常启动 有画面弹出说

    2023年04月24日
    浏览(39)
  • 【Ubuntu 20.04LTS系统】安装CUDA11.8、cuDNN,可进行CUDA版本切换

    https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ 更新软件列表和必要的依赖项 步骤一: 下载CUDA安装包 进行CUDA和cuDNN的选择,也可以直接根据官方推荐进行下载安装。 从Nvidia官网下载CUDA https://developer.nvidia.com/cuda-downloads 下方链接,选择更多版本 https://developer.nvidia.com/cuda-toolkit-archiv

    2024年02月16日
    浏览(52)
  • Ubuntu 20.04 LTS 系统下 安装Nvidia 显卡驱动、CUDA、cuDNN, 并可进行CUDA版本切换

    因为做深度学习的研究项目,为全新机器在Ubuntu 20.04 LTS 系统下 安装Nvidia 显卡驱动、Cuda、Cudnn。并进行CUDA版本切换 成功安装完成了,写个记录。 步骤一: 安装更新软件列表和依赖项 在安装Nvidia显卡驱动之前,需要更新软件列表和必要的依赖项。 步骤二: 查看GPU型号,并

    2024年02月13日
    浏览(50)
  • 【Ubuntu20.04】使用 systemd 进行服务部署

    ExecStart,改成自己脚本的路径,比如程序启动脚本 Restart,异常重启 RestartSec,异常后多少秒后重启 StartLimitInterval,异常后重试多少次,0 一直重试 将上述文件命名为 your_app.serivce ,放入 /etc/systemd/system 目录下 比如,你的服务名称叫 your_app 服务启用 服务启动 服务重新启动

    2024年04月25日
    浏览(27)
  • Ubuntu 20.04 安装宋体

    环境:         ubuntu 20.04,英文环境,但已经安装中文包 检查ubuntu中安装的中文字体 命令: fc-list :lang=zh 检查ubuntu中安装的所有字体 命令: fc-list 宋体下载: Simsun Font - Free Fonts 网盘分享:链接: https://pan.baidu.com/s/12fSpgkUWuWsh-OU32q1WCA 提取码: wpia 或者从win10上拷贝,但是拷贝的

    2024年02月10日
    浏览(35)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包