Reference :
Steps:
- 安装所有依赖项
sudo apt-get install -y google-mock libboost-all-dev libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx ros-indigo-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev
1.首先安装ceres solver,选择的版本是1.11,路径随意
1. git clone https://github.com/hitcm/ceres-solver-1.11.0.git
2. cd ceres-solver-1.11.0
3. cmake .
4. make -j
5. sudo make install
2.然后安装 cartographer,路径随意
1. git clone https://github.com/googlecartographer/cartographer.git
2 . cd cartographer
3. cmake .
4. make
5. sudo make install
3.安装cartographer_ros。( Create a new workspace to build this package because of using catkin_make_isolated rather than catkin_make)
# Install wstool and rosdep. sudo apt-get update sudo apt-get install -y python-wstool python-rosdep ninja-build # Create a new workspace in 'catkin_ws_new'. mkdir catkin_ws_new cd catkin_ws_new wstool init src # Merge the cartographer_ros.rosinstall file and fetch code for dependencies. wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall wstool update -t src #This command will install three packages (ceres solver , cartographer ,cartographer_ros),we only use cartographer_ros others could be deleted # Install deb dependencies. # The command 'sudo rosdep init' will print an error if you have already # executed it since installing ROS. This error can be ignored. sudo rosdep init rosdep update rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y # here ROS_DISTRO is indigo # Build and install. catkin_make_isolated --install --use-ninja source install_isolated/setup.bash