链接:下载地址
提取码:fl4o
参考地址
安装cmake,进行程序的编译
sudo apt-get install cmake
安装gcc、g++
sudo apt-get install g++
sudo apt-get install gcc
安装依赖项
sudo apt-get install libglew-dev libpython2.7-dev
从Github将项目下载到本地
git clone https://github.com/stevenlovegrove/Pangolin.git
在这里插入图片描述
进入pangolin目录
新建build目录
进行编译
cd Pangolin
mkdir build
cd build
cmake ..
make -j
sudo make install
安装依赖项
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
下载openCV ,也可自行到官网或用命令下载
sudo apt-get install libeigen3-dev
一样前面给了安装包,也可选择克隆仓库
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
编译ORB-SLAM2
cd ORB_SLAM2
chmod +x build.sh
./build.sh
将包含Examples/ROS/ORB_SLAM2的路径添加到ROS_PACKAGE_PATH环境变量中。打开.bashrc文件并在最后添加。
sudo gedit ~/.bashrc
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/home/zjc/catkin_ws/src/ORB_SLAM2/Examples/ROS
source ./catkin_ws/devel/setup.sh
使修改后的/.bashrc文件生效
source ~/.bashrc
cd catkin_ws/src/ORB_SLAM2
chmod +x build_ros.sh
./build_ros.sh
下载数据集(前面给出)
在catkin_ws/src/ORB_SLAM2目录下打开终端运行:
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUM1.yaml /home/zjc/rgbd_dataset_freiburg1_xyz
1.打开roscore
roscore
启动usb_cam节点
roslaunch usb_cam usb_cam-test.launch
查看话题
rostopic list
找到/home/xxx/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/ros_momo.cc文件
修改路径为:
/usb_cam/image_raw
重新编译
在/catkin_ws/src/ORB_SLAM2目录下打开终端
./build_ros.sh
运行实时单目
同样在/catkin_ws/src/ORB_SLAM2目录下打开终端运行
rosrun ORB_SLAM2 Mono Vocabulary/ORBvoc.txt Examples/Monocular/TUM1.yaml