cartographer 安裝
安装之前说明,本方案主要参考cartographer自带sh文件安装,在路径cartographer/scripts/下。每个依赖都有对应的版本,和安装依赖顺序,博主参考他人的方案一直出现问题,归咎于对以来的版本没有把握准确。包括包所有功能包,依赖包。
1、cartographer 下载
1.1创建工作空间,并下载到/catkin_ws/src下
mkdir -p /catkin_ws/src
注意下载版本,文件后缀有标注
1.2 下载地址,这版本不会出现依赖版本问题
git clone -b 0.3.0 https://github.com/googlecartographer/cartographer_ros.git
git clone -b 0.3.0 https://github.com/googlecartographer/cartographer.git
git clone -b 1.13.0 https://github.com/ceres-solver/ceres-solver.git
cartographer包CSDN链接,三个包.(ceres cartographer cartographer_ros )
后续补充。。。。。
2、进行rosdep
$ rosdep update
将下载的文件移动到src文件夹下,并在catkin_ws文件路径下运行以下指令
$ rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
rosdep update运行出错的简单解决方法 :https://blog.csdn.net/weixin_44023934/article/details/121242176
安装后,正确会出现:
#All required rosdeps installed successfully
注:rosdep工具就是用来检查包的丢失依赖项,并且完成下载和安装
3、cartographer 安装
安装cartographer系统依赖
官方说明路径:cartographer-0.3.0/scripts/install_debs.sh
sudo apt-get update
sudo apt-get install -y \
cmake \
g++ \
git \
google-mock \
libboost-all-dev \
libcairo2-dev \
libeigen3-dev \
libgflags-dev \
libgoogle-glog-dev \
liblua5.2-dev \
libsuitesparse-dev \
ninja-build \
python-sphinx
安装依赖protobuf
官方说明在:cartographer-0.3.0/scripts/install_proto3.sh
#VERSION="v3.4.1"
# Build and install proto3.
git clone -b v3.4.1 https://github.com/google/protobuf.git
cd protobuf-3.4.1
git checkout
mkdir build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_TESTS=OFF \
../cmake
ninja
sudo ninja install
开始编译
// Build and install.
$ catkin_make_isolated --install --use-ninja
$ source install_isolated/setup.bash
4、测试是否安装成功
4.1、使用自己数据建图
4.2、使用官方数据建图
// Download the 2D backpack example bag.
$ wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag
// Launch the 2D backpack demo.
$ roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag
// Download the 3D backpack example bag.
$ 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.
$ roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag
注意:{HOME}/Downloads/cartographer_paper_deutsches_museum.bag中的{HOME}不需要改變,只需要修改/Downloads/的路徑
参考链接::https://blog.csdn.net/rjasd1128hf/article/details/79888305