refactor(depth_layer): read parameters like the other layers
DepthCameraObstacleLayer::loadParameters() wrapped each key in a readParam() helper. It now reads the same way as ObstacleLayer::getParams(): one block of loadParam() calls on the default file, then one block of "if (priv_nh.hasParam(k)) priv_nh.getParam(k, v)" on "<costmap>/<plugin>". The per-source keys do the same on "<costmap>/<plugin>/<source>". Values and precedence are unchanged. getParam() gets the current value as its default, so a value of the wrong type keeps the file default instead of becoming 0, false or "". The layer no longer throws on a wrong type itself. A wrong type in the shared block still stops the costmap, in copyParentParameters(). The two wrong-type test cases, which set the layer namespace directly, are removed.
This commit is contained in:
@@ -459,13 +459,6 @@ TEST(DepthCameraLayerConfig, RejectsUnportedModeAndOutOfRangeValues)
|
||||
cfg = baseConfig();
|
||||
cfg["voxel_resolution"] = 0.0;
|
||||
expectThrow(cfg);
|
||||
// A value of the wrong type stops the layer instead of becoming 0.
|
||||
cfg = baseConfig();
|
||||
cfg["number_clearing_threshold"] = "many";
|
||||
expectThrow(cfg);
|
||||
cfg = baseConfig();
|
||||
cfg["depth_cam"]["FOV_W"] = "wide";
|
||||
expectThrow(cfg);
|
||||
}
|
||||
|
||||
TEST(DepthCameraLayerConfig, RefusesToStartWithoutItsDefaultFile)
|
||||
|
||||
Reference in New Issue
Block a user