TX2入门教程软件篇-安装autoware自动驾驶软件包
TX2入门教程软件篇-安装autoware自动驾驶软件包
说明:
- 介绍如何在tx2上安装autoware自动驾驶软件包
- 环境:jetson3.0 full 版
- 扩展256G的固态硬盘作为启动盘,参考TX2入门教程硬件篇-用SSD固态硬盘做启动盘
步骤:
- 安装系统依赖:
sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin libmosquitto-dev
- 安装kinetic依赖:
$ sudo apt install ros-kinetic-pcl-ros ros-kinetic-roslint ros-kinetic-jsk-recognition-msgs \
ros-kinetic-cv-bridge ros-kinetic-nmea-msgs ros-kinetic-sound-play ros-kinetic-grid-map-ros \
ros-kinetic-diagnostic-updater ros-kinetic-camera-info-manager ros-kinetic-jsk-rviz-plugins \
ros-kinetic-gps-common
$ sudo apt install ros-kinetic-rviz
- 安装opencv方法1:安装opencv-3.2.0版本,参考TX2入门教程软件篇-安装OpenCV3.3
- 或修改为系统的opencv-3.3.1版本
- 修改/opt/ros/kinetic/share/image_geometry/cmake/image_geometryConfig.cmake
- 修改3.2.0为3.3.1修改部分如下:
if(NOT "include;/opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv " STREQUAL " ")
set(image_geometry_INCLUDE_DIRS "")
set(_include_dirs "include;/opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv")
foreach(idir ${_include_dirs})
if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir})
set(include ${idir})
elseif("${idir} " STREQUAL "include ")
get_filename_component(include "${image_geometry_DIR}/../../../include" ABSOLUTE)
if(NOT IS_DIRECTORY ${include})
message(FATAL_ERROR "Project 'image_geometry' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer 'Vincent Rabaud <vincent.rabaud@gmail.com>' to fix it.")
endif()
else()
message(FATAL_ERROR "Project 'image_geometry' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/opt/ros/kinetic/${idir}'. Ask the maintainer 'Vincent Rabaud <vincent.rabaud@gmail.com>' to fix it.")
endif()
_list_append_unique(image_geometry_INCLUDE_DIRS ${include})
endforeach()
endif()
set(libraries "image_geometry;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_calib3d3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_core3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_features2d3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_flann3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_highgui3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_imgcodecs3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_imgproc3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_ml3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_objdetect3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_photo3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_shape3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_stitching3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_superres3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_video3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_videoio3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_videostab3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_viz3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_aruco3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_bgsegm3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_bioinspired3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_ccalib3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_cvv3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_datasets3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_dpm3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_face3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_fuzzy3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_hdf3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_line_descriptor3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_optflow3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_phase_unwrapping3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_plot3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_reg3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_rgbd3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_saliency3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_stereo3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_structured_light3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_surface_matching3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_text3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_xfeatures2d3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_ximgproc3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_xobjdetect3.so.3.3.1;/opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_xphoto3.so.3.3.1")
- 但系统还是会找3.2的版本所有同时也做一份软连接
- 建立软连接:
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_calib3d3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_calib3d3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_core3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_core3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_features2d3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_features2d3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_flann3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_flann3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_highgui3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_highgui3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_imgcodecs3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_imgcodecs3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_imgproc3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_imgproc3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_ml3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_ml3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_objdetect3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_objdetect3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_photo3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_photo3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_shape3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_shape3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_stitching3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_stitching3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_superres3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_superres3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_video3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_video3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_videoio3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_videoio3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_videostab3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_videostab3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_viz3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_viz3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_aruco3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_aruco3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_bgsegm3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_bgsegm3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_bioinspired3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_bioinspired3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_ccalib3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_ccalib3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_cvv3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_cvv3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_datasets3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_datasets3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_dpm3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_dpm3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_face3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_face3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_fuzzy3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_fuzzy3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_hdf3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_hdf3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_line_descriptor3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_line_descriptor3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_optflow3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_optflow3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_phase_unwrapping3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_phase_unwrapping3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_plot3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_plot3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_reg3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_reg3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_rgbd3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_rgbd3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_saliency3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_saliency3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_stereo3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_stereo3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_structured_light3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_structured_light3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_surface_matching3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_surface_matching3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_text3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_text3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_xfeatures2d3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_xfeatures2d3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_ximgproc3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_ximgproc3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_xobjdetect3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_xobjdetect3.so.3.2
sudo ln -s /opt/ros/kinetic/lib/aarch64-linux-gnu/libopencv_xphoto3.so.3.3.1 /opt/ros/kinetic/lib/libopencv_xphoto3.so.3.2
- 上面只是折中方法
- 安装wxPython
sudo apt-get install python-wxtools
- 安装autoware
$ git clone https://github.com/CPFL/Autoware.git --recurse-submodules
$ cd ~/Autoware/ros/src
$ catkin_init_workspace
$ cd ../
$ rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
$ touch src/driveworks/CATKIN_IGNORE
$ ./catkin_make_release
- 这一步可能会因为你的opencv版本不符合而导致依赖不能安装,可以忽略继续执行。
测试运行DEMO:
- 下载测试数据
$ cd .autoware/
$ wget http://db3.ertl.jp/autoware/sample_data/my_launch.sh
$ wget http://db3.ertl.jp/autoware/sample_data/sample_moriyama_data.tar.gz
$ wget http://db3.ertl.jp/autoware/sample_data/sample_moriyama_150324.tar.gz
$ tar xzvf sample_moriyama_data.tar.gz
$ tar xzvf sample_moriyama_150324.tar.gz
- 文件比较大,可以迅雷下载在拷贝到tx2上。
- 和生成launch文件
$ sh my_launch.sh
- 测试运行:
$ cd $HOME/Autoware/ros
$ ./run
下载autoware的PDF说明书,具体执行即可
具体测试结果可以出来,不过会比较慢。
参考:
- https://github.com/CPFL/Autoware/wiki/Source-Build
- https://github.com/NavIV/automation-scripts
- https://qiita.com/0-to-1/items/03c5a70f979f13b260a1
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号