紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
cartographer运行时报错[SUBSCRIBER Error]
-
标题:cartographer运行时报错[SUBSCRIBER Error]
问题描述:
硬件平台:nuc x86
系统版本 ubuntu20.04
ros版本 foxy我在仿真大范围建图的时候将所有话题的数据录制为一个bag数据包后,使用bag播放数据并使用cartographer算法进行离线建图,但运行到一段时间后就会报错,不止离线会这样,在使用gazebo仿真的时候也会偶尔报错,两者区别就是出现频率不一样,离线的会比较高
[occupancy_grid_node-2] 2024-04-16 10:20:35.857 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change
且在出现这个报错后就不能进行建图的保存。
rviz日志
[occupancy_grid_node-2] 2024-04-16 10:18:07.626 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713233890.841698173] [cartographer_ros]: I0416 10:18:10.000000 37828 constraint_builder_2d.cc:281] 26 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1713233890.841770416] [cartographer_ros]: I0416 10:18:10.000000 37828 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 57 Min: 0.700015 Max: 0.793795 Mean: 0.731902 [cartographer_node-1] [0.700015, 0.709393) #### Count: 11 (19.298246%) Total: 11 (19.298246%) [cartographer_node-1] [0.709393, 0.718771) #### Count: 11 (19.298246%) Total: 22 (38.596493%) [cartographer_node-1] [0.718771, 0.728149) #### Count: 10 (17.543859%) Total: 32 (56.140350%) [cartographer_node-1] [0.728149, 0.737527) ## Count: 5 (8.771930%) Total: 37 (64.912277%) [cartographer_node-1] [0.737527, 0.746905) # Count: 2 (3.508772%) Total: 39 (68.421051%) [cartographer_node-1] [0.746905, 0.756283) ## Count: 6 (10.526316%) Total: 45 (78.947365%) [cartographer_node-1] [0.756283, 0.765661) ## Count: 7 (12.280702%) Total: 52 (91.228073%) [cartographer_node-1] [0.765661, 0.775039) Count: 1 (1.754386%) Total: 53 (92.982452%) [cartographer_node-1] [0.775039, 0.784417) Count: 1 (1.754386%) Total: 54 (94.736839%) [cartographer_node-1] [0.784417, 0.793795] # Count: 3 (5.263158%) Total: 57 (100.000000%) [cartographer_node-1] [INFO] [1713233893.029278000] [cartographer_ros]: I0416 10:18:13.000000 37828 constraint_builder_2d.cc:266] Node (0, 4349) with 100 points on submap (0, 43) differs by translation 0.87 rotation 0.025 with score 70.3%. [cartographer_node-1] [INFO] [1713233896.179774102] [cartographer_ros]: I0416 10:18:16.000000 37810 motion_filter.cc:42] Motion filter reduced the number of nodes to 51.2588%. [cartographer_node-1] [INFO] [1713233896.186951505] [cartographer_ros]: I0416 10:18:16.000000 37830 constraint_builder_2d.cc:266] Node (0, 4357) with 100 points on submap (0, 43) differs by translation 0.92 rotation 0.024 with score 71.2%. [occupancy_grid_node-2] 2024-04-16 10:18:16.628 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:18:17.585 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:18:17.686 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713233898.988229757] [cartographer_ros]: I0416 10:18:18.000000 37830 constraint_builder_2d.cc:266] Node (0, 4364) with 104 points on submap (0, 43) differs by translation 0.95 rotation 0.023 with score 71.9%. [occupancy_grid_node-2] 2024-04-16 10:18:19.663 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713233902.574994615] [cartographer_ros]: I0416 10:18:22.000000 37810 collated_trajectory_builder.cc:72] odom rate: 29.41 Hz 3.40e-02 s +/- 2.50e-16 s (pulsed at 99.29% real time) [cartographer_node-1] [INFO] [1713233902.575021898] [cartographer_ros]: I0416 10:18:22.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 8.46e-04 s (pulsed at 100.25% real time) [occupancy_grid_node-2] 2024-04-16 10:18:33.019 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:18:34.406 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713233916.340383226] [cartographer_ros]: I0416 10:18:36.000000 37810 submap_2d.cc:187] Added submap 50 [cartographer_node-1] [INFO] [1713233917.686594726] [cartographer_ros]: I0416 10:18:37.000000 37810 collated_trajectory_builder.cc:72] odom rate: 29.21 Hz 3.42e-02 s +/- 2.83e-03 s (pulsed at 99.61% real time) [cartographer_node-1] [INFO] [1713233917.686627242] [cartographer_ros]: I0416 10:18:37.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 7.85e-04 s (pulsed at 99.12% real time) [occupancy_grid_node-2] 2024-04-16 10:18:44.333 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713233929.116405945] [cartographer_ros]: I0416 10:18:49.000000 37830 constraint_builder_2d.cc:281] 50 computations resulted in 3 additional constraints. [cartographer_node-1] [INFO] [1713233929.116453399] [cartographer_ros]: I0416 10:18:49.000000 37830 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 60 Min: 0.700015 Max: 0.793795 Mean: 0.730867 [cartographer_node-1] [0.700015, 0.709393) #### Count: 12 (20.000000%) Total: 12 (20.000000%) [cartographer_node-1] [0.709393, 0.718771) #### Count: 12 (20.000000%) Total: 24 (40.000000%) [cartographer_node-1] [0.718771, 0.728149) #### Count: 11 (18.333334%) Total: 35 (58.333332%) [cartographer_node-1] [0.728149, 0.737527) ## Count: 5 (8.333333%) Total: 40 (66.666664%) [cartographer_node-1] [0.737527, 0.746905) # Count: 2 (3.333333%) Total: 42 (70.000000%) [cartographer_node-1] [0.746905, 0.756283) ## Count: 6 (10.000000%) Total: 48 (80.000000%) [cartographer_node-1] [0.756283, 0.765661) ## Count: 7 (11.666667%) Total: 55 (91.666664%) [cartographer_node-1] [0.765661, 0.775039) Count: 1 (1.666667%) Total: 56 (93.333336%) [cartographer_node-1] [0.775039, 0.784417) Count: 1 (1.666667%) Total: 57 (95.000000%) [cartographer_node-1] [0.784417, 0.793795] # Count: 3 (5.000000%) Total: 60 (100.000000%) [cartographer_node-1] [INFO] [1713233932.712369722] [cartographer_ros]: I0416 10:18:52.000000 37810 collated_trajectory_builder.cc:72] odom rate: 28.94 Hz 3.46e-02 s +/- 4.31e-03 s (pulsed at 99.11% real time) [cartographer_node-1] [INFO] [1713233932.712395426] [cartographer_ros]: I0416 10:18:52.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 8.30e-04 s (pulsed at 100.08% real time) [occupancy_grid_node-2] 2024-04-16 10:18:53.486 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:18:53.554 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713233947.781983307] [cartographer_ros]: I0416 10:19:07.000000 37810 collated_trajectory_builder.cc:72] odom rate: 28.60 Hz 3.50e-02 s +/- 5.65e-03 s (pulsed at 99.47% real time) [cartographer_node-1] [INFO] [1713233947.782009956] [cartographer_ros]: I0416 10:19:07.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 7.40e-04 s (pulsed at 99.62% real time) [cartographer_node-1] [INFO] [1713233950.025851001] [cartographer_ros]: I0416 10:19:10.000000 37810 submap_2d.cc:187] Added submap 51 [cartographer_node-1] [INFO] [1713233962.846597664] [cartographer_ros]: I0416 10:19:22.000000 37810 collated_trajectory_builder.cc:72] odom rate: 28.94 Hz 3.46e-02 s +/- 4.31e-03 s (pulsed at 99.72% real time) [cartographer_node-1] [INFO] [1713233962.846625473] [cartographer_ros]: I0416 10:19:22.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 8.76e-04 s (pulsed at 99.36% real time) [occupancy_grid_node-2] 2024-04-16 10:19:23.124 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713233966.882129331] [cartographer_ros]: I0416 10:19:26.000000 37829 constraint_builder_2d.cc:281] 36 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1713233966.882207071] [cartographer_ros]: I0416 10:19:26.000000 37829 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 60 Min: 0.700015 Max: 0.793795 Mean: 0.730867 [cartographer_node-1] [0.700015, 0.709393) #### Count: 12 (20.000000%) Total: 12 (20.000000%) [cartographer_node-1] [0.709393, 0.718771) #### Count: 12 (20.000000%) Total: 24 (40.000000%) [cartographer_node-1] [0.718771, 0.728149) #### Count: 11 (18.333334%) Total: 35 (58.333332%) [cartographer_node-1] [0.728149, 0.737527) ## Count: 5 (8.333333%) Total: 40 (66.666664%) [cartographer_node-1] [0.737527, 0.746905) # Count: 2 (3.333333%) Total: 42 (70.000000%) [cartographer_node-1] [0.746905, 0.756283) ## Count: 6 (10.000000%) Total: 48 (80.000000%) [cartographer_node-1] [0.756283, 0.765661) ## Count: 7 (11.666667%) Total: 55 (91.666664%) [cartographer_node-1] [0.765661, 0.775039) Count: 1 (1.666667%) Total: 56 (93.333336%) [cartographer_node-1] [0.775039, 0.784417) Count: 1 (1.666667%) Total: 57 (95.000000%) [cartographer_node-1] [0.784417, 0.793795] # Count: 3 (5.000000%) Total: 60 (100.000000%) [cartographer_node-1] [INFO] [1713233977.849668615] [cartographer_ros]: I0416 10:19:37.000000 37810 collated_trajectory_builder.cc:72] odom rate: 29.14 Hz 3.43e-02 s +/- 3.25e-03 s (pulsed at 100.05% real time) [cartographer_node-1] [INFO] [1713233977.849701920] [cartographer_ros]: I0416 10:19:37.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 7.45e-04 s (pulsed at 99.11% real time) [cartographer_node-1] [INFO] [1713233984.597310099] [cartographer_ros]: I0416 10:19:44.000000 37810 submap_2d.cc:187] Added submap 52 [occupancy_grid_node-2] 2024-04-16 10:19:46.224 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713233993.012246208] [cartographer_ros]: I0416 10:19:53.000000 37810 collated_trajectory_builder.cc:72] odom rate: 28.40 Hz 3.52e-02 s +/- 6.30e-03 s (pulsed at 99.12% real time) [cartographer_node-1] [INFO] [1713233993.012275249] [cartographer_ros]: I0416 10:19:53.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 6.78e-04 s (pulsed at 100.31% real time) [cartographer_node-1] [INFO] [1713233996.793134344] [cartographer_ros]: I0416 10:19:56.000000 37810 motion_filter.cc:42] Motion filter reduced the number of nodes to 51.3444%. [cartographer_node-1] [INFO] [1713234006.464229819] [cartographer_ros]: I0416 10:20:06.000000 37829 constraint_builder_2d.cc:281] 49 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1713234006.464292317] [cartographer_ros]: I0416 10:20:06.000000 37829 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 60 Min: 0.700015 Max: 0.793795 Mean: 0.730867 [cartographer_node-1] [0.700015, 0.709393) #### Count: 12 (20.000000%) Total: 12 (20.000000%) [cartographer_node-1] [0.709393, 0.718771) #### Count: 12 (20.000000%) Total: 24 (40.000000%) [cartographer_node-1] [0.718771, 0.728149) #### Count: 11 (18.333334%) Total: 35 (58.333332%) [cartographer_node-1] [0.728149, 0.737527) ## Count: 5 (8.333333%) Total: 40 (66.666664%) [cartographer_node-1] [0.737527, 0.746905) # Count: 2 (3.333333%) Total: 42 (70.000000%) [cartographer_node-1] [0.746905, 0.756283) ## Count: 6 (10.000000%) Total: 48 (80.000000%) [cartographer_node-1] [0.756283, 0.765661) ## Count: 7 (11.666667%) Total: 55 (91.666664%) [cartographer_node-1] [0.765661, 0.775039) Count: 1 (1.666667%) Total: 56 (93.333336%) [cartographer_node-1] [0.775039, 0.784417) Count: 1 (1.666667%) Total: 57 (95.000000%) [cartographer_node-1] [0.784417, 0.793795] # Count: 3 (5.000000%) Total: 60 (100.000000%) [cartographer_node-1] [INFO] [1713234008.053840131] [cartographer_ros]: I0416 10:20:08.000000 37810 collated_trajectory_builder.cc:72] odom rate: 28.94 Hz 3.46e-02 s +/- 4.31e-03 s (pulsed at 98.84% real time) [cartographer_node-1] [INFO] [1713234008.053869169] [cartographer_ros]: I0416 10:20:08.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 8.02e-04 s (pulsed at 100.32% real time) [cartographer_node-1] [INFO] [1713234020.341586055] [cartographer_ros]: I0416 10:20:20.000000 37810 submap_2d.cc:187] Added submap 53 [occupancy_grid_node-2] 2024-04-16 10:20:22.602 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:20:22.685 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713234023.133855795] [cartographer_ros]: I0416 10:20:23.000000 37810 collated_trajectory_builder.cc:72] odom rate: 28.74 Hz 3.48e-02 s +/- 5.16e-03 s (pulsed at 99.47% real time) [cartographer_node-1] [INFO] [1713234023.133882169] [cartographer_ros]: I0416 10:20:23.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 6.52e-04 s (pulsed at 99.55% real time) [occupancy_grid_node-2] 2024-04-16 10:20:23.850 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:20:24.959 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:20:30.449 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:20:31.380 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:20:32.514 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:20:32.623 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:20:34.802 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [occupancy_grid_node-2] 2024-04-16 10:20:35.857 [SUBSCRIBER Error] Deserialization of data failed -> Function deserialize_change [cartographer_node-1] [INFO] [1713234038.173438028] [cartographer_ros]: I0416 10:20:38.000000 37810 collated_trajectory_builder.cc:72] odom rate: 29.34 Hz 3.41e-02 s +/- 1.62e-03 s (pulsed at 99.80% real time) [cartographer_node-1] [INFO] [1713234038.173469403] [cartographer_ros]: I0416 10:20:38.000000 37810 collated_trajectory_builder.cc:72] scan rate: 5.00 Hz 2.00e-01 s +/- 6.87e-04 s (pulsed at 98.80% real time) ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [rviz2-3] [INFO] [1713234042.514296088] [rclcpp]: signal_handler(signal_value=2) [cartographer_node-1] [INFO] [1713234042.514296087] [rclcpp]: signal_handler(signal_value=2) [occupancy_grid_node-2] [INFO] [1713234042.523108658] [rclcpp]: signal_handler(signal_value=2) [cartographer_node-1] [INFO] [1713234042.561890233] [cartographer_ros]: I0416 10:20:42.000000 37810 node.cc:545] Shutdown the subscriber of [scan] [cartographer_node-1] [INFO] [1713234042.561912285] [cartographer_ros]: I0416 10:20:42.000000 37810 node.cc:545] Shutdown the subscriber of [odom] [cartographer_node-1] [INFO] [1713234042.562749360] [cartographer_ros]: I0416 10:20:42.000000 37810 map_builder_bridge.cc:149] Finishing trajectory with ID '0'... [cartographer_node-1] [INFO] [1713234042.562844572] [cartographer_ros]: I0416 10:20:42.000000 37810 map_builder_bridge.cc:158] Running final trajectory optimization... [cartographer_node-1] [INFO] [1713234042.562865087] [cartographer_ros]: I0416 10:20:42.000000 37827 constraint_builder_2d.cc:281] 36 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1713234042.562922493] [cartographer_ros]: I0416 10:20:42.000000 37827 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 60 Min: 0.700015 Max: 0.793795 Mean: 0.730867 [cartographer_node-1] [0.700015, 0.709393) #### Count: 12 (20.000000%) Total: 12 (20.000000%) [cartographer_node-1] [0.709393, 0.718771) #### Count: 12 (20.000000%) Total: 24 (40.000000%) [cartographer_node-1] [0.718771, 0.728149) #### Count: 11 (18.333334%) Total: 35 (58.333332%) [cartographer_node-1] [0.728149, 0.737527) ## Count: 5 (8.333333%) Total: 40 (66.666664%) [cartographer_node-1] [0.737527, 0.746905) # Count: 2 (3.333333%) Total: 42 (70.000000%) [cartographer_node-1] [0.746905, 0.756283) ## Count: 6 (10.000000%) Total: 48 (80.000000%) [cartographer_node-1] [0.756283, 0.765661) ## Count: 7 (11.666667%) Total: 55 (91.666664%) [cartographer_node-1] [0.765661, 0.775039) Count: 1 (1.666667%) Total: 56 (93.333336%) [cartographer_node-1] [0.775039, 0.784417) Count: 1 (1.666667%) Total: 57 (95.000000%) [cartographer_node-1] [0.784417, 0.793795] # Count: 3 (5.000000%) Total: 60 (100.000000%) [cartographer_node-1] [INFO] [1713234042.640047979] [cartographer_ros]: I0416 10:20:42.000000 37827 pose_graph_2d.cc:382] Remaining work items in queue: 1 [cartographer_node-1] [INFO] [1713234042.640086526] [cartographer_ros]: I0416 10:20:42.000000 37827 constraint_builder_2d.cc:281] 0 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1713234042.640123791] [cartographer_ros]: I0416 10:20:42.000000 37827 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 60 Min: 0.700015 Max: 0.793795 Mean: 0.730867 [cartographer_node-1] [0.700015, 0.709393) #### Count: 12 (20.000000%) Total: 12 (20.000000%) [cartographer_node-1] [0.709393, 0.718771) #### Count: 12 (20.000000%) Total: 24 (40.000000%) [cartographer_node-1] [0.718771, 0.728149) #### Count: 11 (18.333334%) Total: 35 (58.333332%) [cartographer_node-1] [0.728149, 0.737527) ## Count: 5 (8.333333%) Total: 40 (66.666664%) [cartographer_node-1] [0.737527, 0.746905) # Count: 2 (3.333333%) Total: 42 (70.000000%) [cartographer_node-1] [0.746905, 0.756283) ## Count: 6 (10.000000%) Total: 48 (80.000000%) [cartographer_node-1] [0.756283, 0.765661) ## Count: 7 (11.666667%) Total: 55 (91.666664%) [cartographer_node-1] [0.765661, 0.775039) Count: 1 (1.666667%) Total: 56 (93.333336%) [cartographer_node-1] [0.775039, 0.784417) Count: 1 (1.666667%) Total: 57 (95.000000%) [cartographer_node-1] [0.784417, 0.793795] # Count: 3 (5.000000%) Total: 60 (100.000000%) Optimizing: Done. [cartographer_node-1] [INFO] [1713234042.689016520] [cartographer_ros]: I0416 10:20:42.000000 37830 constraint_builder_2d.cc:281] 0 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1713234042.689151875] [cartographer_ros]: I0416 10:20:42.000000 37830 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 60 Min: 0.700015 Max: 0.793795 Mean: 0.730867 [cartographer_node-1] [0.700015, 0.709393) #### Count: 12 (20.000000%) Total: 12 (20.000000%) [cartographer_node-1] [0.709393, 0.718771) #### Count: 12 (20.000000%) Total: 24 (40.000000%) [cartographer_node-1] [0.718771, 0.728149) #### Count: 11 (18.333334%) Total: 35 (58.333332%) [cartographer_node-1] [0.728149, 0.737527) ## Count: 5 (8.333333%) Total: 40 (66.666664%) [cartographer_node-1] [0.737527, 0.746905) # Count: 2 (3.333333%) Total: 42 (70.000000%) [cartographer_node-1] [0.746905, 0.756283) ## Count: 6 (10.000000%) Total: 48 (80.000000%) [cartographer_node-1] [0.756283, 0.765661) ## Count: 7 (11.666667%) Total: 55 (91.666664%) [cartographer_node-1] [0.765661, 0.775039) Count: 1 (1.666667%) Total: 56 (93.333336%) [cartographer_node-1] [0.775039, 0.784417) Count: 1 (1.666667%) Total: 57 (95.000000%) [cartographer_node-1] [0.784417, 0.793795] # Count: 3 (5.000000%) Total: 60 (100.000000%) Optimizing: Done. [cartographer_node-1] [INFO] [1713234042.692212785] [cartographer_ros]: I0416 10:20:42.000000 37830 constraint_builder_2d.cc:281] 0 computations resulted in 0 additional constraints. [cartographer_node-1] [INFO] [1713234042.692258087] [cartographer_ros]: I0416 10:20:42.000000 37830 constraint_builder_2d.cc:283] Score histogram: [cartographer_node-1] Count: 60 Min: 0.700015 Max: 0.793795 Mean: 0.730867 [cartographer_node-1] [0.700015, 0.709393) #### Count: 12 (20.000000%) Total: 12 (20.000000%) [cartographer_node-1] [0.709393, 0.718771) #### Count: 12 (20.000000%) Total: 24 (40.000000%) [cartographer_node-1] [0.718771, 0.728149) #### Count: 11 (18.333334%) Total: 35 (58.333332%) [cartographer_node-1] [0.728149, 0.737527) ## Count: 5 (8.333333%) Total: 40 (66.666664%) [cartographer_node-1] [0.737527, 0.746905) # Count: 2 (3.333333%) Total: 42 (70.000000%) [cartographer_node-1] [0.746905, 0.756283) ## Count: 6 (10.000000%) Total: 48 (80.000000%) [cartographer_node-1] [0.756283, 0.765661) ## Count: 7 (11.666667%) Total: 55 (91.666664%) [cartographer_node-1] [0.765661, 0.775039) Count: 1 (1.666667%) Total: 56 (93.333336%) [cartographer_node-1] [0.775039, 0.784417) Count: 1 (1.666667%) Total: 57 (95.000000%) [cartographer_node-1] [0.784417, 0.793795] # Count: 3 (5.000000%) Total: 60 (100.000000%) [INFO] [rviz2-3]: process has finished cleanly [pid 37814] [INFO] [cartographer_node-1]: process has finished cleanly [pid 37810] [INFO] [occupancy_grid_node-2]: process has finished cleanly [pid 37812]
lua配置:
include "map_builder.lua" include "trajectory_builder.lua" options = { map_builder = MAP_BUILDER, trajectory_builder = TRAJECTORY_BUILDER, map_frame = "map", tracking_frame = "base_link", --base_link -- base_link改为odom,发布map到odom之间的位姿态 published_frame = "odom", --odom odom_frame = "odom", --odom -- true改为false,不用提供里程计数据 provide_odom_frame = false, -- false改为true,仅发布2D位资 publish_frame_projected_to_2d = true, -- false改为true,使用里程计数据 use_odometry = true, use_nav_sat = false, use_landmarks = false, -- 0改为1,使用一个雷达 num_laser_scans = 1, -- 1改为0,不使用多波雷达 num_multi_echo_laser_scans = 0, -- 10改为1,1/1=1等于不分割 num_subdivisions_per_laser_scan = 1, num_point_clouds = 0, lookup_transform_timeout_sec = 0.2, submap_publish_period_sec = 0.5, --0.3 pose_publish_period_sec = 5e-3, trajectory_publish_period_sec = 30e-3, rangefinder_sampling_ratio = 1., odometry_sampling_ratio = 1., fixed_frame_pose_sampling_ratio = 1., imu_sampling_ratio = 1., landmarks_sampling_ratio = 1., } -- false改为true,启动2D SLAM MAP_BUILDER.use_trajectory_builder_2d = true -- 0改成0.10,比机器人半径小的都忽略 TRAJECTORY_BUILDER_2D.min_range = 1.0 --0.10 -- 30改成3.5,限制在雷达最大扫描范围内,越小一般越精确些 TRAJECTORY_BUILDER_2D.max_range = 30 --5 -- 5改成3,传感器数据超出有效范围最大值 TRAJECTORY_BUILDER_2D.missing_data_ray_length = 30. --3.0 -- true改成false,不使用IMU数据,大家可以开启,然后对比下效果 TRAJECTORY_BUILDER_2D.use_imu_data = false -- false改成true,使用实时回环检测来进行前端的扫描匹配 TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = false -- 1.0改成0.1,提高对运动的敏感度 TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(0.2) --0.1 -- 0.55改成0.65,Fast csm的最低分数,高于此分数才进行优化。 POSE_GRAPH.constraint_builder.min_score = 0.7 --0.65 --0.6改成0.7,全局定位最小分数,低于此分数则认为目前全局定位不准确 POSE_GRAPH.constraint_builder.global_localization_min_score = 0.65 --0.7 -- 设置0可关闭全局SLAM POSE_GRAPH.optimize_every_n_nodes = 100 return options
launch文件配置
import os from launch import LaunchDescription from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare def generate_launch_description(): # 定位到功能包的地址 pkg_share = FindPackageShare(package='fishbot_cartographer').find('fishbot_cartographer') #=====================运行节点需要的配置======================================================================= # 是否使用仿真时间,我们用gazebo,这里设置成true use_sim_time = LaunchConfiguration('use_sim_time', default='true') # 地图的分辨率--0.05 resolution = LaunchConfiguration('resolution', default='0.08') # 地图的发布周期--0.5 publish_period_sec = LaunchConfiguration('publish_period_sec', default='1') # 配置文件夹路径 configuration_directory = LaunchConfiguration('configuration_directory',default= os.path.join(pkg_share, 'config') ) # 配置文件 configuration_basename = LaunchConfiguration('configuration_basename', default='fishbot_2d.lua') #=====================声明三个节点,cartographer/occupancy_grid_node/rviz_node================================= cartographer_node = Node( package='cartographer_ros', executable='cartographer_node', name='cartographer_node', output='screen', parameters=[{'use_sim_time': use_sim_time}], arguments=['-configuration_directory', configuration_directory, '-configuration_basename', configuration_basename]) occupancy_grid_node = Node( package='cartographer_ros', executable='occupancy_grid_node', name='occupancy_grid_node', output='screen', parameters=[{'use_sim_time': use_sim_time}], arguments=['-resolution', resolution, '-publish_period_sec', publish_period_sec]) rviz_node = Node( package='rviz2', executable='rviz2', name='rviz2', # arguments=['-d', rviz_config_dir], parameters=[{'use_sim_time': use_sim_time}], output='screen') #===============================================定义启动文件======================================================== ld = LaunchDescription() ld.add_action(cartographer_node) ld.add_action(occupancy_grid_node) ld.add_action(rviz_node) return ld
-
@2475887309 cartographer算法是使用apt安装的,源码安装会报错,一直没解决
-
@2475887309 暂时没有看出问题,可能是性能瓶颈,可以试试使用slam_toolbox 进行大场景地图构建。