autoware.ai 1.14安装错误

无法定位软件包libjasper-dev的解决办法

1 sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
2 sudo apt update
3 sudo apt upgrade
4 sudo apt install libjasper1 libjasper-dev

通过下面语句进行编译

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

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.cmake

sudo apt-get install ros-melodic-jsk-rviz-plugins

Could not find a package configuration file provided by “nmea_msgs” with any of the following names:

sudo apt-get install ros-melodic-nmea_msgs

Could NOT find pugixml (missing: PUGIXML_LIBRARIES PUGIXML_INCLUDE_DIRS) Call Stack (most recent call first):

sudo apt-get install libpugixml-dev
sudo apt-get install libpugixml1v5

Could not find a package configuration file provided by “nmea_navsat_driver” with any of the following names: nmea_navsat_driverConfig.cmake nmea_navsat_driver-config.cmake

sudo apt-get install ros-melodic-nmea-navsat-driver

CV_WINDOW_AUTOSIZE ,CV_LOAD_IMAGE_UNCHANGED 没有被声明
kitti_player.cpp:879:60: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope

cv::namedWindow(“CameraSimulator Color Viewer”,CV_WINDOW_AUTOSIZE);

kitti_player.cpp:881:60: error: ‘CV_LOAD_IMAGE_UNCHANGED’ was not declared in this scope

cv_image02 = cv::imread(full_filename_image02, CV_LOAD_IMAGE_UNCHANGED);

kitti_player.cpp:986:60: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope

cv_image04 = cv::imread(full_filename_image04, CV_LOAD_IMAGE_GRAYSCALE);

解决办法:

根据报错找到对应的文件,加入命名空间​​using namespace cv;​​

将​​CV_WINDOW_AUTOSIZE​​改为​​WINDOW_AUTOSIZE​​

将​​CV_LOAD_IMAGE_UNCHANGED​​改为 ​​IMREAD_UNCHANGED​​

将​​CV_LOAD_IMAGE_GRAYSCALE​​改为 ​​IMREAD_GRAYSCALE​​

Could not find a package configuration file provided by
“automotive_navigation_msgs” with any of the following names:

automotive_navigation_msgsConfig.cmake
automotive_navigation_msgs-config.cmake
 sudo apt-get install ros-melodic-automotive-navigation-msgs

Could not find a package configuration file provided by
“automotive_platform_msgs” with any of the following names:

automotive_platform_msgsConfig.cmake
automotive_platform_msgs-config.cmake
sudo apt-get install ros-melodic-automotive-platform-msgs

Could NOT find GeographicLib (missing: GeographicLib_LIBRARIES
GeographicLib_INCLUDE_DIRS)

sudo apt-get install libgeographic-dev

No such file or directory#include
stderr: autoware_camera_lidar_calibrator
/home/diyun/autoware.ai/src/autoware/utilities/autoware_camera_lidar_calibrator/src/autoware_camera_lidar_calibration/camera_lidar_calibration_node.cpp:36:12: fatal error: opencv2/contrib/contrib.hpp: No such file or directory
#include

问题出在autoware不兼容高版本的opencv,我是opencv4,不过这种简单的问题比较容易修改。

camera_lidar_calibration_node.cpp中把等于版本3,换成大于

#if (CV_MAJOR_VERSION >= 3)
#include 
#else
#include 
#endif

