方法1:
直接二进制包进行安装
sudo apt-get update
sudo apt-get install ros-melodic-cartographer* //安装全部关于cartographer的包
方法2: 源码安装
2.1,安装相关的依赖
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
sudo apt-get install cmake
sudo apt-get install build-essential