Skip to content

Commit 7603938

Browse files
authored
Fix dynamic param SmacPlannerLattice (#5478)
* Fix SmacPlannerLattice dynamic parameter early exit Signed-off-by: Tony Najjar <[email protected]> * remove comment Signed-off-by: Tony Najjar <[email protected]> --------- Signed-off-by: Tony Najjar <[email protected]>
1 parent f01ee78 commit 7603938

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

nav2_smac_planner/src/node_lattice.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,21 @@ void LatticeMotionTable::initMotionModel(
5050
unsigned int & size_x_in,
5151
SearchInfo & search_info)
5252
{
53-
size_x = size_x_in;
54-
55-
if (current_lattice_filepath == search_info.lattice_filepath) {
56-
return;
57-
}
58-
5953
size_x = size_x_in;
6054
change_penalty = search_info.change_penalty;
6155
non_straight_penalty = search_info.non_straight_penalty;
6256
cost_penalty = search_info.cost_penalty;
6357
reverse_penalty = search_info.reverse_penalty;
6458
travel_distance_reward = 1.0f - search_info.retrospective_penalty;
65-
current_lattice_filepath = search_info.lattice_filepath;
6659
allow_reverse_expansion = search_info.allow_reverse_expansion;
6760
rotation_penalty = search_info.rotation_penalty;
6861
min_turning_radius = search_info.minimum_turning_radius;
6962

63+
if (current_lattice_filepath == search_info.lattice_filepath) {
64+
return;
65+
}
66+
current_lattice_filepath = search_info.lattice_filepath;
67+
7068
// Get the metadata about this minimum control set
7169
lattice_metadata = getLatticeMetadata(current_lattice_filepath);
7270
std::ifstream latticeFile(current_lattice_filepath);

0 commit comments

Comments
 (0)