Skip to content

Commit

Permalink
fixing path longer on approach
Browse files Browse the repository at this point in the history
Signed-off-by: Pradheep <[email protected]>
  • Loading branch information
padhupradheep committed Aug 17, 2024
1 parent 3f31112 commit 1d745ec
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ 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 &&
new_path.poses.size() != 0 &&
old_path.poses.back().pose == new_path.poses.back().pose;
return old_path.poses.size() != 0 &&
new_path.poses.size() != 0 && 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 +64,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 1d745ec

Please sign in to comment.