Skip to content

Commit

Permalink
start is now added to the path (#3140)
Browse files Browse the repository at this point in the history
* start is now added to the path

* lint fix
  • Loading branch information
jwallace42 authored and SteveMacenski committed Aug 24, 2022
1 parent 104f1e1 commit 4f12a60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions nav2_smac_planner/src/node_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ bool Node2D::backtracePath(CoordinateVector & path)

NodePtr current_node = this;

while (current_node->parent) {
do {
path.push_back(
Node2D::getCoords(current_node->getIndex()));
current_node = current_node->parent;
}
} while (current_node->parent);

return path.size() > 0;
}
Expand Down
4 changes: 2 additions & 2 deletions nav2_smac_planner/src/node_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,12 @@ bool NodeHybrid::backtracePath(CoordinateVector & path)

NodePtr current_node = this;

while (current_node->parent) {
do {
path.push_back(current_node->pose);
// Convert angle to radians
path.back().theta = NodeHybrid::motion_table.getAngleFromBin(path.back().theta);
current_node = current_node->parent;
}
} while (current_node->parent);

return path.size() > 0;
}
Expand Down
4 changes: 2 additions & 2 deletions nav2_smac_planner/src/node_lattice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ bool NodeLattice::backtracePath(CoordinateVector & path)
const float & grid_resolution = NodeLattice::motion_table.lattice_metadata.grid_resolution;
const float pi_2 = 2.0 * M_PI;

while (current_node->parent) {
do {
prim = current_node->getMotionPrimitive();
// if motion primitive is valid, then was searched (rather than analytically expanded),
// include dense path of subpoints making up the primitive at grid resolution
Expand Down Expand Up @@ -576,7 +576,7 @@ bool NodeLattice::backtracePath(CoordinateVector & path)
}

current_node = current_node->parent;
}
} while (current_node->parent);

return path.size() > 0;
}
Expand Down

0 comments on commit 4f12a60

Please sign in to comment.