Skip to content

Commit 381dec7

Browse files
mergify[bot]SteveMacenskiclaude[bot]
authored andcommitted
fix: Move SmootherParams declaration outside smooth_path conditional (ros-navigation#5473) (ros-navigation#5474)
Fixes crash when dynamically changing smooth_path parameter from false to true. The issue occurred because SmootherParams were only declared when smooth_path was initially true, causing ParameterModifiedInCallbackException when trying to declare parameters within the dynamic parameter callback. Now SmootherParams are always declared, making them available for dynamic reconfiguration regardless of the initial smooth_path value. Fixes ros-navigation#5472 (cherry picked from commit 69a60df) Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent c0ea47d commit 381dec7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎nav2_smac_planner/src/smac_planner_hybrid.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ void SmacPlannerHybrid::configure(
237237
_angle_quantizations);
238238

239239
// Initialize path smoother
240+
SmootherParams params;
241+
params.get(node, name);
240242
if (smooth_path) {
241-
SmootherParams params;
242-
params.get(node, name);
243243
_smoother = std::make_unique<Smoother>(params);
244244
_smoother->initialize(_minimum_turning_radius_global_coords);
245245
}

‎nav2_smac_planner/src/smac_planner_lattice.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ void SmacPlannerLattice::configure(
201201
_metadata.number_of_headings);
202202

203203
// Initialize path smoother
204+
SmootherParams params;
205+
params.get(node, name);
204206
if (smooth_path) {
205-
SmootherParams params;
206-
params.get(node, name);
207207
_smoother = std::make_unique<Smoother>(params);
208208
_smoother->initialize(_metadata.min_turning_radius);
209209
}

0 commit comments

Comments
 (0)