Skip to content

Commit

Permalink
Prevent invalid accesses on paths in path_longer_on_approach (ros-nav…
Browse files Browse the repository at this point in the history
…igation#4375)

* Prevent invalid accesses on paths in path_longer_on_approach

* Fix format of the change
  • Loading branch information
lss0815 authored and Marc-Morcos committed Jul 4, 2024
1 parent 6ad94e7 commit a169386
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ inline BT::NodeStatus PathLongerOnApproach::tick()
getInput("length_factor", length_factor_);

if (first_time_ == false) {
if (old_path_.poses.back() != new_path_.poses.back()) {
if (old_path_.poses.empty() || new_path_.poses.empty() ||
old_path_.poses.back() != new_path_.poses.back())
{
first_time_ = true;
}
}
Expand Down

0 comments on commit a169386

Please sign in to comment.