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
报错与解决
-
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "jsk_rviz_plugins"
with any of the following names:jsk_rviz_pluginsConfig.cmake
jsk_rviz_plugins-config.cmakeAdd the installation prefix of "jsk_rviz_plugins" to CMAKE_PREFIX_PATH or
set "jsk_rviz_plugins_DIR" to a directory containing one of the above
files. If "jsk_rviz_plugins" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)
解决:sudo apt-get install ros-melodic-jsk-rviz-plugins
- /home/mk/myslam/opencv-3.1.0/modules/viz/src/clouds.cpp:80:13: error: ‘class vtkPolyDataMapper’ has no member named ‘ImmediateModeRenderingOff’
mapper->ImmediateModeRenderingOff();
解决: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
网友评论