ubuntu 18.04 安装 AutoWare 1.14.0(附踩坑指南)

ubuntu 18.04 安装 AutoWare 1.14.0(附踩坑指南)

1、安装autoware 1.14.0

参考官方文档:https://github.com/Autoware-AI/autoware.ai/wiki/Source-Build

1.1、安装依赖项:

一、安装cmake 3.12.2以上版本

通过软链接的方式更新cmake,不需要删除卸载老版的cmake(主要是老版cmake关联了太多的库,不好卸载)

文件下载:wget https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz
解压:tar zxvf cmake-3.12.2-Linux-x86_64.tar.gz
创建软连接:先检查解压后的cmake文件路径,我的在home/buddy-x/ThirdPart下:sudo ln -sf /home/wml/cmake-3.12.2-Linux-x86_64/bin/* /usr/bin/
能检查出cmake --version说明cmake安装成功: cmake --version
ubuntu 18.04 安装 AutoWare 1.14.0(附踩坑指南)

二、System dependencies for Ubuntu 18.04 / Melodic

sudo apt update
sudo apt install -y python-catkin-pkg python-rosdep ros-$ROS_DISTRO-catkin
sudo apt install -y python3-pip python3-colcon-common-extensions python3-setuptools python3-vcstool
pip3 install -U setuptools

三、安装 CUDA 10.2

For installation instructions for CUDA 10.0, see https://docs.nvidia.com/cuda/archive/10.0/cuda-installation-guide-linux/index.html.

四、安装Eigen 3.3.7

cd && wget http://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz
mkdir eigen && tar --strip-components=1 -xzvf 3.3.7.tar.gz -C eigen 
cd eigen && mkdir build && cd build && cmake .. && make && make install 
cd && rm -rf 3.3.7.tar.gz && rm -rf eigen 

编译autoware1.14.0要求eigen库版本要在3.3.7以上
编译安装3.3.7的具体步骤参考autoware github上编译步骤
编译完成后需要更新eigein的系统cmake配置信息

系统的eigen版本查看方式:

vim /usr/include/eigen3/Eigen/src/Core/util/Macros.h

更新eigen系统信息:(假设安装的路径为:/usr/local/include)

#删除系统自带的eigen版本,原版为3.3.4
sudo rm -rf /usr/local/include/eigen3
sudo rm -rf /usr/local/include/Eigen

#拷贝新版本3.3.7至系统默认目录
sudo cp -r /usr/local/include/eigen3/Eigen /usr/include
sudo cp -r /usr/local/include/eigen3 /usr/include

#删除新版本3.3.7
sudo rm -rf /usr/local/include/eigen3
sudo rm -rf /usr/local/include/Eigen

#在/usr/local/include目录创建新版本软连接
sudo ln -s /usr/include/eigen3 /usr/local/include/eigen3
sudo ln -s /usr/include/Eigen/ /usr/local/include/Eigen

#更新cmake库链接
cd /usr/lib/cmake/eigen3

# 删除旧版cmake配置信息
sudo rm ./*
# 编译的eigen库安装路径为/usr/local/share/eigen3
sudo cp /usr/local/share/eigen3/cmake/* ./

#更新系统数据库
sudo updatedb

五、安装protobuf

安装官方wiki安装即可https://github.com/protocolbuffers/protobuf/blob/master/src/README.md

2、编译错误处理

2.1、ndt_gpu中CUDA报错:

修改CUDA相关的版本检查参数
修改文件为:
autoware.ai/src/autoware/common/autoware_build_flags/cmake/autoware_build_flags-extras.cmake
修改后的结果为:
ubuntu 18.04 安装 AutoWare 1.14.0(附踩坑指南)
将CUDA版本号检查由≤10.0修改为≤10.2,则可以编译通过生成NDT_GPU

2.2、lpthread报错

编译到ros_observer时,会报出如下错误:
/usr/bin/ld: CMakeFiles/ros_observer.dir/src/ros_observer.cpp.o: undefined reference to symbol ‘pthread_mutexattr_settype@@GLIBC_2.2.5’
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
打开autoware/common/ros_observer/CMakeLists.txt,在所有的target_link_libraries中,加入libpthread.so.0,再编译即可通过。

2.3、OpenCV报错

这类错误主要是opencv版本不兼容导致的,即opencv2风格的代码与opencv3风格代码混用导致,根据报错逐一修改即可。
error1:
/home/fengbro/autoware.ai/src/autoware/core_perception/vision_lane_detect/nodes/vision_lane_detect/vision_lane_detect.cpp:514:58: error: could not convert ‘cv::Scalar_((double)0, (double)255, (double)255, (double)0)’ from ‘cv::Scalar {aka cv::Scalar_}’ to ‘CvScalar’
cvPoint(frame_size.width/2, frame_size.height), CV_RGB(255, 255, 0), 1);

修改方法:

CV_RGB(255, 255, 0) ---> cvScalar(255, 255, 0)

———————————————————————————————————
error2:
/home/fengbro/autoware.ai/src/autoware/core_perception/vision_lane_detect/nodes/vision_lane_detect/vision_lane_detect.cpp:544:30: error: conversion from ‘cv::Mat’ to non-scalar type ‘IplImage {aka _IplImage}’ requested
IplImage frame = cv_image->image;

修改方法:
在core_perception/vision_lane_detect/nodes/vision_lane_detect/vision_lane_detect.cpp:544:30:中修改

IplImage frame = cv_image->image;----->	IplImage frame = cvIplImage(cv_image->image);

———————————————————————————————————
error3:
/home/fengbro/autoware.ai/src/autoware/core_perception/vision_darknet_detect/src/vision_darknet_detect.cpp:228:17: error: no match for ‘operator=’ (operand types are ‘IplImage {aka _IplImage}’ and ‘cv::Mat’)
ipl_image = final_mat;

修改方法:

修改	ipl_image = final_mat; 为 ipl_image = cvIplImage(final_mat);

———————————————————————————————————
error4:
/home/fengbro/autoware.ai/src/autoware/core_perception/vision_beyond_track/include/detection.h:234:21: error: conversion from ‘cv::Mat’ to non-scalar type ‘CvMat’ requested
CvMat cvmat = sum_mat;

修改方法:

for(size_t i=0; i< sum_mat.rows; ++i)
    for(size_t j=0; j< sum_mat.cols; ++j)
{
  ((double*)(cvmat->data.ptr + i*cvmat->step))[j] = sum_mat.at<double>(i,j);
}

———————————————————————————————————
error5:
no match for ‘operator=’ (operand types are ‘CvPoint’ and ‘cv::Point {aka cv::Point_}’)
textOrg = cv::Point(ctx.topLeft.x, ctx.botRight.y + baseline);

修改方法:

textOrg.x = ctx.topLeft.x;
textOrg.y = ctx.botRight.y + baseline;
上一篇:ubuntu18.04源码安装autoware.ai踩坑


下一篇:Autoware的安装及使用