系统环境
- 系统版本:Ubuntu20.04.06 LTS
- ROS版本:ROS foxy
- Doker版本:26.0.1
使用流程
安装方式——Docker安装
- 一、安装Docker
- 二、 安装autoware的容器环境管理工具ADE
按照官方文档,执行以下指令$ cd ~/.local/bin #仅限当前用户使用,或者cd /usr/local/bin 所有用户均可使用 $ wget https://gitlab.com/ApexAI/ade-cli/-/jobs/1341322851/artifacts/raw/dist/ade+x86_64 $ mv ade+x86_64 ade $ chmod +x ade $ ./ade --version # 若返回不是4.4版本,则执行下面的更新操作 $ ./ade update-cli $ ./ade --version <latest-version>
遇到的错误:使用
./ade --version
时报错~/adehome$ ade --version Error relocating /lib/x86_64-linux-gnu/libz.so.1: crc32_z: symbol not found Error relocating /lib/x86_64-linux-gnu/libz.so.1: __snprintf_chk: symbol not found Error relocating /lib/x86_64-linux-gnu/libz.so.1: __vsnprintf_chk: symbol not found
zlib1g
包出现错误,libz.so.1
连接的库文件版本过低,经测试需要1.2.12
以上版本(后话)。使用apt
工具更新时找不到更新的包(可能是LTS版本仓库没有?),由于害怕此系统库文件版本变化后可能出现一些莫名错误(以前系统莫名崩过一次,一朝被蛇咬十年怕井绳),因此就不采取源代码编译更新或者增加PPA仓库更新了。~/adehome$ ll /lib/x86_64-linux-gnu/libz.so.1 lrwxrwxrwx 1 root root 36 4月 18 20:31 /lib/x86_64-linux-gnu/libz.so.1 -> /lib/x86_64-linux-gnu/libz.so.1.2.11 ~/adehome$ sudo apt-get update ~/adehome$ sudo apt-get install zlib1g Reading package lists... Done Building dependency tree Reading state information... Done zlib1g is already the newest version (1:1.2.11.dfsg-2ubuntu1.5). 0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.
由于我安装了Anaconda,其自带一些符合版本的libz库文件,使用
locate
进行搜索,可以使用我的虚拟环境ForCarla
下的libz库文件与ade链接。实现方式有如下:1. 通过将/lib/x86_64-linux-gnu/libz.so.1
软链接到虚拟环境中的该libz库文件(试过可行,但怕系统出问题所以选择另一种方法)。2. 修改LD_LIBRARY_PATH
变量实现,缺点是每次打开一个终端都要修改该变量,但可以写到bash脚本里刷新环境变量启动进入autoware容器一步到位。~/adehome$ locate libz.so.1.2 ~/anaconda3/envs/ForCarla/lib/libz.so.1.2.12 ~/anaconda3/lib/libz.so.1.2.11 ... # ~/adehome$ ln -sf ~/anaconda3/envs/ForCarla/lib/libz.so.1.2.12 /lib/x86_64-linux-gnu/libz.so.1 # 第一种方法 export LD_LIBRARY_PATH=~/anaconda3/envs/ForCarla/lib/libz.so.1.2.12:$LD_LIBRARY_PATH # 第二种方法 ~/adehome$ ade --version 4.4.0
-
三、创建autoware.auto容器
跟随ADE教程,参考2中课程默认启动的是ROS Dashing版本的容器,而当前其默认启动的是Foxy版本的容器,可以通过ls -l .aderc*
查看存在的容器配置进行选择,默认配置是.aderc-amd64-foxy
,我使用的是.aderc-amd64-foxy-lgsvl
。我在默认配置下后面编译的时候会出问题,lgsvl相关的包编译不会通过。
使用exit
退出容器。ade stop
会停止容器,容器中的数据可能会丢失。$ mkdir -p ~/adehome $ cd ~/adehome $ touch .adehome $ cd ~/adehome $ git clone https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git $ cd AutowareAuto $ git checkout tags/1.0.0 -b release-1.0.0 $ cd ~ $ cp ~/.bashrc ~/.bashrc.bak $ mv ~/.bashrc ~/adehome/.bashrc $ ln -s ~/adehome/.bashrc $ cd AutowareAuto $ ls -l .aderc* $ ade --rc .aderc-amd64-foxy-lgsvl start --update --enter ade$ exit
-
四、 Autoware使用
进入容器进行编译
$ ade enter ade$ cd AutowareAuto ade$ colcon build ade$ colcon test ade$ colcon test-result
下载记录好的雷达数据文件,克隆参考2中课程运行案例的一些配置文件,再启动案例,由于参考2中使用的是Dashing,所以需要修改一些command,创建一个my_launch_test功能包,编写launch文件,需注意的是,在
point_cloud_filter_transform_node_exe
所运行的节点中需要重映射两个话题名,订阅话题points_in
->/lidar_front/points_raw
,发布话题points_filtered
->/perception/points_in
# test01.launch.py from launch import LaunchDescription from launch_ros.actions import Node # 参数声明与获取----------------- from launch.actions import DeclareLaunchArgument from launch.substitutions import LaunchConfiguration def generate_launch_description(): urdf_file = "/opt/AutowareAuto/share/lexus_rx_450h_description/urdf/lexus_rx_450h.urdf" with open(urdf_file, 'r') as infp: robot_desc = infp.read() return LaunchDescription([ DeclareLaunchArgument(name="rviz_file", default_value="/home/tyaochen/autowareclass2020/code/src/01_DevelopmentEnvironment/aw_class2020.rviz"), # DeclareLaunchArgument(name="urdf_file", default_value="/opt/AutowareAuto/share/lexus_rx_450h_description/urdf/lexus_rx_450h.urdf"), DeclareLaunchArgument(name="velodyne_cfg", default_value="/home/tyaochen/autowareclass2020/code/src/01_DevelopmentEnvironment/velodyne_node.param.yaml"), DeclareLaunchArgument(name="filter_cfg", default_value="/opt/AutowareAuto/share/point_cloud_filter_transform_nodes/param/vlp16_sim_lexus_filter_transform.param.yaml"), Node( package="rviz2", executable="rviz2", arguments=["-d", LaunchConfiguration("rviz_file")], ), Node( package="velodyne_nodes", executable="velodyne_cloud_node_exe", namespace="/lidar_front", arguments=["--model", "vlp16"], parameters=[LaunchConfiguration("velodyne_cfg")] ), Node( package="robot_state_publisher", executable="robot_state_publisher", parameters=[{ "robot_description": robot_desc }] ), Node( package="point_cloud_filter_transform_nodes", executable="point_cloud_filter_transform_node_exe", namespace="/lidar_front", parameters=[LaunchConfiguration("filter_cfg")], name="filter_transform_vlp16_front", remappings=[("points_filtered", "/perception/points_in"), ("points_in", "/lidar_front/points_raw")] ) ])
参考
-
- Autoware.auto的gitlab仓库
-
- Apex.AI的Autoware教程系列视频