Skip to content

Commit 69a60df

Browse files
fix: Move SmootherParams declaration outside smooth_path conditional (#5473)
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 #5472 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent 8aedf20 commit 69a60df

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
@@ -273,9 +273,9 @@ void SmacPlannerHybrid::configure(
273273
_angle_quantizations);
274274

275275
// Initialize path smoother
276+
SmootherParams params;
277+
params.get(node, name);
276278
if (smooth_path) {
277-
SmootherParams params;
278-
params.get(node, name);
279279
_smoother = std::make_unique<Smoother>(params);
280280
_smoother->initialize(_minimum_turning_radius_global_coords);
281281
}

nav2_smac_planner/src/smac_planner_lattice.cpp

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

232232
// Initialize path smoother
233+
SmootherParams params;
234+
params.get(node, name);
233235
if (smooth_path) {
234-
SmootherParams params;
235-
params.get(node, name);
236236
_smoother = std::make_unique<Smoother>(params);
237237
_smoother->initialize(_metadata.min_turning_radius);
238238
}

0 commit comments

Comments
 (0)