目录
- 前言
- 一、准备工作
- 1.安装autoware1.15
- 2.安装依赖
- 3.把`src/autoware/common/autoware_build_flags/cmake`文件夹下的CUDA版本改为11.4(或者你电脑上的版本)
- 二、解决报错
- 错误类型1
- 错误类型2
- 错误类型3
- 错误类型4
- 错误类型5
- 错误类型6
前言
本文参考链接:Ubuntu18.04安装Autoware1.15(解决Openplanner无法绕障的问题:Openplanner2.5)
因为电脑已经安装过autoware1.14版本,所以一些环境以及库都装过,就不再此介绍了,autoware所需要的一些环境可以参考以下两篇链接
Ubuntu18.04安装autoware 1.14(GPU版) 完整教程(包含环境搭建)
工控机(arm + ubuntu18.04)搭建Autoware 1.14环境以及源码编译(GPU版)详细步骤外加官方demo运行
一、准备工作
1.安装autoware1.15
autoware1.15地址:https://github.com/hatem-darweesh/autoware.ai.openplanner
新建文件夹
mkdir -p autoware.ai.openplanner.1.15/src
将上述链接中的文件下载下来,将openplanner.1.15.repos
文件放到autoware.ai.openplanner.1.15
文件夹下,然后打开终端输入
vcs import src < openplanner.1.15.repos
2.安装依赖
sudo apt-get install libnl-3-dev libnl-genl-3-dev
sudo apt-get install ros-melodic-tvm-vendor
sudo apt-get install ros-melodic-lanelet2-io ros-melodic-lanelet2-core ros-melodic-lanelet2-maps ros-melodic-lanelet2-projection ros-melodic-lanelet2-routing ros-melodic-lanelet2-validation
3.把src/autoware/common/autoware_build_flags/cmake
文件夹下的CUDA版本改为11.4(或者你电脑上的版本)
二、解决报错
错误类型1
undefined reference to cv::Mat::Mat()
解决办法:按照下面方式改相应包的CMakeLists.txt
find_package(OpenCV 3.4 REQUIRED)
include_directories(
${OpenCV_INCLUDE_DIRS}
)
target_link_libraries(target ${OpenCV_LIBS})
需要修改的包汇总:calibration_publisher
,data_preprocessor
,integrated_viewer
,object_map
,points_preprocessor
,trafficlight_recognizer
错误类型2
error: could not convert 'cv::Scalar_<double>((double)0,(double)255,(double)255,(double)0,)' from 'cv::Scalar {aka cv::Scalar_<double>}' to 'CvScalar' error:conversion from 'cv::Mat' to non-scalar type 'IplImage {aka _IplImage}' requested
将CV_RGB
改为cvScalar
使用cvIplImage()
函数将类型转换一下:
需要修改的文件汇总:vision_lane_detect.cpp
,vision_darknet_detect.cpp
,region_tlr.cpp
,op_tlr_core.cpp
错误类型3
error: conversion from ‘cv::Mat’ to non-scalar type ‘CvMat’ requested
将报错那句改为:
CvMat* cvmat;
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);
}
需要修改的文件汇总:detection.h
错误类型4
error: no match for ‘operator=’ (operand types are ‘CvPoint’ and ‘cv::Point {aka cv::Point_<int>}
按照下面的修改
// textOrg = cv::Point(ctx.topLeft.x, ctx.botRight.y + baseline);
textOrg = cvPoint(ctx.topLeft.x, ctx.botRight.y + baseline);
需要修改的文件汇总:region_tlr.cpp
错误类型5
/usr/local/cuda-11.4/include/cudnn.h:61:10: fatal error: cudnn_ops_infer.h: No such file or directory CMake Error at op_tlr_generated_network_kernels.cu.o.Release.cmake:225 (message):
在Autoware1.14环境配置时,安装cuDNN时,需要把所有的头文件都复制过去:
# sudo cp include/cudnn.h /usr/local/cuda/include/
sudo cp include/cudnn*.h /usr/local/cuda/include/
错误类型6
/usr/bin/ld: cannot find -lcudart /usr/bin/ld: cannot find -lcublas /usr/bin/ld: cannot find -lcurand /usr/bin/ld: cannot find -lcudnn
发现是Cmakelists.txt中CUDA的库文件包含路径错误,在op_tlr包中改成自己的CUDA版本