orbslam3安装
ORB-SLAM3配置及安装教程(2023.3)_orbslam3安装-CSDN博客
换源,换成国内的
搜索software
安装工具
sudo apt install git
sudo apt update
sudo apt install gcc g++
cmake安装
cmake安装新版本
ubuntu20.04安装cmake详细教程-CSDN博客
https://cmake.org/download/
tar -zxvf cmake-3.23.0-rc1.tar.gz
cd cmake-3.23.0-rc1
./bootstrap
./bootstrap报错
sudo apt-get install build-essential
./bootstrap
make
sudo make install
cmake -version
which cmake
linux安装cmake_error when bootstrapping cmake: cannot find approp-CSDN博客
Eigen3安装
git clone https://github.com/eigenteam/eigen-git-mirror
cd eigen-git-mirror
mkdir build
cd build
cmake ..
sudo make install
#安装后,头文件安装在/usr/local/include/eigen3/
Pangolin安装
sudo apt install libgl1-mesa-dev
sudo apt install libglew-dev
sudo apt install libpython2.7-dev
sudo apt install pkg-config
sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ..
cmake --build .
这个错误提示说明CMake在配置OpenCV时,未能找到epoxy
库。epoxy
是一个OpenGL库,它提供了对OpenGL的直接访问。在安装OpenCV时,如果启用了OpenGL支持,那么epoxy
库是必须的。
解决方法
你需要安装libepoxy
库及其开发头文件。下面是解决这个问题的步骤:
-
安装
libepoxy
库打开终端并运行以下命令来安装
libepoxy
库:sudo apt update sudo apt install libepoxy-dev
ros安装
ROS的最简单安装——鱼香一键安装_鱼香ros一键安装-CSDN博客
一行命令解决rosdep update失败问题(kinetic, melodic, noetic)_ros noetic版本 rosupdate-CSDN博客
opencv安装
linux下编译安装opencv生成opencv.pc-CSDN博客
pkg-config --modversion opencv
一键安装ros后,opencv也自动安装了。
下面是手动安装的教程。
cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON \
-D BUILD_TESTS=ON \
-D WITH_TBB=ON \
-D WITH_EIGEN=ON \
-D WITH_CUDA=ON \
-D WITH_OPENGL=ON \
-D WITH_QT=ON \
-D WITH_V4L=ON \
-D WITH_FFMPEG=ON \
-D WITH_GTK=ON \
-D WITH_IPP=ON \
-D WITH_JPEG=ON \
-D WITH_PNG=ON \
-D WITH_TIFF=ON \
-D WITH_WEBP=ON \
-D WITH_OPENCL=ON \
-D WITH_OPENMP=ON \
-D WITH_GSTREAMER=ON \
-D ENABLE_PRECOMPILED_HEADERS=ON \
-D BUILD_SHARED_LIBS=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON ..
安装boost库
由此链接进入boost官网:https://www.boost.org/
tar -xzvf boost_1_77_0.tar.gz
cd boost_1_84_0/
sudo ./bootstrap.sh
sudo ./b2 install
安装libssl-dev
sudo apt-get install libssl-dev
安装orbslam3
git clone https://github.com/UZ-SLAMLab/ORB_SLAM3.git
这个看运气 ,运气好就能git到。翻墙增加成功率。
cd ORB_SLAM3
chmod +x build.sh
./build.sh
修改/home/cyk/ORB_SLAM3/CMakeLists.txt
重新安装Pangolin
tracking.cc报错
sed -i ‘s/++11/++14/g’ CMakeLists.txt
报错:internal compiler error
修改./build.sh
最后一行make -j4改为make
gedit ~/.bashrc
/home/cyk/ORB_SLAM3/Examples_old/ROS
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/cyk/ORB_SLAM3/Examples_old/ROS
source ~/.bashrc
./Examples/Stereo/stereo_euroc ./Vocabulary/ORBvoc.txt ./Examples/Stereo/EuRoC.yaml /home/cyk/ORB_SLAM3/dateset/MH01 ./Examples/Stereo/EuRoC_TimeStamps/MH01.txt dataset-MH01_stereo
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/cyk/ORB_SLAM3/Examples/ROS
Examples中是没有ROS这个文件夹的,需要自己去Examples_old中手动复制过去。
chmod +x build_ros.sh
./build_ros.sh
- 纯单目:
roscore
rosrun ORB_SLAM3 Mono Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml
rosbag play MH_01_easy.bag /cam0/image_raw:=/camera/image_raw
sudo rosdep init
rosdep update
[ERROR: default sources list file already exists: /etc/ros/rosdep/sources.list.d/20-default.list-CSDN博客](https://blog.csdn.net/ben_xiao_hai_123/article/details/122105403?ops_request_misc=%7B%22request%5Fid%22%3A%22171880645016800182195948%22%2C%22scm%22%3A%2220140713.130102334…%22%7D&request_id=171880645016800182195948&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2alltop_positive~default-1-122105403-null-null.142v100pc_search_result_base1&utm_term=ERROR%3A default sources list file already exists%3A %2Fetc%2Fros%2Frosdep%2Fsources.list.d%2F20-default.list Please delete if you wish to re-initialize&spm=1018.2226.3001.4187)
cd /home/cyk/ORB_SLAM3/Examples/ROS/ORB_SLAM3
sed -i 's/++11/++14/g' CMakeLists.txt
3.报错
报错1:/home/nj/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/…/…/…/include/ImuTypes.h:29:10: fatal error: sophus/se3.hpp: 没有那个文件或目录
#include <sophus/se3.hpp>
解决1:找到ORB_SLAM3/Examples_old/ROS/ORB_SLAM3下的CMakeLists.txt 修改它,include_directories中添加
${PROJECT_SOURCE_DIR}/../../../Thirdparty/Sophus
原文链接:https://blog.csdn.net/weixin_48924581/article/details/126534339
接下来的报错:
原文链接:https://blog.csdn.net/weixin_48924581/article/details/126534339
解决:
(1)找到ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR下的ros_mono_ar.cc文件:
将第151行的 cv::Mat Tcw = mpSLAM→TrackMonocular(cv_ptr→image,cv_ptr→header.stamp.toSec());
替换为:
cv::Mat Tcw;
Sophus::SE3f Tcw_SE3f = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());
Eigen::Matrix4f Tcw_Matrix = Tcw_SE3f.matrix();
cv::eigen2cv(Tcw_Matrix, Tcw);
(2)找到ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR下的ViewerAR.cc文件:
将第405行的vPoints.push_back(pMP→GetWorldPos());
替换为:
cv::Mat WorldPos;
cv::eigen2cv(pMP->GetWorldPos(), WorldPos);
vPoints.push_back(WorldPos);
(3)还是ViewerAR.cc文件:
将532行的cv::Mat Xw = pMP→GetWorldPos();
替换为:
cv::Mat Xw;
cv::eigen2cv(pMP->GetWorldPos(), Xw);
重新编译
报错3:
解决:加头文件
在/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.h中加入如下:
#include <Eigen/Dense>
#include <opencv2/core/eigen.hpp>
#include <opencv2/opencv.hpp>
再次重新编译,可算ok了
source devel/setup.bash
rosrun kalibr kalibr_calibrate_imu_camera --target dynamic/april_6x6.yaml --bag dynamic/dynamic.bag --cam dynamic/camchain_mono.yaml --imu dynamic/imu_adis16448.yaml --bag-from-to 5 45 --imu-models scale-misalignment --timeoffset-padding 0.1 --show-extraction
kalibr安装
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
export ROS1_DISTRO=noetic # kinetic=16.04, melodic=18.04, noetic=20.04
sudo apt-get install ros-$ROS1_DISTRO-desktop-full
sudo apt-get install python-catkin-tools # ubuntu 16.04, 18.04
sudo apt-get install python3-catkin-tools python3-osrf-pycommon # ubuntu 20.04
[Kalibr编译make报错:error: ‘_1’ was not declared in this scope_kali 编译安装make报错-CSDN博客](https://blog.csdn.net/weixin_43999084/article/details/130876270?ops_request_misc=%7B%22request%5Fid%22%3A%22171889118516800178576731%22%2C%22scm%22%3A%2220140713.130102334.pc%5Fall.%22%7D&request_id=171889118516800178576731&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-1-130876270-null-null.142v100pc_search_result_base1&utm_term=Failed << bsplines_python%3Amake&spm=1018.2226.3001.4187)
解决方法:
/home/cyk/kalibr_workspace/src/kalibr/aslam_nonparametric_estimation/bsplines_python/src/BSplinePython.cpp
修改BSplinePython.cpp 第42还有49行
第42行
原本是
return boost::python::make_function(boost::bind(&BiFunction<T>::getBi, BiFunction<T>(bs->getBiVector(t)), _1)
修改为
return boost::python::make_function(boost::bind(&BiFunction<T>::getBi, BiFunction<T>(bs->getBiVector(t)), std::placeholders::_1)
第49行原本是
return boost::python::make_function(boost::bind(&BiFunction<T>::getBi, BiFunction<T>(bs->getCumulativeBiVector(t)), _1)
修改为
return boost::python::make_function(boost::bind(&BiFunction<T>::getBi, BiFunction<T>(bs->getCumulativeBiVector(t)), std::placeholders::_1)
cd ~/kalibr_workspace/src
git clone https://github.com/ethz-asl/kalibr.git
cd ~/kalibr_workspace/
catkin build -DCMAKE_BUILD_TYPE=Release -j4
source ~/kalibr_workspace/devel/setup.bash
rosrun kalibr kalibr_create_target_pdf --type apriltag --nx [NUM_COLS] --ny [NUM_ROWS] --tsize [TAG_WIDTH_M] --tspace [TAG_SPACING_PERCENT]
eg: rosrun kalibr kalibr_create_target_pdf --type apriltag --nx 8 --ny 8 --tsize 0.1 --tspace 0.3
# 作者给的:
eg: rosrun kalibr kalibr_create_target_pdf --type apriltag --nx 6 --ny 6 --tsize 0.088 --tspace 0.3
SLAM各传感器的标定总结:Camera/IMU/LiDAR_相机和激光雷达标注-CSDN博客