From da75ffe78c98e309922b55cd7262561c0901bb4d Mon Sep 17 00:00:00 2001 From: Steve Macenski Date: Fri, 17 Nov 2023 10:59:49 -0800 Subject: [PATCH] Fix linting error (#3969) * Fix linting error * Update regulated_pure_pursuit_controller.cpp --- .../src/regulated_pure_pursuit_controller.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 3e2ac93a41..0ecab5b001 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 @@ -426,14 +426,16 @@ double RegulatedPurePursuitController::findVelocitySignChange( return hypot( transformed_plan.poses[pose_id].pose.position.x, transformed_plan.poses[pose_id].pose.position.y); - } else if ( + } + + if ( (hypot(oa_x, oa_y) == 0.0 && - transformed_plan.poses[pose_id - 1].pose.orientation != - transformed_plan.poses[pose_id].pose.orientation) + transformed_plan.poses[pose_id - 1].pose.orientation != + transformed_plan.poses[pose_id].pose.orientation) || (hypot(ab_x, ab_y) == 0.0 && - transformed_plan.poses[pose_id].pose.orientation != - transformed_plan.poses[pose_id + 1].pose.orientation)) + transformed_plan.poses[pose_id].pose.orientation != + transformed_plan.poses[pose_id + 1].pose.orientation)) { // returning the distance since the points overlap // but are not simply duplicate points (e.g. in place rotation)