Skip to content

Commit

Permalink
fixing path longer on approach (ros-navigation#4622)
Browse files Browse the repository at this point in the history
* fixing path longer on approach

Signed-off-by: Pradheep <padhupradheep@gmail.com>

* removing the short circuit

Signed-off-by: Pradheep <padhupradheep@gmail.com>

* adding additional layer of check

Signed-off-by: Pradheep <padhupradheep@gmail.com>

---------

Signed-off-by: Pradheep <padhupradheep@gmail.com>
Signed-off-by: Joseph Duchesne <josephgeek@gmail.com>
  • Loading branch information
padhupradheep authored and josephduchesne committed Dec 10, 2024
1 parent 1e9151f commit 81207b5
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ bool PathLongerOnApproach::isPathUpdated(
nav_msgs::msg::Path & new_path,
nav_msgs::msg::Path & old_path)
{
return new_path != old_path && old_path.poses.size() != 0 &&
return old_path.poses.size() != 0 &&
new_path.poses.size() != 0 &&
old_path.poses.back().pose == new_path.poses.back().pose;
new_path.poses.size() != old_path.poses.size() &&
old_path.poses.back().pose.position == new_path.poses.back().pose.position;
}

bool PathLongerOnApproach::isRobotInGoalProximity(
Expand Down Expand Up @@ -64,7 +65,7 @@ inline BT::NodeStatus PathLongerOnApproach::tick()

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

0 comments on commit 81207b5

Please sign in to comment.