From 02f18ce3a1b288e01e372d4f7733dae1b1af8787 Mon Sep 17 00:00:00 2001 From: RBT22 Date: Fri, 20 Dec 2024 12:17:36 +0100 Subject: [PATCH] Format code Signed-off-by: RBT22 --- .../include/nav2_behaviors/plugins/drive_on_heading.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp b/nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp index 388a2a76b1..23fae5a9e9 100644 --- a/nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp +++ b/nav2_behaviors/include/nav2_behaviors/plugins/drive_on_heading.hpp @@ -150,12 +150,12 @@ class DriveOnHeading : public TimedBehavior // Check if we need to slow down to avoid overshooting bool forward = command_speed_ > 0.0 ? true : false; - if ((forward && deceleration_limit_ > 0.0)) { + if (forward && deceleration_limit_ > 0.0) { double max_vel_to_stop = std::sqrt(2.0 * deceleration_limit_ * remaining_distance); if (max_vel_to_stop < cmd_vel->twist.linear.x) { cmd_vel->twist.linear.x = max_vel_to_stop; } - } else if ((!forward && acceleration_limit_ > 0.0)) { + } else if (!forward && acceleration_limit_ > 0.0) { double max_vel_to_stop = -std::sqrt(2.0 * acceleration_limit_ * remaining_distance); if (max_vel_to_stop > cmd_vel->twist.linear.x) { cmd_vel->twist.linear.x = max_vel_to_stop;