CMakeFiles/calibration_publisher.dir/src/calibration_publisher.cpp.o: In function cv::internal::VecReaderProxy::operator()(std::vector&, unsigned long) const’: calibration_publisher.cpp:(.text._ZNK2cv8internal14VecReaderProxyIiLi1EEclERSt6vectorIiSaIiEEm[_ZNK2cv8internal14VecReaderProxyIiLi1EEclERSt6vectorIiSaIiEEm]+0x2b): undefined reference tocv::FileNodeIterator::remaining() const’
calibration_publisher.cpp:(.text._ZNK2cv8internal14VecReaderProxyIiLi1EEclERSt6vectorIiSaIiEEm[_ZNK2cv8internal14VecReaderProxyIiLi1EEclERSt6vectorIiSaIiEEm]+0xd8): undefined reference to cv::FileNodeIterator::readRaw(std::__cxx11::basic_string const&, void*, unsigned long)’ CMakeFiles/calibration_publisher.dir/src/calibration_publisher.cpp.o: In functionmain’:
calibration_publisher.cpp:(.text.startup+0x989): undefined reference to cv::FileStorage::FileStorage(std::__cxx11::basic_string const&, int, std::__cxx11::basic_string const&)’ calibration_publisher.cpp:(.text.startup+0xa9c): undefined reference tocv::FileNode::begin() const’
calibration_publisher.cpp:(.text.startup+0xb2b): undefined reference to `cv::read(cv::FileNode const&, std::__cxx11::basic_string&, std::__cxx11::basic_string const&)’
collect2: error: ld returned 1 exit status
make[2]: *** [devel/lib/calibration_publisher/calibration_publisher] Error 1
make[1]: *** [CMakeFiles/calibration_publisher.dir/all] Error 2
make: *** [all] Error 2

解决办法:
修改文件:

/home/xxx/autoware.ai/src/autoware/utilities/calibration_publisher/CMakeLists.txt

target_link_libraries(calibration_publisher
        ${catkin_LIBRARIES}
        ${OpenCV_LIBS}     # added
)

在后面加上${OpenCV_LIBS}即可;

修改文件:

/home/xxx/autoware.ai/src/autoware/utilities/calibration_publisher/package.xml

<depend>cv_bridge</depend>
<depend>image_transport</depend>
<depend>tf</depend>
<depend>libopencv-dev</depend>    # added

在最后加上libopencv-dev即可;

问题:visualize_rects.cpp:112:21: error: ‘CV_AA’ was not declared in this scope

#include 

CV_EPNP没有被声明

将CV_EPNP改为cv::SOLVEPNP_EPNP

问题:Could not find a package configuration file provided by
“velodyne_pointcloud” with any of the following names:

velodyne_pointcloudConfig.cmake
velodyne_pointcloud-config.cmake
sudo apt-get install ros-melodic-velodyne-pointcloud

问题: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
sudo apt-get install ros-melodic-grid-map-cv

问题:Could not find a package configuration file provided by “grid_map_msgs”
with any of the following names:

grid_map_msgsConfig.cmake
grid_map_msgs-config.cmake
sudo apt-get install ros-melodic-grid-map-msgs

问题:Could not find a package configuration file provided by “grid_map_ros” with
any of the following names:

grid_map_rosConfig.cmake
grid_map_ros-config.cmake
sudo apt-get install ros-melodic-grid-map-ros

Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindGLEW.cmake:38 (find_package_handle_standard_args)
CMakeLists.txt:14 (find_package)

sudo apt-get install libglew-dev

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

gps_commonConfig.cmake
gps_common-config.cmake
sudo apt-get install ros-melodic-gps-common

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 改为 cvScalar

error: conversion from ‘cv::Mat’ to non-scalar type ‘IplImage {aka _IplImage}’ requested IplImage frame = cv_image->image;

将最后赋值改写为:

ipl_image = cvIplImage(final_mat);

报错:error: conversion from ‘cv::Mat’ to non-scalar type ‘CvMat’ requested CvMat cvmat = sum_mat;
改写为

 cv::Mat cvmat = sum_mat;

Could not find a package configuration file provided by “qpoases_vendor”
with any of the following names:

qpoases_vendorConfig.cmake
qpoases_vendor-config.cmake
 sudo apt-get install ros-melodic-qpoases-vendor

error: no match for ‘operator=’ (operand types are ‘IplImage {aka _IplImage}’ and ‘cv::Mat’)
ipl_image = final_mat;

ipl_image = cvIplImage(final_mat);

Could not find a package configuration file provided by “geodesy” with any
of the following names:

geodesyConfig.cmake
geodesy-config.cmake
sudo apt-get install ros-melodic-geodesy

error: ‘CV_REDUCE_MIN’ was not declared in this scope

reduce( activedDists, minDists, 0, CV_REDUCE_MIN );

reduce( activedDists, minDists, 0, cv::REDUCE_MIN );

error: ‘generateColors’ is not a member of ‘cv’
cv::generateColors(colors_, color_num_);

解决办法:
将 423行的改为 大于等于3即可

error: ‘CV_STORAGE_READ’ was not declared in this scope
cv::FileStorage cvfs(fileName, CV_STORAGE_READ);

改为cv::FileStorage cvfs(fileName, cv::FileStorage::READ);

error: ‘WriteStructContext’ is not a member of ‘cv’
CV::WriteStructContext st_red(cvfs, “RED”, CV_NODE_MAP);

可以将这段直接注释掉

使用CUDA编译报ndt_gpu错误
修改autoware.ai/src/autoware/common/autoware_build_flags/cmake/autoware_build_flags-extras.cmake文件,将CUDA 10.0改为CUDA 10.2
opencv2/contrib/contrib.hpp:没有那个文件,或报错文件中有opencv版本判断的代码
找到报错文件的判断OpenCV版本代码#if(CV_MAJOR_VERSION==3)改为#if(CV_MAJOR_VERSION>=3),检查一下文件可能有多处判断
CV_WINDOW_AUTOSIZE ,CV_LOAD_IMAGE_UNCHANGED 没有被声明
根据报错找到对应的文件,加入头文件#include
加入命名空间using namespace cv;将CV_LOAD_IMAGE_UNCHANGED改为IMREAD_UNCHANGED
calibration_publisher 包中cv::Mat::Mat()未定义引用
找到包中CMakeLists.txt文件,在链接库中加入${OpenCV_LIBS}
CV_LOAD_IMAGE_GRAYSCALE没有被声明
找到报错文件,将CV_LOAD_IMAGE_GRAYSCALE改为IMREAD_GRAYSCALE
CV_AA , CV_FILLED没有被声明
找到报错文件,在头文件中加入#include
CV_EPNP没有被声明
将CV_EPNP改为cv::SOLVEPNP_EPNP
could not convert ‘cv::Scalar_((double)0, (double)255, (double)255, (double)0)’ from ‘cv::Scalar {aka cv::Scalar_}’ to ‘CvScalar’
将CV_RGB(255, 255, 0)改为cvScalar(255, 255, 0)
cv_image->image报错
将cv_image->image改为cvIplImage(cv_image->image)
ipl_image = final_mat报错
将ipl_image = final_mat改为ipl_image = cvIplImage(final_mat)
CvMat cvmat = sum_mat;
改为
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(i,j);
}

CV_BGR2GHSV没有被声明
加入头文件#include
textOrg = cv::Point(ctx.topLeft.x, ctx.botRight.y + baseline);
改为
textOrg.x = ctx.topLeft.x;
textOrg.y = ctx.botRight.y + baseline;

cvGetWindowHandle没有被声明
加入头文件#include
CV_STORAGE_WRITE, CV_STORAGE_READ,CV_NODE_MAP读写xml错误
这里的本质上是读写yaml文件,源代码方式已经被淘汰了,需要使用新方法,这里暂时不知道有什么用,可以直接将读写代码注释掉,我这里稍微改动一下,保证编译能过,不知道是否正确,后面用到再验证。
将CV_STORAGE_WRITE改为cv::FileStorage::WRITE
将CV_STORAGE_READ改为cv::FileStorage::READ
将cv::FileNode topNode(cvfs.fs, NULL)注释掉,后面的topNode改为cvfs
CV_NODE_MAP需要将写操作改成<<的形式,因为它重载了<<
CV_REDUCE_MIN 没有被声明
将CV_REDUCE_MIN改为cv::REDUCE_MIN

你可能感兴趣的:(人工智能,autoware.ai)