当前位置:   article > 正文

ubuntu18.04安装autoware_ubuntu安装autoware 18.04

ubuntu安装autoware 18.04


一、安装显卡驱动

参考:ubuntu18.04安装nvidia驱动,3种方式图文详解+卸载教程_ubuntu18.04安装nvidia显卡驱动-CSDN博客

 解决问题:ubuntu18.04安装nvidia显卡驱动-CSDN博客

二、安装cmake

参考:ubuntu18.04安装Autoware1.14---GPU版 最全环境配置说明_autoware1.14安装教程-CSDN博客

其中cmake安装部分为:

  1. 1| wget https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz
  2. 2| tar zxvf cmake-3.12.2-Linux-x86_64.tar.gz #解压
  3. 3| sudo ln -sf /home/hb-wgl/cmake-3.12.2-Linux-x86_64/bin/* /usr/bin/ #注意自己的cmake安装路径

但是软链接一直有问题。

参考:linux安装指定版本的cmake_linux安装cmake指定版本-CSDN博客

使用:

  1. sudo vim ~/.bashrc
  2. export PATH=$PATH:/home/q/cmake/cmake-3.12.2-Linux-x86_64/bin

成功输出路径并输出cmake版本

  1. $PATH
  2. bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/q/cmake/cmake-3.12.2-Linux-x86_64/bin: No such file or directory
  1. cmake --version
  2. cmake version 3.12.2

三、eigen3.3.7

参考:

ubuntu18.04安装Autoware1.14---GPU版 最全环境配置说明_autoware1.14安装教程-CSDN博客

ln一直报错

参考:【环境搭建】ubuntu18.04安装Eigen3_ubuntu18.04 eigen3-CSDN博客

Eigen下载地址:Releases · libeigen / eigen · GitLab下载eigen3.37的压缩包

解压并进如安装包目录

  1. mkdir build
  2. cd build
  3. cmake ..
  4. sudo make install

但cmake编译文件时报错

  1. Tell CMake where to find the compiler by setting either the environment
  2. variable “CXX” or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  3. to the compiler, or to the compiler name if it is in the PATH.

参考:cmake:Tell CMake where to find the compiler by setting either the environment...-CSDN博客

  1. apt-get update
  2. apt-get install -y build-essential

重新编译安装 ,软件默认安装在/usr/local/include,需要将文件链接到/usr/include下。

  1. sudo ln -s /usr/local/include/eigen3 /usr/include
  2. sudo ln -s /usr/local/include/eigen3/Eigen /usr/include/Eigen

 不加sudo会报错,执行完之后可以在/usr/include下看到链接文件。

 查看版本:

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

 版本号:3.3.7,竖着排列的3 3 7

四、CUDA-10.0安装

参考:ubuntu18.04安装Autoware1.14---GPU版 最全环境配置说明_autoware1.14安装教程-CSDN博客

下载时Installer Type选runfile,上面链接截图给错了,这里补丁没下载,应该没事。

安装时一定要参考:Ubuntu18.04安装cuda10.0_ubuntu安装cuda10.0-CSDN博客

配置环境变量:

  1. echo "export PATH=$PATH:/usr/local/cuda-10.0/bin/" >> ~/.bashrc
  2. echo "export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-10.0" >> ~/.bashrc
  3. source ~/.bashrc

 查版本:

cat /usr/local/cuda/version.txt
CUDA Version 10.0.130

五、cudnn7.5.0
参考:ubuntu18.04安装Autoware1.14---GPU版 最全环境配置说明_autoware1.14安装教程-CSDN博客

下载cudnn:cuDNN Archive | NVIDIA Developer

对于ubuntu18.04来说有不同版本的cudnn,需要注意cudnn的版本。下载选项中

cuDNN Library for Linux是cudnn-10.0-linux-x64-v7.5.0.56.tgz,这一个安装包即可完成安装。
cuDNN Runtime Library for Ubuntu18.04 (Deb)
cuDNN Developer Library for Ubuntu18.04 (Deb)
cuDNN Code Samples and User Guide for Ubuntu18.04 (Deb)
这三个安装包对应的第二种安装方法,第二种方法在参考链接中有,这里由于第一种安装方法直接成功就没尝试第二种。
第一种方法参考:
安装cudnn_如何安装cudnn-CSDN博客

  1. tar vxf cudnn-10.0-linux-x64-v7.5.0.56.tgz
  2. sudo cp include/cudnn.h /usr/local/cuda/include/
  3. sudo cp -r -d ./lib64/* /usr/local/cuda/lib64/ #-d如果源文件为软链接(对硬链接无效),则复制出的目标文件也为软链接;
  4. sudo chmod a+r /usr/local/cuda/include/cudnn.h
  5. sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
  6. echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64" >> ~/.bashrc
  7. source ~/.bashrc

 查版本:

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
  1. #define CUDNN_MAJOR 7
  2. #define CUDNN_MINOR 5
  3. #define CUDNN_PATCHLEVEL 0
  4. --
  5. #define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
  6. #include "driver_types.h"

 六、opencv3.4.5安装

下载:网页输入URL自动下载

https://github.com/opencv/opencv/archive/3.4.5.zip
  1. unzip opencv-3.4.5.zip
  2. cd opencv-3.4.5
  3. sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev

 报错:

  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. Note, selecting 'libjpeg-dev' for regex 'libjpeg.dev'
  5. Note, selecting 'libtiff4-dev' for regex 'libtiff4.dev'
  6. E: Unable to locate package libjasper-dev

解决:

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

编译安装:

  1. mkdir build && cd build
  2. cmake ..
  3. make -j8 // nproc是读取CPU的核心数量
  4. sudo make install

环境配置添加库路径:

  1. sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
  2. ##更新库
  3. sudo ldconfig

配置bash,执行如下命令:

  1. sudo gedit /etc/bash.bashrc
  2. //在末尾添加
  3. PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
  4. export PKG_CONFIG_PATH

保存退出,然后执行如下命令使得配置生效:

  1. source /etc/bash.bashrc #加sudo会报错,sudo: source: command not found,猜是root下面没有source
  2. sudo updatedb

查版本:

  1. pkg-config --modversion opencv
  2. 3.4.5

安装pkg-config

sudo apt install pkg-config

七、安装Qt 5.14.2

参考:ubuntu18.04安装Autoware1.14---GPU版 最全环境配置说明_autoware1.14安装教程-CSDN博客

下载:qt-opensource-linux-x64-5.14.2.run

 安装:

  1. chmod a+x ./qt-opensource-linux-x64-5.14.2.run
  2. ./qt-opensource-linux-x64-5.14.2.run

 进入程序安装界面,参考:Ubuntu18.04 qt5.14安装_ubuntu18.04安装qt-CSDN博客

 邮箱验证完之后,需要手动点安装界面的next进行下一步,qt组件这里全选。

安装完成之后,有的文章还需要配置环境,但原文没配置,所以这里没配置。

八.Autoware1.14源码安装

参考:ubuntu18.04安装Autoware1.14---GPU版 最全环境配置说明_autoware1.14安装教程-CSDN博客

原文,执行下面代码会报错找不到包:

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

报错:

  1. sudo apt install -y python-catkin-pkg python-rosdep ros-$ROS_DISTRO-catkin
  2. Reading package lists... Done
  3. Building dependency tree
  4. Reading state information... Done
  5. Note, selecting 'python-rosdep2' instead of 'python-rosdep'
  6. E: Unable to locate package ros--catkin
  7. #########################################
  8. sudo apt install ros-melodic-catkin
  9. Reading package lists... Done
  10. Building dependency tree
  11. Reading state information... Done
  12. E: Unable to locate package ros-melodic-catkin

第一次成功安装采用的方法是,rosdep用鱼香ros安装(终端执行wget http://fishros.com/install -O fishros && bash fishros),在安装过程中更新源,难道是这个缘故?也尝试用鱼香安装ros,不知道为啥报错,但也更新了源。

之后直接执行下面代码就可以,或许是网络波动?(环境中没有$ROS_DISTRO)

  1. sudo apt update
  2. sudo apt install -y python-catkin-pkg python-rosdep ros-melodic-catkin
  3. sudo apt install -y python3-pip python3-colcon-common-extensions python3-setuptools python3-vcstool
  4. pip3 install -U setuptools

安装ROS

鱼香安装报错:source 什么文件不存在

apt安装报错:Some packages could not be installed. This may mean that you have requested

源错误,修改

  1. sudo gedit /etc/apt/sources.list
  2. #添加阿里源
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  6. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  7. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  8. #中科大源
  9. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
  10. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
  11. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
  12. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
  13. deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
  14. #163
  15. deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
  16. deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
  17. deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
  18. deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
  19. deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
  20. #清华源
  21. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
  22. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
  23. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
  24. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
  25. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

之后可以选择鱼香ROS安装,也可以自己安装。

安装ros依赖,虽然rosdep可以通过鱼香安装好,但rosdep update一直报错,放这里不管了。

  1. rosdep update
  2. rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

编译环境

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

报错:

  1. CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  2. Could not find a package configuration file provided by
  3. "jsk_recognition_msgs" with any of the following names:
  4. jsk_recognition_msgsConfig.cmake
  5. jsk_recognition_msgs-config.cmake
  6. Add the installation prefix of "jsk_recognition_msgs" to CMAKE_PREFIX_PATH
  7. or set "jsk_recognition_msgs_DIR" to a directory containing one of the
  8. above files. If "jsk_recognition_msgs" provides a separate development
  9. package or SDK, be sure it has been installed.
  10. Call Stack (most recent call first):
  11. CMakeLists.txt:4 (find_package)
  12. ---
  13. Failed <<< autoware_msgs [1.33s, exited with code 1]

修改:

sudo apt-get install  ros-melodic-jsk-recognition-msgs

报错:

  1. CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  2. Could not find a package configuration file provided by "jsk_rviz_plugins"
  3. with any of the following names:
  4. jsk_rviz_pluginsConfig.cmake
  5. jsk_rviz_plugins-config.cmake
  6. Add the installation prefix of "jsk_rviz_plugins" to CMAKE_PREFIX_PATH or
  7. set "jsk_rviz_plugins_DIR" to a directory containing one of the above
  8. files. If "jsk_rviz_plugins" provides a separate development package or
  9. SDK, be sure it has been installed.
  10. Call Stack (most recent call first):
  11. CMakeLists.txt:6 (find_package)

修改:

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

报错:

/usr/include/eigen3/Eigen/Core:42:14: fatal error: math_functions.hpp: No such file or directory

修改:

将 /usr/include/eigen3/Eigen/Core的42行中的 math_functions.hpp改为cuda_runtime.h

报错:ntd_gpu

/usr/local/include/eigen3/Eigen/src/Core/arch/CUDA/PacketMathHalf.h(102): error: more than one conversion function from "const __half" to a built-in type applies:

修改:检查eigen版本参考:Autoware 安装(源码)过程 与 踩坑记录(Ubuntu18.04)_autoware源码-CSDN博客

报错:

  1. CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  2. Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)

修改:参考:Autoware学习笔记_at /usr/share/cmake-3.10/modules/findpackagehandle-CSDN博客

sudo apt install libglew-dev

报错:

  1. Could NOT find GeographicLib (missing: GeographicLib_LIBRARIES
  2. GeographicLib_INCLUDE_DIRS)

修理:

sudo apt-get install libgeographic-dev

报错:

  1. Could not find a package configuration file provided by "nmea_msgs" with
  2. any of the following names:
  3. nmea_msgsConfig.cmake
  4. nmea_msgs-config.cmake

修改:

suds apt-get install  ros-melodic-nmea-msgs

报错:

  1. Could not find a package configuration file provided by
  2. "nmea_navsat_driver" with any of the following names:
  3. nmea_navsat_driverConfig.cmake
  4. nmea_navsat_driver-config.cmake

修理:

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

报错:

  1. CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  2. Could not find a package configuration file provided by
  3. "automotive_navigation_msgs" with any of the following names:
  4. automotive_navigation_msgsConfig.cmake
  5. automotive_navigation_msgs-config.cmake

修理:

sudo apt-get install ros-melodic-automotive-navigation-msgs

报错:

  1. Could not find a package configuration file provided by "grid_map_msgs"
  2. with any of the following names:
  3. grid_map_msgsConfig.cmake
  4. grid_map_msgs-config.cmake

修理:

sudo apt-get install  ros-melodic-grid-map-msgs

报错:

  1. Could not find a package configuration file provided by
  2. "automotive_platform_msgs" with any of the following names:
  3. automotive_platform_msgsConfig.cmake
  4. automotive_platform_msgs-config.cmake

修理:

sudo apt-get install  ros-melodic-automotive-platform-msgs

报错:

  1. Could not find a package configuration file provided by "grid_map_ros" with
  2. any of the following names:
  3. grid_map_rosConfig.cmake
  4. grid_map_ros-config.cmake

修理:

sudo apt-get install  ros-melodic-grid-map-ros

报错:

  1. --- stderr: calibration_publisher
  2. CMakeFiles/calibration_publisher.dir/src/calibration_publisher.cpp.o: In function `main':
  3. calibration_publisher.cpp:(.text.startup+0xb8e): undefined reference to `cv::read(cv::FileNode const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

修理;autoware解决报错:calibration_publisher.cpp:(.text+0x26): undefined reference to `cv::Mat::Mat()‘-CSDN博客

报错:

  1. Could not find a package configuration file provided by
  2. "velodyne_pointcloud" with any of the following names:
  3. velodyne_pointcloudConfig.cmake
  4. velodyne_pointcloud-config.cmake

修理:

sudo apt-get install  ros-melodic-velodyne-pointcloud

报错:

  1. CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  2. Could not find a package configuration file provided by "gps_common" with
  3. any of the following names:
  4. gps_commonConfig.cmake
  5. gps_common-config.cmake

修理:

sudo apt-get install  ros-melodic-gps-common

报错:

  1. Could not find a package configuration file provided by "qpoases_vendor"
  2. with any of the following names:
  3. qpoases_vendorConfig.cmake
  4. qpoases_vendor-config.cmake

修理:

sudo apt-get install  ros-melodic-qpoases-vendor

报错:

  1. CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  2. Could not find a package configuration file provided by "geodesy" with any
  3. of the following names:
  4. geodesyConfig.cmake
  5. geodesy-config.cmake

修理:

sudo apt-get install  ros-melodic-geodesy

报错:

  1. --- stderr: waypoint_maker
  2. /home/q/Autoware/autoware.ai/install/lanelet2_routing/lib/liblanelet2_routing.so: undefined reference to `lanelet::LaneletMap::LaneletMap()'
  3. /home/q/Autoware/autoware.ai/install/lanelet2_validation/lib/liblanelet2_validation.so: undefined reference to `lanelet::LaneletMap::~LaneletMap()'
  4. collect2: error: ld returned 1 exit status

修理:

  1. sudo vim /.bashrc
  2. export LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH

 报错:

  1. --- stderr: waypoint_maker
  2. /home/q/Autoware/autoware.ai/install/lanelet2_routing/lib/liblanelet2_routing.so: undefined reference to `lanelet::LaneletMap::LaneletMap()'
  3. /home/q/Autoware/autoware.ai/install/lanelet2_validation/lib/liblanelet2_validation.so: undefined reference to `lanelet::LaneletMap::~LaneletMap()'
  4. collect2: error: ld returned 1 exit status
  5. make[2]: *** [devel/lib/waypoint_maker/waypoint_clicker] Error 1
  6. make[1]: *** [CMakeFiles/waypoint_clicker.dir/all] Error 2

修理:修改waypoint_maker功能包对应的Cmakelists.txt

  1. find_package(lanelet2 REQUIRED)
  2. include_directories(${lanelet2_INCLUDE_DIRS})
  3. target_link_libraries(your_target_name ${lanelet2_LIBRARIES})

报错:

  1. Could not find a package configuration file provided by "lanelet2" with any
  2. of the following names:
  3. lanelet2Config.cmake
  4. lanelet2-config.cmake

修理:

sudo apt-get install  ros-melodic-lanelet2

 当时并没有直接成功,尝试了很多方法都失败了,但将文件还原后重新编译居然成功了。

下面是尝试的方法:

编译时遇到 Add the installation prefix of “xxx“ to CMAKE_PREFIX_PATH or set“xxx_DIR“ to a directory-CSDN博客

ubuntu20.04 ad_with_lanelet2 编译问题解决-CSDN博客

至此编译完成,下图为编译成功。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/1016554
推荐阅读
相关标签
  

闽ICP备14008679号