fix(depth): forward the evidence-point keys to the layer namespace
Costmap2DROBOT copies a fixed list of observed_volume keys from obstacles/<source> into <costmap>/obstacles/<source>. The three phase-1 keys were missing, so the live layer always ran with their C++ defaults (evidence off, marking border 0) whatever the runtime YAML said. Unit tests set the layer params directly and did not catch it. The factory test now checks that the runtime YAML values reach the layer.
This commit is contained in:
@@ -241,6 +241,17 @@ TEST(DepthBuffer, RuntimeFactoryForwardsObservedVolumeModeAndPairsSources)
|
||||
std::string mode;
|
||||
ASSERT_TRUE(settings.getParam("depth_clearing_mode", mode));
|
||||
EXPECT_EQ(mode,"observed_volume");
|
||||
// Every observed_volume key of the runtime YAML must reach the layer namespace; a key
|
||||
// missing from the factory forward list silently falls back to its C++ default.
|
||||
const YAML::Node runtime_clearing =
|
||||
YAML::LoadFile((runtime / "costmap_common_params.yaml").string())["obstacles"]["pc_clearing"];
|
||||
for (const char* key : {"depth_evidence_points_enabled", "depth_evidence_points_per_voxel",
|
||||
"depth_marking_border_px", "depth_projection_margin_px", "depth_valid_max_z_m"})
|
||||
{
|
||||
ASSERT_TRUE(runtime_clearing[key].IsDefined()) << key;
|
||||
ASSERT_TRUE(settings.hasParam(key)) << key;
|
||||
EXPECT_EQ(YAML::Dump(settings.getParamValue(key)), YAML::Dump(runtime_clearing[key])) << key;
|
||||
}
|
||||
// Instantiate with the factory's scoped parameters, then verify the paired
|
||||
// owner exists and a marking-only half does not enter legacy observations.
|
||||
robot_costmap_2d::LayeredCostmap parent("odom", true, false);
|
||||
|
||||
Reference in New Issue
Block a user