【Autoware1.12】源码编译

2021-03-10  本文已影响0人  ClarkWang1214

Ubuntu1804安装编译Autoware1.12

安装依赖项
sudo apt-get update
sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin libmosquitto-dev
# CUDA10.0
sudo apt install nvidia-cuda-toolkit 
# Eigen3.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 && sudo make install 
下载Autoware-ai
git clone https://github.com/Autoware-AI/autoware.ai 
cd autoware.ai  && mkdir src && cd ..
#autoware.ai.repos中的内容拷贝到src目录中
vcs import src < autoware.ai.repos 
编译

with cuda

$ AUTOWARE_COMPILE_WITH_CUDA=1 colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

without cuda

$ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

报错与解决

解决:sudo apt-get install ros-melodic-jsk-rviz-plugins

解决:VTK版本太高,降低版本,卸载当前版本安装VTK7.1.1

在src目录下面搜索calibration_publisher.cpp文件所在的CMakeLists.txt文件并打开,

报错

CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "grid_map_cv" with
any of the following names:

grid_map_cvConfig.cmake
grid_map_cv-config.cmake

Add the installation prefix of "grid_map_cv" to CMAKE_PREFIX_PATH or set
"grid_map_cv_DIR" to a directory containing one of the above files. If
"grid_map_cv" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)

解决:
sudo apt-get install ros-melodic-grid-map

error1: could not convert ‘cv::Scalar

这类错误主要是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);

error2:error: conversion from ‘cv::Mat’

/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;

error3:error: no match for ‘operator=’

/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;

error4: conversion from ‘cv::Mat’ to non-scalar type ‘CvMat’

/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;

解决
1.在src目录搜索vision_lane_detect.cpp文件,修改其中第514行代码:
CV_RGB(255, 255, 0) ---> cvScalar(255, 255, 0)

2.修改vision_lane_detect.cpp文件的第544行中:
IplImage frame = cv_image->image;-----> IplImage frame = cvIplImage(cv_image->image);

3.修改vision_darknet_detect.cpp文件的第228行:
ipl_image = final_mat; 为 ipl_image = cvIplImage(final_mat);

4.修改detection.h文件的第234行

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);
Screenshot from 2021-03-23 16-21-31.png Screenshot from 2021-03-23 16-21-13.png Screenshot from 2021-03-23 16-20-08.png Screenshot from 2021-03-23 16-19-50.png Screenshot from 2021-03-23 16-19-28.png
Screenshot from 2021-03-23 16-32-59.png Screenshot from 2021-03-23 16-31-54.png Screenshot from 2021-03-23 16-31-25.png
上一篇下一篇

猜你喜欢

热点阅读