纯净ubuntu18.04 安装SLAM & ROS

视觉SLAM所需库

# 卸载libreoffice
sudo apt remove --purge libreoffice*
# 修改apt源为中科大源
sudo gedit /etc/apt/sources.list
# 替换为
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

sudo gedit /etc/hosts
# 添加
	140.82.113.3 github.com
	199.232.69.194 github.global.ssl.fastly.net
	151.101.84.133 raw.githubusercontent.com
# 更新缓存
sudo /etc/init.d/networking restart
sudo apt update
sudo apt-get install git vim gcc cmake
sudo apt-get install autotools-dev ccache doxygen dh-autoreconf git liblapack-dev libblas-dev libgtest-dev libreadline-dev libssh2-1-dev pylint 

# 下载《视觉SLAM2》程序
cd ~
mkdir SLAM
cd SLAM
git clone https://github.com/gaoxiang12/slambook2
# 下载第三方库
cd slambook2/3rdparty/
rm -rf *
git clone https://github.com/rmsalinas/DBow3.git
git clone https://github.com/stevenlovegrove/Pangolin.git
git clone https://github.com/strasdat/Sophus.git
git clone https://github.com/ceres-solver/ceres-solver.git
git clone https://github.com/RainerKuemmerle/g2o.git
git clone https://github.com/google/googletest.git

sudo apt-get install libeigen3-dev libgl1-mesa-dev libglew-dev libpython2.7-dev pkg-config ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavdevice-dev libdc1394-22-dev libraw1394-dev
# 安装Pangolin
cd Pangolin/
mkdir build
cd build
cmake ..
make
sudo make install
# 安装sophus
cd ../..
cd Sophus/
mkdir build
cd build
cmake ..
make
sudo make install
# 安装opencv3.4
cd ../..
git clone https://gitee.com/zhi-kai/opencv.git
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff5-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev liblapacke-dev libxvidcore-dev libx264-dev  libatlas-base-dev gfortran ffmpeg
cd opencv
mkdir build
cd build
cmake ..
make -j2
sudo make install
# 安装ceres
cd ../..
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3 libgflags-dev libgoogle-glog-dev libgtest-dev
cd ceres-solver/
mkdir build
cd build
cmake ..
make -j2
sudo make install
# 安装g2o
cd ../..
cd g2o/
sudo apt-get install qt5-qmake qt5-default libqglviewer-dev-qt5 libsuitesparse-dev libcxsparse3 libcholmod3
mkdir build
cd build
cmake ..
make -j2
sudo make install
# 安装DBow3
cd ../..
cd DBow3/
mkdir build
cd build
cmake ..
make -j2
sudo make install
# 安装PCL点云库
sudo apt-get install libpcl-dev pcl-tools
# 安装octomap
sudo apt-get install liboctomap-dev octovis
# 安装googletest
cd ../..
cd googletest/
mkdir build
cd build
cmake ..
make -j2
sudo make install
cd ~

安装ROS

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install ros-melodic-desktop-full
sudo apt install python-rosdep
sudo rosdep init
rosdep update
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值