退出conda环境
1. 下载Pangolin库
安装依赖出现问题E: Unable to locate package libglew-dev
sudo apt-get update
2.编译ros
sudo gedit ~/.bashrc
echo 'export ROS_PACKAGE_PATH=/home/a/camera/ORB_SLAM/Examples_old/ROS/ORB_SLAM3:$ROS_PACKAGE_PATH' >> ~/.bashrc
source ~/.bashrc
source ~/.bashrc
chmod +x build_ros.sh
./build_ros.sh
3.报错:fatal error: sophus/se3.hpp: No such file or directory

打开/orb_slam3/Examples_old/ROS/ORB_SLAM3/CMakeLists.txt
第49行加入
${PROJECT_SOURCE_DIR}/../../../Thirdparty/Sophus
4. error: conversion from ‘Eigen::Vector3f {aka Eigen::Matrix<float, 3, 1>}’ to non-scalar type ‘cv::Mat’ requested cv::Mat Xw = pMP->GetWorldPos();
参考此文:
https://blog.csdn.net/qq_44164791/article/details/132608190?spm=1001.2014.3001.5501
5. bash: catkin_make: command not found
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
catkin_make
6.运行示例命令(ORB-SLAM3目录下建立dataset/V102)
./Examples/Monocular-Inertial/mono_inertial_euroc ./Vocabulary/ORBvoc.txt ./Examples/Monocular-Inertial/EuRoC.yaml ./dataset/V102 ./Examples/Monocular-Inertial/EuRoC_TimeStamps/V102.txt dataset-V102_monoi
7.运行ros
gedit ~/.bashrc
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/root/local_container_2/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3
source ~/.bashrc
rosrun ORB_SLAM3 Mono /root/local_container_2/ORB_SLAM3/Vocabulary/ORBvoc.txt /root/local_container_2/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/Asus.yaml
rosrun ORB_SLAM3 Mono /root/docker_local_ORB/ORB_SLAM/Vocabulary/ORBvoc.txt /root/docker_local_ORB/ORB_SLAM/Examples_old/ROS/ORB_SLAM3/Asus.yaml
rosrun ORB_SLAM3 Mono /home/a/camera/ORB_SLAM/Vocabulary/ORBvoc.txt /home/a/camera/ORB_SLAM/Examples_old/ROS/ORB_SLAM3/Asus.yaml
rosrun ORB_SLAM3 zed2i /home/a/camera/ORB_SLAM/Vocabulary/ORBvoc.txt /home/a/camera/ORB_SLAM/Examples_old/ROS/ORB_SLAM3/ros_zed2i.yaml false
上述命令都在一个容器终端里运行
8.运行./build_ros.bashrc报错
已经反复添加了ROS_PACKAGE_PATH,但是始终 You should double-check your ROS_PACKAGE_PATH to ensure that packages are found in the correct precedence order.

[rosbuild] Building package ORB_SLAM3 Failed to invoke /opt/ros/melodic/bin/rospack deps-manifests ORB_SLAM3 [rospack] Error: the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update
如果直接进行source /opt/ros/melodic/setup.bash则会覆盖掉错误,无效运行./build_ros.bashrc
sudo apt-get update
sudo apt-get install python-pip
sudo pip install rosdepc
# 初始化 rosdep(仅需执行一次)
sudo rosdepc init
# 更新 rosdep 数据库(每次更新依赖前建议运行)
rosdepc update
cd /root/docker_local_ORB/ORB_SLAM3
# 安装缺失的依赖(在 ORB_SLAM3 目录下运行)
rosdepc install --from-paths src --ignore-src -y
./build_ros.sh
![]()

2661

被折叠的 条评论
为什么被折叠?



