@Pangolin
$sudo apt update
$sudo apt upgrade
$sudo apt install libglew-dev cmake libboost-dev libboost-thread-dev libboost-filesystem-dev libeigen3-dev -y
$git clone https://github.com/stevenlovegrove/Pangolin.git
$cd Pangolin
$mkdir build
$cd build
$cmake ..
$sudo make -j4
$sudo make install
@ORB_SLAM3
$git clone https://github.com/INDEMIND/ORB_SLAM3.git
$cd ORB_SLAM3
$chmod +x build.sh
$./build.sh
$mkdir Datasets
"MH_01_easy"rename"MH01"
"MH01" copy "~/ORB_SLAM3/Datasets"
@libpango_image.so
$sudo find / -name libpango_image.so
[sudo] xx 的密码:
/home/xx/Pangolin/Pangolin/build/libpango_image.so
find: ‘/run/user/1000/doc’: 权限不够
find: ‘/run/user/1000/gvfs’: 权限不够
/usr/local/lib/libpango_image.so
$ sudo gedit /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
/usr/local/lib/libpango_image.so
(gedit:9480): IBUS-WARNING **: 17:04:58.953: The owner of /home/xx/.config/ibus/bus is not root!
** (gedit:9480): WARNING **: 17:05:24.103: Set document metadata failed: 不支持设置属性 metadata::gedit-spell-language
** (gedit:9480): WARNING **: 17:05:24.104: Set document metadata failed: 不支持设置属性 metadata::gedit-encoding
** (gedit:9480): WARNING **: 17:05:24.106: Set document metadata failed: 不支持设置属性 metadata::gedit-position
$sudo /sbin/ldconfig
@run
$./Examples/Stereo/stereo_euroc ./Vocabulary/ORBvoc.txt ./Examples/Stereo/EuRoC.yaml ./Datasets/MH01 ./Examples/Stereo/EuRoC_TimeStamps/MH01.txt
@create myvideo_slam
$cd ~/ORB_SLAM3/Examples/Monocular
$sudo gedit myvideo.cpp
#include <opencv2/opencv.hpp>
#include "System.h"
#include <string>
#include <chrono>
#include <iostream>
using namespace std;
string parameterFile = "./myvideo.yaml";
string vocFile = "./../../Vocabulary/ORBvoc.txt";
string videoFile = "./video.mp4";
int main(int argc, char **argv){
ORB_SLAM3::System SLAM(vocFile, parameterFile, ORB_SLAM3::System::MONOCULAR, true);
cv::VideoCapture cap(videoFile);
auto start = chrono::system_clock::now();
while(1){
cv::Mat frame;
cap >> frame;
if(frame.data == nullptr)
break;
cv::Mat frame_resized;
cv::resize(frame, frame_resized, cv::Size(960,540));
auto now = chrono::system_clock::now();
auto timestamp = chrono::duration_cast<chrono::milliseconds>(now - start);
SLAM.TrackMonocular(frame_resized, double(timestamp.count())/1000.0);
cv::waitKey(30);
}
SLAM.Shutdown();
return 0;
}
$cd ~/ORB_SLAM3
$sudo gedit CmakeLists.txt
······
#Monocular examples
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Monocular)
add_executable(mono_tum
Examples/Monocular/mono_tum.cc)
target_link_libraries(mono_tum ${PROJECT_NAME})
add_executable(mono_kitti
Examples/Monocular/mono_kitti.cc)
target_link_libraries(mono_kitti ${PROJECT_NAME})
add_executable(mono_euroc
Examples/Monocular/mono_euroc.cc)
target_link_libraries(mono_euroc ${PROJECT_NAME})
add_executable(mono_tum_vi
Examples/Monocular/mono_tum_vi.cc)
target_link_libraries(mono_tum_vi ${PROJECT_NAME})
if(realsense2_FOUND)
add_executable(mono_realsense_t265
Examples/Monocular/mono_realsense_t265.cc)
target_link_libraries(mono_realsense_t265 ${PROJECT_NAME})
add_executable(mono_realsense_D435i
Examples/Monocular/mono_realsense_D435i.cc)
target_link_libraries(mono_realsense_D435i ${PROJECT_NAME})
endif()
add_executable(myvideo Examples/Monocular/myvideo.cpp)
target_link_libraries(myvideo ${PROJECT_NAME})
······
$sudo gedit myvideo.yaml
%YAML:1.0
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"
# Camera calibration and distortion parameters (OpenCV)
Camera.fx: 614.3472290039062
Camera.fy: 613.3615112304688
Camera.cx: 314.36767578125
Camera.cy: 239.8182830810547
Camera.k1: 0.0
Camera.k2: 0.0
Camera.p1: 0.0
Camera.p2: 0.0
Camera.k3: 0.0
# Camera frames per second
Camera.fps: 30.0
# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
Camera.RGB: 1
# Camera resolution
Camera.width: 1920
Camera.height: 1080
#--------------------------------------------------------------------------------------------
# ORB Parameters
#--------------------------------------------------------------------------------------------
# ORB Extractor: Number of features per image
ORBextractor.nFeatures: 1000
# ORB Extractor: Scale factor between levels in the scale pyramid
ORBextractor.scaleFactor: 1.2
# ORB Extractor: Number of levels in the scale pyramid
ORBextractor.nLevels: 8
# ORB Extractor: Fast threshold
# Image is divided in a grid. At each cell FAST are extracted imposing a minimum response.
# Firstly we impose iniThFAST. If no corners are detected we impose a lower value minThFAST
# You can lower these values if your images have low contrast
ORBextractor.iniThFAST: 20
ORBextractor.minThFAST: 7
#--------------------------------------------------------------------------------------------
# Viewer Parameters
#--------------------------------------------------------------------------------------------
Viewer.KeyFrameSize: 0.05
Viewer.KeyFrameLineWidth: 5
Viewer.GraphLineWidth: 0.9
Viewer.PointSize: 2
Viewer.CameraSize: 0.08
Viewer.CameraLineWidth: 3
Viewer.ViewpointX: 0
Viewer.ViewpointY: -0.7
Viewer.ViewpointZ: -1.8
Viewer.ViewpointF: 500
$cd ~/ORB_SLAM3
$./build.sh
$cd Examples/Monocular
$./myvideo
@realtime
Intel RealSense SDK 2.0 – Intel RealSense Depth and Tracking cameras
$cd ORB_SLAM3
$chmod +x build.sh
$./build.sh
$./Examples/Monocular/mono_realsense_D435i Vocabulary/ORBvoc.txt ./Examples/Stereo-Inertial/RealSense_D435i.yaml