一、安装WSL
2、设置su密码:su passwd
二、安装前准备
1、换源
apt install vim
vim /etc/apt/sources.list
# 阿里镜像源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
apt update
apt upgrade
2、安装必要零部件
apt update
apt install vim gedit git cmake tree aptitude
apt install -y build-essential
3、安装Pangolin(v0.5)
sudo apt-get install libglew-dev
sudo apt-get install libpython2.7-dev
sudo apt-get install ffmpeg libavcodec-dev libavutil-dev libavformat-dev
sudo apt-get install libdc1394-22-dev libraw1394-dev
sudo apt-get install libjpeg-dev libtiff5-dev libopenexr-dev
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ..
make -j
make install
4、安装Opencv(3.4.4)
https://github.com/opencv/opencv/releases/tag/3.4.4
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install pkg-config
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j
make install
5、安装Eigen3
注意也要 make install
6、安装g2o的相关依赖项
apt install libeigen3-dev
apt install libsuitesparse-dev qtdeclarative5-dev qt5-qmake libqglviewer-dev-qt5
三、安装ORB-SLAM2
1、安装步骤
mkdir -p catkin_ws/src
cd catkin_ws/src
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
cd ORB_SLAM2
sh build.sh
2、'usleep'报错
(25条消息) ORB-slam2编译时报错‘usleep’ was not declared in this scope__Evanism.�的博客-优快云博客
3、'CV_'类报错
原因是opencv版本过高,比如安装了4.5版本等
opencv常见用法和opencv3->opencv4版本切换_xlsemmmmmm的博客-优快云博客_切换opencv版本
4、测试数据集
(21条消息) SLAM学习--常用数据集_Robot-G的博客-优快云博客_slam数据集
四、安装ROS
1、安装步骤
cn/melodic/Installation/Ubuntu - ROS Wiki
2、rosdep update 报错问题
rosdep init/update 解决方法_CCsherlock的博客-优快云博客
五、编译orb-slam2的ros部分
1、编译
vi ~/.bashrc
# 在末尾添加
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/xfy/catkin_ws/src/ORB_SLAM2/Examples/ROS
source ~/.bashrc
cd /home/xfy/catkin_ws/src/ORB-SLAM2/
sh build_ros.sh
cd /home/xfy/catkin_ws/
catkin_make
2、测试
六、安装evo
apt install python-pip
pip install evo --upgrade --no-binary evo
运行命令参考官网:MichaelGrupp/evo: Python package for the evaluation of odometry and SLAM (github.com)
七、安装yolov3
leggedrobotics/darknet_ros: YOLO ROS: Real-Time Object Detection for ROS (github.com)
八、安装仿真环境
(21条消息) gazebo+ORB-SLAM仿真教程_Mr.Qin_的博客-优快云博客
如遇问题可参考github解决:Issues · DroidAITech/ROS-Academy-for-Beginners (github.com)