- 实验室移动机器人平台的开发基于ubuntu,几大基本套件包括QT、ROS、PCL、VTK、cmake等,下面简单说一下安装。
建议安装顺序:cmake(>3.19)——QT———VTK8.2.0——PCL1.9.1——ROS(注意:如果后面要使用Cartographer,就不用装VKK和PCL,使用ROS自带的)
Cmake
去官网下载源码,采用编译安装形式
# 下载安装包,解压
tar -zxvf cmake.tar.gz
cd cmake
./bootstrap# 如出现找不到open_ssl,安装一下libssl-devmake
sudo make install# 查看版本号cmake --version
QT
去官网下载.run安装文件
sudo chmod +x qt.run
sudo ./qt.run
#可视化安装界面,注意填入临时资料库地址
http://mirrors.ustc.edu.cn/qtproject/online/qtsdkrepository/linux_x64/root/qt/
安装VTK
#安装X11
sudo apt-get install libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev# 安装OPEN_GL
sudo apt-get install build-essential libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev# 解压安装包,进文件夹后mkdir build && cd build
cmake ..
make -j8
sudo make install
安装PCL
# 首先依赖
sudo apt-get install libeigen3-dev
sudo apt-get install libflann-devsudo apt-get install libboost-all-devsudo apt-get install qt-sdk openjdk-8-jdk openjdk-8-jre# 下载安装包解压,进入文件夹mkdir build && cd buildcamke ..
make -j8
sudo make install
安装ROS(melodic)
# 添加源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'# 添加秘钥
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -# 更新源
sudo apt update# 安装ROS完整版
sudo apt install ros-melodic-desktop-full# 添加环境变量
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc# 安装其他包
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential# 初始化rosdep(不操作可,需要代理)
sudo rosdep init
rosdep update# 创建工作目录,并添环境变量
mkdir -p ~/catkin_ws/srccd ~/catkin_ws/
catkin_makeecho "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
其他库安装
Eigen
- 用于矩阵运算
sudo apt install libeigen3-dev
Sophus
- Eigen的扩展,用于李群和李代数转换
git clone https://github.com/strasdat/Sophus.git
cd sophus
mkdir build
cd build
cmake ..
make
sudo make install
GTSAM
- GTSAM(Georgia Tech Smoothing and Mapping)是基于因子图的C++库,它可以解决slam和sfm的问题,当然它也可以解决简单或者更加复杂的估计问题。
git clone https://github.com/borglab/gtsam.git
cd gtsam
mkdir build && cd build
cmake ..
make check
sudo make install
ceres
- 用于非线性优化
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# SuiteSparse and CXSparse (optional)
sudo apt-get install libsuitesparse-devwget http://ceres-solver.org/ceres-solver-2.0.0.tar.gz
tar zxf ceres-solver-2.0.0.tar.gz
cd ceres-solver
mkdir build && cd build
cmake ..
makesudo make install
g2o
- 用于图优化
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build && cd build
cmake ..
makesudo make install