1. ceres安装系统中

git clone https://github.com/ceres-solver/ceres-solver.git


# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse and CXSparse (optional)
# - If you want to build Ceres as a *static* library (the default)
# you can use the SuiteSparse package in the main Ubuntu package # repository:
sudo apt-get install libsuitesparse-dev
# - However, if you want to build Ceres as a *shared* library, you must
# add the following PPA:
sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
sudo apt-get update & sudo apt-get install libsuitesparse-dev


tar zxf ceres-solver-1.14.0.tar.gz
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-1.14.0
make -j3
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
make install  ( sudo make install)

2.catkin_make 编译


Install wstool and rosdep.

  • 1      sudo apt-get update
  • 2     sudo apt-get install -y python-wstool python-rosdep ninja-build

# Create a new workspace in 'catkin_ws'.

  • 3    mkdir catkin_ws
  • 4    cd catkin_ws
  • 5    wstool init src

Merge the cartographer_ros.rosinstall file and fetch code for dependencies.

6   wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
7   wstool update -t src
# Install proto3.   #在catkin_ws目录下进行

  • 8       src/cartographer/scripts/install_proto3.sh  

github 直接下载


git clone https://github.com/googlecartographer/cartographer.git
git clone https://github.com/googlecartographer/cartographer_ros.git
git clone https://github.com/googlecartographer/cartographer_turtlebot.git
git clone https://github.com/ceres-solver/ceres-solver.git

安装依赖  src目录

# 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.

  • 9    sudo rosdep init
  • 10    rosdep update
  • 11    rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

编译+安装系统  src目录

Build and install.

  • 12    catkin_make_isolated --install --use-ninja

  • 13   source install_isolated/setup.bash



该部分是个人自加   可以不运行


  1      su root
  2     source /opt/ros/kinetic/setup.bash
 3      catkin_make_isolated --install --use-ninja -DCMAKE_INSTALL_PREFIX=/opt/ros/kinetic
注意:su root 密码忘记时   sudo passwd  可以重新修改密码

注意:cartographer安装后,安装文件安装到了install_isolated里面   进行cartographer_ros的launch文件修改时,在该文件夹下进行修改,否则不起作用


catkin tools安装+cartographer编译

  • 编译:catkin build 
  • 配置: catkin config 

想安装到系统里只需要将安装目录(install)目录配置到系统里 sudo catkin build



检测安装是否正确   可以进行运行以下demo测试


# Download the 2D backpack example bag.

1       wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag

# Launch the 2D backpack demo.

2    roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag


# Download the 3D backpack example bag.
3          wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_3d/with_intensities/b3-2016-04-05-14-14-00.bag

# Launch the 3D backpack demo.
4   roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag