报错信息:
[WARN] [1721115226.084763870] [map_saver]: Free threshold unspecified. Setting it to default value: 0.250000
[WARN] [1721115226.084772207] [map_saver]: Occupied threshold unspecified. Setting it to default value: 0.650000
[WARN] [1721115227.595487499] [map_saver]: New publisher discovered on topic '/map', offering incompatible QoS. No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY
[ERROR] [1721115228.085863296] [map_saver]: Failed to spin map subscription
- 解决方法:
参考 - 1.修改navigation2中的nav2_map_server项目中的map_saver.cpp源码,将L190-L194行
增加map_qos.durability_volatile();
if (map_subscribe_transient_local_) {
map_qos.transient_local();
map_qos.reliable();
map_qos.keep_last(1);
map_qos.durability_volatile();
}
- 2 重新编译nav2_map_server package
colcon build --packages-select nav2_map_server