平台:Jetson Nano
系统版本:4.6.1
在ZED 2i 官方驱动下载驱动,需要与Jetson Nano系统版本对应。
下载速度很慢,这是我备份的:ZED_SDK_Tegra_JP46_v3.7.0.run(ZED2 Jetson Nano驱动包)
将下好的驱动发送到Nano里:
scp ./ZED_SDK_Tegra_JP46_v3.7.0.run [email protected]:~/
sudo chmod +x ./ZED_SDK_Tegra_JP46_v3.7.0.run
./ZED_SDK_Tegra_JP46_v3.7.0.run
之后都选择y同意
在/usr/local/zed/tools
中有一些测试小工具:
如ZED_Sensor_Viewer:
如ZED_Depth_Viewer:
参考博文:安装zed-ros-wrapper 并解决一些报错—— 努力~自律~开心
sudo apt-get install ros-melodic-sensor-msgs
sudo apt-get install ros-melodic-tf2-sensor-msgs
sudo cp /usr/lib/python2.7/dist-packages/em.py /opt/ros/melodic/lib/python2.7/dist-packages/
source /opt/ros/melodic/setup.bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
source devel/setup.bash
cd ~/catkin_ws/src
git clone --recursive https://gitee.com/chr12/zed-ros-wrapper.git
git clone https://gitee.com/zhanghao132/zed-ros-examples.git
cd ~/catkin_ws
rosdep install --from-paths src --ignore-src -r -y
catkin_make -DCMAKE_BUILD_TYPE=Release
source ./devel/setup.bash
roslaunch zed_wrapper zed2i.launch
rostopic list
/diagnostics
/rosout
/rosout_agg
/tf
/tf_static
/zed2i/joint_states
/zed2i/zed_node/atm_press
/zed2i/zed_node/confidence/confidence_map
/zed2i/zed_node/depth/camera_info
/zed2i/zed_node/depth/depth_registered
/zed2i/zed_node/depth/depth_registered/compressed
/zed2i/zed_node/depth/depth_registered/compressed/parameter_descriptions
/zed2i/zed_node/depth/depth_registered/compressed/parameter_updates
/zed2i/zed_node/depth/depth_registered/compressedDepth
/zed2i/zed_node/depth/depth_registered/compressedDepth/parameter_descriptions
/zed2i/zed_node/depth/depth_registered/compressedDepth/parameter_updates
/zed2i/zed_node/depth/depth_registered/theora
/zed2i/zed_node/depth/depth_registered/theora/parameter_descriptions
/zed2i/zed_node/depth/depth_registered/theora/parameter_updates
/zed2i/zed_node/disparity/disparity_image
/zed2i/zed_node/imu/data
/zed2i/zed_node/imu/data_raw
/zed2i/zed_node/imu/mag
/zed2i/zed_node/left/camera_info
/zed2i/zed_node/left/image_rect_color
/zed2i/zed_node/left/image_rect_color/compressed
/zed2i/zed_node/left/image_rect_color/compressed/parameter_descriptions
/zed2i/zed_node/left/image_rect_color/compressed/parameter_updates
/zed2i/zed_node/left/image_rect_color/compressedDepth
/zed2i/zed_node/left/image_rect_color/compressedDepth/parameter_descriptions
/zed2i/zed_node/left/image_rect_color/compressedDepth/parameter_updates
/zed2i/zed_node/left/image_rect_color/theora
/zed2i/zed_node/left/image_rect_color/theora/parameter_descriptions
/zed2i/zed_node/left/image_rect_color/theora/parameter_updates
/zed2i/zed_node/left/image_rect_gray
/zed2i/zed_node/left/image_rect_gray/compressed
/zed2i/zed_node/left/image_rect_gray/compressed/parameter_descriptions
/zed2i/zed_node/left/image_rect_gray/compressed/parameter_updates
/zed2i/zed_node/left/image_rect_gray/compressedDepth
/zed2i/zed_node/left/image_rect_gray/compressedDepth/parameter_descriptions
/zed2i/zed_node/left/image_rect_gray/compressedDepth/parameter_updates
/zed2i/zed_node/left/image_rect_gray/theora
/zed2i/zed_node/left/image_rect_gray/theora/parameter_descriptions
/zed2i/zed_node/left/image_rect_gray/theora/parameter_updates
/zed2i/zed_node/left_cam_imu_transform
/zed2i/zed_node/left_raw/camera_info
/zed2i/zed_node/left_raw/image_raw_color
/zed2i/zed_node/left_raw/image_raw_color/compressed
/zed2i/zed_node/left_raw/image_raw_color/compressed/parameter_descriptions
/zed2i/zed_node/left_raw/image_raw_color/compressed/parameter_updates
/zed2i/zed_node/left_raw/image_raw_color/compressedDepth
/zed2i/zed_node/left_raw/image_raw_color/compressedDepth/parameter_descriptions
/zed2i/zed_node/left_raw/image_raw_color/compressedDepth/parameter_updates
/zed2i/zed_node/left_raw/image_raw_color/theora
/zed2i/zed_node/left_raw/image_raw_color/theora/parameter_descriptions
/zed2i/zed_node/left_raw/image_raw_color/theora/parameter_updates
/zed2i/zed_node/left_raw/image_raw_gray
/zed2i/zed_node/left_raw/image_raw_gray/compressed
/zed2i/zed_node/left_raw/image_raw_gray/compressed/parameter_descriptions
/zed2i/zed_node/left_raw/image_raw_gray/compressed/parameter_updates
/zed2i/zed_node/left_raw/image_raw_gray/compressedDepth
/zed2i/zed_node/left_raw/image_raw_gray/compressedDepth/parameter_descriptions
/zed2i/zed_node/left_raw/image_raw_gray/compressedDepth/parameter_updates
/zed2i/zed_node/left_raw/image_raw_gray/theora
/zed2i/zed_node/left_raw/image_raw_gray/theora/parameter_descriptions
/zed2i/zed_node/left_raw/image_raw_gray/theora/parameter_updates
/zed2i/zed_node/odom
/zed2i/zed_node/parameter_descriptions
/zed2i/zed_node/parameter_updates
/zed2i/zed_node/path_map
/zed2i/zed_node/path_odom
/zed2i/zed_node/point_cloud/cloud_registered
/zed2i/zed_node/pose
/zed2i/zed_node/pose_with_covariance
/zed2i/zed_node/rgb/camera_info
/zed2i/zed_node/rgb/image_rect_color
/zed2i/zed_node/rgb/image_rect_color/compressed
/zed2i/zed_node/rgb/image_rect_color/compressed/parameter_descriptions
/zed2i/zed_node/rgb/image_rect_color/compressed/parameter_updates
/zed2i/zed_node/rgb/image_rect_color/compressedDepth
/zed2i/zed_node/rgb/image_rect_color/compressedDepth/parameter_descriptions
/zed2i/zed_node/rgb/image_rect_color/compressedDepth/parameter_updates
/zed2i/zed_node/rgb/image_rect_color/theora
/zed2i/zed_node/rgb/image_rect_color/theora/parameter_descriptions
/zed2i/zed_node/rgb/image_rect_color/theora/parameter_updates
/zed2i/zed_node/rgb/image_rect_gray
/zed2i/zed_node/rgb/image_rect_gray/compressed
/zed2i/zed_node/rgb/image_rect_gray/compressed/parameter_descriptions
/zed2i/zed_node/rgb/image_rect_gray/compressed/parameter_updates
/zed2i/zed_node/rgb/image_rect_gray/compressedDepth
/zed2i/zed_node/rgb/image_rect_gray/compressedDepth/parameter_descriptions
/zed2i/zed_node/rgb/image_rect_gray/compressedDepth/parameter_updates
/zed2i/zed_node/rgb/image_rect_gray/theora
/zed2i/zed_node/rgb/image_rect_gray/theora/parameter_descriptions
/zed2i/zed_node/rgb/image_rect_gray/theora/parameter_updates
/zed2i/zed_node/rgb_raw/camera_info
/zed2i/zed_node/rgb_raw/image_raw_color
/zed2i/zed_node/rgb_raw/image_raw_color/compressed
/zed2i/zed_node/rgb_raw/image_raw_color/compressed/parameter_descriptions
/zed2i/zed_node/rgb_raw/image_raw_color/compressed/parameter_updates
/zed2i/zed_node/rgb_raw/image_raw_color/compressedDepth
/zed2i/zed_node/rgb_raw/image_raw_color/compressedDepth/parameter_descriptions
/zed2i/zed_node/rgb_raw/image_raw_color/compressedDepth/parameter_updates
/zed2i/zed_node/rgb_raw/image_raw_color/theora
/zed2i/zed_node/rgb_raw/image_raw_color/theora/parameter_descriptions
/zed2i/zed_node/rgb_raw/image_raw_color/theora/parameter_updates
/zed2i/zed_node/rgb_raw/image_raw_gray
/zed2i/zed_node/rgb_raw/image_raw_gray/compressed
/zed2i/zed_node/rgb_raw/image_raw_gray/compressed/parameter_descriptions
/zed2i/zed_node/rgb_raw/image_raw_gray/compressed/parameter_updates
/zed2i/zed_node/rgb_raw/image_raw_gray/compressedDepth
/zed2i/zed_node/rgb_raw/image_raw_gray/compressedDepth/parameter_descriptions
/zed2i/zed_node/rgb_raw/image_raw_gray/compressedDepth/parameter_updates
/zed2i/zed_node/rgb_raw/image_raw_gray/theora
/zed2i/zed_node/rgb_raw/image_raw_gray/theora/parameter_descriptions
/zed2i/zed_node/rgb_raw/image_raw_gray/theora/parameter_updates
/zed2i/zed_node/right/camera_info
/zed2i/zed_node/right/image_rect_color
/zed2i/zed_node/right/image_rect_color/compressed
/zed2i/zed_node/right/image_rect_color/compressed/parameter_descriptions
/zed2i/zed_node/right/image_rect_color/compressed/parameter_updates
/zed2i/zed_node/right/image_rect_color/compressedDepth
/zed2i/zed_node/right/image_rect_color/compressedDepth/parameter_descriptions
/zed2i/zed_node/right/image_rect_color/compressedDepth/parameter_updates
/zed2i/zed_node/right/image_rect_color/theora
/zed2i/zed_node/right/image_rect_color/theora/parameter_descriptions
/zed2i/zed_node/right/image_rect_color/theora/parameter_updates
/zed2i/zed_node/right/image_rect_gray
/zed2i/zed_node/right/image_rect_gray/compressed
/zed2i/zed_node/right/image_rect_gray/compressed/parameter_descriptions
/zed2i/zed_node/right/image_rect_gray/compressed/parameter_updates
/zed2i/zed_node/right/image_rect_gray/compressedDepth
/zed2i/zed_node/right/image_rect_gray/compressedDepth/parameter_descriptions
/zed2i/zed_node/right/image_rect_gray/compressedDepth/parameter_updates
/zed2i/zed_node/right/image_rect_gray/theora
/zed2i/zed_node/right/image_rect_gray/theora/parameter_descriptions
/zed2i/zed_node/right/image_rect_gray/theora/parameter_updates
/zed2i/zed_node/right_raw/camera_info
/zed2i/zed_node/right_raw/image_raw_color
/zed2i/zed_node/right_raw/image_raw_color/compressed
/zed2i/zed_node/right_raw/image_raw_color/compressed/parameter_descriptions
/zed2i/zed_node/right_raw/image_raw_color/compressed/parameter_updates
/zed2i/zed_node/right_raw/image_raw_color/compressedDepth
/zed2i/zed_node/right_raw/image_raw_color/compressedDepth/parameter_descriptions
/zed2i/zed_node/right_raw/image_raw_color/compressedDepth/parameter_updates
/zed2i/zed_node/right_raw/image_raw_color/theora
/zed2i/zed_node/right_raw/image_raw_color/theora/parameter_descriptions
/zed2i/zed_node/right_raw/image_raw_color/theora/parameter_updates
/zed2i/zed_node/right_raw/image_raw_gray
/zed2i/zed_node/right_raw/image_raw_gray/compressed
/zed2i/zed_node/right_raw/image_raw_gray/compressed/parameter_descriptions
/zed2i/zed_node/right_raw/image_raw_gray/compressed/parameter_updates
/zed2i/zed_node/right_raw/image_raw_gray/compressedDepth
/zed2i/zed_node/right_raw/image_raw_gray/compressedDepth/parameter_descriptions
/zed2i/zed_node/right_raw/image_raw_gray/compressedDepth/parameter_updates
/zed2i/zed_node/right_raw/image_raw_gray/theora
/zed2i/zed_node/right_raw/image_raw_gray/theora/parameter_descriptions
/zed2i/zed_node/right_raw/image_raw_gray/theora/parameter_updates
/zed2i/zed_node/stereo/image_rect_color
/zed2i/zed_node/stereo/image_rect_color/compressed
/zed2i/zed_node/stereo/image_rect_color/compressed/parameter_descriptions
/zed2i/zed_node/stereo/image_rect_color/compressed/parameter_updates
/zed2i/zed_node/stereo/image_rect_color/compressedDepth
/zed2i/zed_node/stereo/image_rect_color/compressedDepth/parameter_descriptions
/zed2i/zed_node/stereo/image_rect_color/compressedDepth/parameter_updates
/zed2i/zed_node/stereo/image_rect_color/theora
/zed2i/zed_node/stereo/image_rect_color/theora/parameter_descriptions
/zed2i/zed_node/stereo/image_rect_color/theora/parameter_updates
/zed2i/zed_node/stereo_raw/image_raw_color
/zed2i/zed_node/stereo_raw/image_raw_color/compressed
/zed2i/zed_node/stereo_raw/image_raw_color/compressed/parameter_descriptions
/zed2i/zed_node/stereo_raw/image_raw_color/compressed/parameter_updates
/zed2i/zed_node/stereo_raw/image_raw_color/compressedDepth
/zed2i/zed_node/stereo_raw/image_raw_color/compressedDepth/parameter_descriptions
/zed2i/zed_node/stereo_raw/image_raw_color/compressedDepth/parameter_updates
/zed2i/zed_node/stereo_raw/image_raw_color/theora
/zed2i/zed_node/stereo_raw/image_raw_color/theora/parameter_descriptions
/zed2i/zed_node/stereo_raw/image_raw_color/theora/parameter_updates
/zed2i/zed_node/temperature/imu
/zed2i/zed_node/temperature/left
/zed2i/zed_node/temperature/right
rosnode list
/rosout
/zed2i/zed2i_state_publisher
/zed2i/zed_node
source ~/catkin_ws/devel/setup.bash
roslaunch zed_display_rviz display_zed2i.launch
source ~/catkin_ws/devel/setup.bash
roslaunch zed_rtabmap_example zed_rtabmap.launch
旧记录见【RK3399Pro学习笔记】十七、Debian安装ORB-SLAM3和单目demo的运行
之前用的Fastgit来加速下载,但由于旧的镜像站不能用了,新镜像站速度也很慢,所以寄了。
安装各种依赖包
// 安装build-essential、cmake、git和pkg-config
sudo apt install build-essential cmake git pkg-config
// 安装tif格式图像工具包
sudo apt install libtiff5-dev
//安装视频I/O包
sudo apt install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
//安装gtk2.0
sudo apt install aptitude
sudo aptitude install libgtk2.0-dev
//优化函数包
sudo apt install libatlas-base-dev gfortran
安装opencv及contrib
# Install minimal prerequisites (Ubuntu 18.04 as reference)
sudo apt update && sudo apt install -y cmake g++ wget unzip
# Download and unpack sources 速度很慢,在windows电脑下快些
wget -O opencv.zip https://github.com/opencv/opencv/archive/3.4.16.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.4.16.zip
直接复制链接用下载软件下载:
使用scp命令发送到Nano中
unzip opencv.zip
unzip opencv_contrib.zip
# Create build directory and switch into it
mkdir -p build && cd build
# Configure
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.16/modules ../opencv-3.4.16
# Build
cmake --build .
# 安装
sudo make install
# 更新动态链接库
sudo ldconfig
在执行
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.16/modules ../opencv-3.4.16
时可能会警告下载某些文件超时,可在cmake的日志中获取其下载链接和放置路径
cat ~/build/CMakeDownloadLog.txt
#do_copy "boostdesc_bgm.i" "0ea90e7a8f3f7876d450e4149c97c74f" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i" "/home/nano/build/downloads/xfeatures2d"
#missing "/home/nano/build/downloads/xfeatures2d/boostdesc_bgm.i"
#cmake_download "/home/nano/opencv-3.4.16/.cache/xfeatures2d/boostdesc/0ea90e7a8f3f7876d450e4149c97c74f-boostdesc_bgm.i" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i"
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.16/modules ../opencv-3.4.16
sudo apt install libglew-dev
git clone https://gitee.com/cuixuyang615/Pangolin_new.git
cd Pangolin_new
sudo nano ./src/CMakeLists.txt
sudo nano ./src/display/device/display_x11.cpp
mkdir build && cd build
cmake ..
make
cmake --build .
sudo make install
wget -O boost_1_78_0.tar.gz https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz
tar -zxvf boost_1_78_0.tar.gz
cd boost_1_78_0/
./bootstrap.sh
sudo ./b2 install
git clone https://gitee.com/kobin24/eigen-git-mirror.git
cd eigen-git-mirror
mkdir build
cd build
cmake ..
sudo make install
执行完命令后,需要找到Eigen的安装路径,将Eigen文件夹复制到/usr/include。在Nano上用的是以下命令完成(引自Ubuntu16.04环境下安装配置ORB-SLAM3 —— Hannnnnnnk)
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
sudo apt-get install build-essential libgl1-mesa-dev
sudo apt-get install freeglut3-dev
sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev
sudo apt-get install libssl-dev
git clone https://gitee.com/changlc/ORB_SLAM3_detailed_comments.git
cd ORB_SLAM3_detailed_comments
sudo chmod +x ./build.sh
sudo chmod +x ./build_ros.sh
查看剩余空间
df -h
sudo dd if=/dev/zero of=/swapfile bs=1024 count=20971520
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
删掉
CMakeLists.txt
Thirdparty/g2o/CMakeLists.txt
Thirdparty/DBoW2/CMakeLists.txt
Examples/ROS/ORB_SLAM3/CMakeLists.txt
中
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -march native")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march native")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -march native")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -march native")
结尾的-march native
(见ORB_SLAM3运行时segment fault —— iri_descent),
以及统一这些文件中的OpenCV版本需求(见ORB-SLAM3 安装运行 —— 寒、)
有的为
find_package(OpenCV 4.0 QUIET)
if(NOT OpenCV_FOUND)
find_package(OpenCV 3.0 QUIET)
if(NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV > 3.0 not found.")
endif()
endif()
有的为
find_package(OpenCV 3.0 QUIET)
if(NOT OpenCV_FOUND)
find_package(OpenCV 2.4.3 QUIET)
if(NOT OpenCV_FOUND)
message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
endif()
endif()
建议统一之后再开始编译
./build.sh
sudo nano ~/.bashrc
# ~/ORB_SLAM3_detailed_comments为自己电脑中ORB_SLAM3存放的路径
在末尾加入
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/ORB_SLAM3_detailed_comments/Examples/ROS
保存后再
source ~/.bashrc
./build_ros.sh
sudo swapoff /swapfile