Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
Signed-off-by: RBT22 <rozgonyibalint@gmail.com>
  • Loading branch information
RBT22 committed Dec 20, 2024
1 parent adbdfe1 commit 02f18ce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ class DriveOnHeading : public TimedBehavior<ActionT>

// 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;
Expand Down

0 comments on commit 02f18ce

Please sign in to comment.