From 9b839727f6d08149cb7b6c9a128a26e85fbd247c Mon Sep 17 00:00:00 2001 From: Narahari Rahul Malayanur <60045406+Naraharirahul@users.noreply.github.com> Date: Fri, 15 Oct 2021 14:30:17 -0400 Subject: [PATCH] Modified the projection_time calculation --- .../src/regulated_pure_pursuit_controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp b/nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp index 38adc7030c..6cda1b6faf 100644 --- a/nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp +++ b/nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp @@ -395,7 +395,7 @@ bool RegulatedPurePursuitController::isCollisionImminent( pose_msg.header.frame_id = arc_pts_msg.header.frame_id; pose_msg.header.stamp = arc_pts_msg.header.stamp; - const double projection_time = costmap_->getResolution() / linear_vel; + const double projection_time = costmap_->getResolution() / fabs(linear_vel); geometry_msgs::msg::Pose2D curr_pose; curr_pose.x = robot_pose.pose.position.x;