安装
apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
mkdir cartograph_ws
cd catkin_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src
安装absl
cd /home/xg/cartograph_ws/src/cartographer/scripts
sh install_abseil.sh
提示错误 sudo: stow: command not found
sudo apt-get install stow cd /usr/local/stow sudo stow absl
安装proto3
src/cartographer/scripts/install_proto3.sh
安装依赖
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
编译安装
catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash
测试
下载2D 数据包 链接:https://pan.baidu.com/s/1e3XPcdo6AJ1oVYnVs3dedA 提取码:cbag
运行节点并加载数据包
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=/home/xg/cartograph_ws/src/cartographer_paper_deutsches_museum.bag
运行结果:
Count: 2150 Min: 0.550067 Max: 0.869223 Mean: 0.664726 [0.550067, 0.581983) #### Count: 401 (18.6512%) Total: 401 (18.6512%) [0.581983, 0.613898) ### Count: 352 (16.3721%) Total: 753 (35.0233%) [0.613898, 0.645814) ### Count: 300 (13.9535%) Total: 1053 (48.9767%) [0.645814, 0.677730) ## Count: 233 (10.8372%) Total: 1286 (59.814%) [0.677730, 0.709645) ## Count: 248 (11.5349%) Total: 1534 (71.3488%) [0.709645, 0.741561) ## Count: 186 (8.65116%) Total: 1720 (80%) [0.741561, 0.773476) # Count: 140 (6.51163%) Total: 1860 (86.5116%) [0.773476, 0.805392) # Count: 112 (5.2093%) Total: 1972 (91.7209%) [0.805392, 0.837307) # Count: 122 (5.67442%) Total: 2094 (97.3953%) [0.837307, 0.869223] # Count: 56 (2.60465%) Total: 2150 (100%) [ WARN] [1606649453.012731557, 1432648929.452911919]: W1129 19:30:52.000000 28349 preprocessor.cc:62] Specified options.num_threads: 7 exceeds maximum available from the threading model Ceres was compiled with: 2. Bounding to maximum number available. [ INFO] [1606649455.551054076, 1432648929.452911919]: I1129 19:30:55.000000 28349 pose_graph_2d.cc:538] Remaining work items in queue: 467506 [ INFO] [1606649460.028123428, 1432648929.452911919]: I1129 19:31:00.000000 28348 constraint_builder_2d.cc:275] Node (0, 3735) with 209 points on submap (0, 37) differs by translation 0.01 rotation 0.002 with score 59.0%. [ INFO] [1606649460.484508718, 1432648929.452911919]: I1129 19:31:00.000000 28350 constraint_builder_2d.cc:275] Node (0, 3735) with 209 points on submap (0, 38) differs by translation 0.00 rotation 0.002 with score 57.7%. [ INFO] [1606649460.994253503, 1432648929.452911919]: I1129 19:31:00.000000 28351 constraint_builder_2d.cc:275] Node (0, 3735) with 209 points on submap (0, 39) differs by translation 0.01 rotation 0.003 with score 57.5%. [ INFO] [1606649462.130448422, 1432648929.452911919]: I1129 19:31:02.000000 28348 constraint_builder_2d.cc:275] Node (0, 3738) with 206 points on submap (0, 37) differs by translation 0.02 rotation 0.002 with score 56.9%. [ INFO] [1606649462.431209623, 1432648929.452911919]: I1129 19:31:02.000000 28349 constraint_builder_2d.cc:275] Node (0, 3738) with 206 points on submap (0, 38) differs by translation 0.01 rotation 0.001 with score 57.0%. [ INFO] [1606649463.082091747, 1432648929.452911919]: I1129 19:31:03.000000 28348 constraint_builder_2d.cc:275] Node (0, 3738) with 206 points on submap (0, 39) differs by translation 0.01 rotation 0.000 with score 56.6%. [ INFO] [1606649463.290139648, 1432648929.452911919]: I1129 19:31:03.000000 28348 constraint_builder_2d.cc:275] Node (0, 3740) with 203 points on submap (0, 32) differs by translation 0.02 rotation 0.002 with score 55.4%. [ INFO] [1606649463.591548750, 1432648929.452911919]: I1129 19:31:03.000000 28349 constraint_builder_2d.cc:275] Node (0, 3741) with 200 points on submap (0, 38) differs by translation 0.01 rotation 0.002 with score 57.3%. [ INFO] [1606649464.382558197, 1432648929.452911919]: I1129 19:31:04.000000 28349 constraint_builder_2d.cc:275] Node (0, 3741) with 200 points on submap (0, 39) differs by translation 0.00 rotation 0.002 with score 55.7%. [ INFO] [1606649465.116113992, 1432648929.452911919]: I1129 19:31:05.000000 28348 constraint_builder_2d.cc:275] Node (0, 3742) with 206 points on submap (0, 31) differs by translation 0.01 rotation 0.001 with score 55.2%. [ INFO] [1606649465.512419109, 1432648929.452911919]: I1129 19:31:05.000000 28351 constraint_builder_2d.cc:275] Node (0, 3742) with 206 points on submap (0, 37) differs by translation 0.02 rotation 0.000 with score 60.1%. [ INFO] [1606649465.627076953, 1432648929.452911919]: I1129 19:31:05.000000 28349 constraint_builder_2d.cc:275] Node (0, 3743) with 207 points on submap (0, 32) differs by translation 0.01 rotation 0.002 with score 57.0%. [ INFO] [1606649466.810027369, 1432648929.452911919]: I1129 19:31:06.000000 28349 constraint_builder_2d.cc:275] Node (0, 3745) with 200 points on submap (0, 39) differs by translation 0.02 rotation 0.004 with score 56.5%. [ INFO] [1606649473.829553342, 1432648929.452911919]: I1129 19:31:13.000000 28350 constraint_builder_2d.cc:275] Node (0, 3751) with 206 points on submap (0, 39) differs by translation 0.01 rotation 0.000 with score 57.8%. [ INFO] [1606649474.380818811, 1432648929.452911919]: I1129 19:31:14.000000 28349 constraint_builder_2d.cc:275] Node (0, 3751) with 206 points on submap (0, 38) differs by translation 0.02 rotation 0.001 with score 56.1%. [ INFO] [1606649477.660047279, 1432648929.452911919]: I1129 19:31:17.000000 28348 constraint_builder_2d.cc:275] Node (0, 3752) with 219 points on submap (0, 31) differs by translation 0.01 rotation 0.003 with score 55.1%. [ INFO] [1606649482.160297504, 1432648929.452911919]: I1129 19:31:22.000000 28350 constraint_builder_2d.cc:275] Node (0, 3755) with 202 points on submap (0, 39) differs by translation 0.01 rotation 0.001 with score 58.6%. [ INFO] [1606649482.348532520, 1432648929.452911919]: I1129 19:31:22.000000 28348 constraint_builder_2d.cc:275] Node (0, 3755) with 202 points on submap (0, 38) differs by translation 0.01 rotation 0.003 with score 55.5%. [ INFO] [1606649486.362355653, 1432648929.452911919]: I1129 19:31:26.000000 28350 constraint_builder_2d.cc:275] Node (0, 3758) with 207 points on submap (0, 39) differs by translation 0.03 rotation 0.005 with score 60.6%. [ INFO] [1606649486.403350903, 1432648929.452911919]: I1129 19:31:26.000000 28349 constraint_builder_2d.cc:275] Node (0, 3758) with 207 points on submap (0, 38) differs by translation 0.04 rotation 0.005 with score 57.2%. [ INFO] [1606649488.898613659, 1432648929.452911919]: I1129 19:31:28.000000 28350 constraint_builder_2d.cc:275] Node (0, 3761) with 219 points on submap (0, 39) differs by translation 0.02 rotation 0.002 with score 57.2%. [ INFO] [1606649489.357661879, 1432648929.452911919]: I1129 19:31:29.000000 28351 constraint_builder_2d.cc:275] Node (0, 3761) with 219 points on submap (0, 38) differs by translation 0.04 rotation 0.004 with score 56.2%.
结果截图: