Autoware学习笔记
- 1、Autoware概述
- 2、autoware安装
- 一、Ubuntu18.04安装ROS Melodic
- 二、Ubuntu18.04安装opencv4
- 三、Ubuntu18.04安装Qt 5.12.0
- 四、Ubuntu18.04安装autoware 1.14.0
- 问题1:Could not find a package configuration file provided by "jsk_recognition_msgs" with any of the following names:
- 问题2:stderr: autoware_health_checker Could not find a package configuration file provided by "jsk_rviz_plugins"
- 问题3:CV_WINDOW_AUTOSIZE ,CV_LOAD_IMAGE_UNCHANGED 没有被声明
- 问题4:Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)
- 问题5:cmake 编译autoware使用了anaconda,安装anaconda引起ros的cmake错误
- 问题 6: No such file or directory#include
1、Autoware概述
Autoware是开源的自动驾驶框架。其最早是由名古屋大学研究小组在加藤伸平教授(Prof. Shinpei Kato)的领导下于2015年8月正式发布。2015年12月下旬,加藤伸平教授创立了Tier IV,以维护Autoware并将其应用于真正的自动驾驶汽车。随着时间的流逝,Autoware已成为公认的开源项目。Autoware也是世界上第一个用于自动驾驶技术的“多合一”开源软件。而同样的自动驾驶平台,2017年4月发布的Baidu apollo则可以说是Autoware的“小老弟”。目前其基于ROS 1,并在Apache 2.0许可下可用。它包含以下模块:
- 定位(Localization ):通过结合GNSS和IMU传感器的3D地图和SLAM算法来实现定位。
- 检测(Detection ):使用具有传感器融合算法和深度神经网络的摄像机以及LiDAR。
- 预测和规划(Prediction and Planning ):基于概率机器人技术和基于规则的系统,部分还使用深度神经网络。
- 控制(Control):Autoware向车辆输出的是速度和角速度的扭曲量。尽管控制量的主要部分通常位于车辆的线控控制器中,但这些是Control的一部分。
以上4个模块几乎涵盖了目前整个自动驾驶的技术流程(感知层—预测及规划层—控制层),无论是作为菜鸟入门还是老鸟对技术路线的学习都有极为重要的参考价值。最最重要的是,它的代码完全开源!
2、autoware安装
1、https://github.com/Autoware-AI/autoware.ai/wiki/Source-Build
2、自动驾驶入门之----开源自动驾驶框架Autoware介绍
3、Autoware入门学习(二)——Ubuntu18.04下的源码安装和配置
一、Ubuntu18.04安装ROS Melodic
可以看我另外一篇文章:Ubuntu18.04安装ROS Melodic
二、Ubuntu18.04安装opencv4
主要参考:https://blog.csdn.net/new_delete_/article/details/84797041
三、Ubuntu18.04安装Qt 5.12.0
参考:https://blog.csdn.net/u010779035/article/details/85321603
四、Ubuntu18.04安装autoware 1.14.0
参考文章:
1、autoware 官方安装文章
2、https://blog.csdn.net/zhao5269/article/details/106827618
这里需要连接外网才能成功(蓝色的灯光)。
sudo apt update
sudo apt install -y python-catkin-pkg python-rosdep ros-$ROS_DISTRO-catkin
sudo apt install -y python3-pip python3-colcon-common-extensions python3-setuptools python3-vcstool
pip3 install -U setuptools
注意:要在 Melodic 上启用 CUDA 支持,需要更新 Eigen。
解决Eigen版本过低造成编译失败的问题
创建工作空间
mkdir -p autoware.ai/src
cd autoware.ai
下载autoware 1.12.0相关代码库链接到autoware.ai.repos
wget -O autoware.ai.repos "https://raw.githubusercontent.com/Autoware-AI/autoware.ai/1.12.0/autoware.ai.repos"
如果下载不下来,参考:curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused 解决方法,亲测可用。
下载代码
vcs import src < autoware.ai.repos
这一步是特别的麻烦。
rosdep update 一下
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
这里可能会有一堆提示:好像可以不用管,【学习笔记】Autoware无人驾驶软件安装遇见的坑与解决
编译工作区:
若已经配置好了 CUDA:
AUTOWARE_COMPILE_WITH_CUDA=1 colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
这里编译也会i出现很多问题,比如cuda版本和opencv版本的问题。
问题1:Could not find a package configuration file provided by “jsk_recognition_msgs” with any of the following names:
ROS编译报错
— stderr: autoware_msgs
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
“jsk_recognition_msgs” with any of the following names:
jsk_recognition_msgsConfig.cmake
jsk_recognition_msgs-config.cmake
Add the installation prefix of “jsk_recognition_msgs” to CMAKE_PREFIX_PATH
or set “jsk_recognition_msgs_DIR” to a directory containing one of the
above files. If “jsk_recognition_msgs” provides a separate development
package or SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
Failed <<< autoware_msgs [1.11s, exited with code 1]
解决办法:
sudo apt-get install ros-melodic-jsk-recognition-msgs
问题2:stderr: autoware_health_checker Could not find a package configuration file provided by “jsk_rviz_plugins”
with any of the following names
stderr: autoware_health_checker
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.cmake
Add 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
sudo apt-get install ros-melodic-lanelet2-core
sudo apt-get install ros-melodic-lanelet2-io
sudo apt-get install ros-melodic-lanelet2-maps
sudo apt-get install ros-melodic-grid-map-cv
...
...
...
问题3: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
问题4:Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)
stderr: op_simu
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
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 install libglew-dev
问题5:cmake 编译autoware使用了anaconda,安装anaconda引起ros的cmake错误
错误如下:
stderr: citysim
CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindBoost.cmake:911 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run “cmake --help-policy CMP0054” for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like “chrono” will no longer be dereferenced when the
policy is set to NEW. Since the policy is not set the OLD behavior will be
used.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 (_Boost_MISSING_DEPENDENCIES)
/usr/share/OGRE/cmake/modules/FindOGRE.cmake:318 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:175 (find_package)
CMakeLists.txt:27 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at /home/diyun/anaconda3/share/cmake/ZeroMQ/ZeroMQConfig.cmake:44 (include):
include could not find load file:
/home/diyun/anaconda3/share/cmake/ZeroMQ/ZeroMQTargets.cmake
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/ignition-cmake0/cmake0/FindZeroMQ.cmake:62 (find_package)
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/ignition-transport4/ignition-transport4-config.cmake:107 (find_dependency)
/usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:191 (find_package)
CMakeLists.txt:27 (find_package)
CMake Error at /home/diyun/anaconda3/share/cmake/ZeroMQ/ZeroMQConfig.cmake:46 (get_target_property):
get_target_property() called with non-existent target “libzmq”.
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/ignition-cmake0/cmake0/FindZeroMQ.cmake:62 (find_package)
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/ignition-transport4/ignition-transport4-config.cmake:107 (find_dependency)
/usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:191 (find_package)
CMakeLists.txt:27 (find_package)
CMake Error at /home/diyun/anaconda3/share/cmake/ZeroMQ/ZeroMQConfig.cmake:47 (get_target_property):
get_target_property() called with non-existent target “libzmq”.
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/ignition-cmake0/cmake0/FindZeroMQ.cmake:62 (find_package)
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/ignition-transport4/ignition-transport4-config.cmake:107 (find_dependency)
/usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:191 (find_package)
CMakeLists.txt:27 (find_package)
CMake Error at /home/diyun/anaconda3/share/cmake/ZeroMQ/ZeroMQConfig.cmake:48 (get_target_property):
get_target_property() called with non-existent target “libzmq-static”.
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/ignition-cmake0/cmake0/FindZeroMQ.cmake:62 (find_package)
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/ignition-transport4/ignition-transport4-config.cmake:107 (find_dependency)
/usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:191 (find_package)
CMakeLists.txt:27 (find_package)
解决办法:
这里参考:https://blog.csdn.net/xu19950525/article/details/97905411
是我们anaconda中的python版本可能与ros中的版本不一致,引起cmake编译错误。因为ros用python2.7和anaconda的python3.6兼容性不是特别好。
gedit ~/.bashrc
打开bash文件,在~/.bashrc文件里有一行
export PATH="/home/xgy/anaconda3/bin:$PATH"
将这一行注释掉。等到你用的时候在再把注释放开。
然后更新一下,再打开一个新的终端=,就是他已经在系统中被清除了。
source ~/.bashrc
刷新bash文件
等你要用的时候把这个注释去掉,重复上述步骤。
问题 6: No such file or directory#include <opencv2/contrib/contrib.hpp>
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 <opencv2/contrib/contrib.hpp>
解决办法:
问题出在autoware不兼容高版本的opencv,我是opencv4,不过这种简单的问题比较容易修改。
camera_lidar_calibration_node.cpp中把等于版本3,换成大于
#if (CV_MAJOR_VERSION >= 3)
#include <opencv2/imgcodecs.hpp>
#else
#include <opencv2/contrib/contrib.hpp>
#endif
问题 7:
CV_EPNP没有被声明
将CV_EPNP改为cv::SOLVEPNP_EPNP
问题 8:
CMakeFiles/calibration_publisher.dir/src/calibration_publisher.cpp.o: In function
cv::internal::VecReaderProxy<int, 1>::operator()(std::vector<int, std::allocator<int> >&, unsigned long) const': calibration_publisher.cpp:(.text._ZNK2cv8internal14VecReaderProxyIiLi1EEclERSt6vectorIiSaIiEEm[_ZNK2cv8internal14VecReaderProxyIiLi1EEclERSt6vectorIiSaIiEEm]+0x2b): undefined reference to
cv::FileNodeIterator::remaining() const’
calibration_publisher.cpp:(.text._ZNK2cv8internal14VecReaderProxyIiLi1EEclERSt6vectorIiSaIiEEm[_ZNK2cv8internal14VecReaderProxyIiLi1EEclERSt6vectorIiSaIiEEm]+0xd8): undefined reference tocv::FileNodeIterator::readRaw(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void*, unsigned long)' CMakeFiles/calibration_publisher.dir/src/calibration_publisher.cpp.o: In function
main’:
calibration_publisher.cpp:(.text.startup+0x989): undefined reference tocv::FileStorage::FileStorage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' calibration_publisher.cpp:(.text.startup+0xa9c): undefined reference to
cv::FileNode::begin() const’
calibration_publisher.cpp:(.text.startup+0xb2b): undefined reference to `cv::read(cv::FileNode const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > 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
undefined reference to `cv::FileNodeIterator::remaining() const’
解决办法:
https://blog.csdn.net/weixin_44570248/article/details/118463028
问题9:visualize_rects.cpp:112:21: error: ‘CV_AA’ was not declared in this scope
问题10:autoware.ai/src/autoware/core_perception/points_preprocessor/nodes/ray_ground_filter/ray_ground_filter.cpp:423:7: error: ‘generateColors’ is not a member of ‘cv’
423行把opencv版本改成大于等于3。
问题11:error: ‘CV_NODE_MAP’ was not declared in this scope
/home/diyun/autoware.ai/src/autoware/core_perception/trafficlight_recognizer/nodes/tlr_tuner/tuner_body.cpp: In static member function ‘static void TunerBody::saveResult(std::__cxx11::string)’:
/home/diyun/autoware.ai/src/autoware/core_perception/trafficlight_recognizer/nodes/tlr_tuner/tuner_body.cpp:394:48: error: ‘CV_NODE_MAP’ was not declared in this scope
CV::WriteStructContext st_red(cvfs, “RED”, CV_NODE_MAP);
这里我暂时注释了,后续再说,保存yaml文件,可参考下面文章
https://blog.csdn.net/weixin_41374099/article/details/86583796
最终成功画面:大多数参考这个大佬的https://blog.csdn.net/qq_34935373/article/details/120141905
参考:
安装autoware遇到的那些坑
Ubuntu18.04安装autoware.ai——使用CUDA编译报ndt_gpu错误
若没有 CUDA支持,只使用 CPU:
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
附: autoware 解决花屏重叠问题
https://blog.csdn.net/weixin_44570248/article/details/118632195
解决:roscore报错: ‘ascii’ codec can’t decode byte 0xe6 in position 13: ordinal not in range(128)
参考:https://blog.csdn.net/m0_45388819/article/details/108998827
我的主要就是桌面中文搞得,我改成了dsektop。然后
/home/xxxxxxxxxxx/desktop/mywork/autoware/autoware.ai/build/tablet_socket_msgs/CMakeCache.txt
将build下所有的CMakeCache.txt删除后,编译通过了。
把这个删掉,把其他的桌面全改成dsektop。
0603编译了还是没有解决重影以及并未运行出示例代码,还需要进行深入理解。
3、autoware演示
参考:
1、Autoware入门学习(三)——Autoware软件功能使用介绍(1/3)及demo演示
2、 demo 演示的官方网址
demo 演示的官方网址
https://github.com/Autoware-AI/autoware.ai/wiki/ROSBAG-Demo
cd autoware.ai
source install/setup.bash
roslaunch runtime_manager runtime_manager.launch
https://zhuanlan.zhihu.com/p/146285262
https://blog.csdn.net/zhao5269/article/details/106864985