Skip to content

Commit f38dd46

Browse files
bektaskemalKemal Bektas
authored andcommitted
fix(nav2_costmap_2d): make obstacle layer not current on enabled toggle (ros-navigation#4507)
Signed-off-by: Kemal Bektas <[email protected]> Co-authored-by: Kemal Bektas <[email protected]> Signed-off-by: stevedanomodolor <[email protected]>
1 parent 587eec4 commit f38dd46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nav2_costmap_2d/plugins/obstacle_layer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,11 @@ ObstacleLayer::dynamicParametersCallback(
307307
max_obstacle_height_ = parameter.as_double();
308308
}
309309
} else if (param_type == ParameterType::PARAMETER_BOOL) {
310-
if (param_name == name_ + "." + "enabled") {
310+
if (param_name == name_ + "." + "enabled" && enabled_ != parameter.as_bool()) {
311311
enabled_ = parameter.as_bool();
312+
if (enabled_) {
313+
current_ = false;
314+
}
312315
} else if (param_name == name_ + "." + "footprint_clearing_enabled") {
313316
footprint_clearing_enabled_ = parameter.as_bool();
314317
}

0 commit comments

Comments
 (0)