From 1e8bf64b23e1c8d2c49f6650014cff103e5abc0e Mon Sep 17 00:00:00 2001 From: Gabriel Alcantara Costa Silva Date: Thu, 10 Jun 2021 12:52:12 +0200 Subject: [PATCH] remove setting curr_cmd to zero when cmd_dt is negative to avoid abrupt changes in control --- .../src/ackermann_steering_controller.cpp | 2 -- diff_drive_controller/src/diff_drive_controller.cpp | 2 -- .../src/four_wheel_steering_controller.cpp | 6 ------ 3 files changed, 10 deletions(-) diff --git a/ackermann_steering_controller/src/ackermann_steering_controller.cpp b/ackermann_steering_controller/src/ackermann_steering_controller.cpp index f24291bd7..b647a8fbf 100644 --- a/ackermann_steering_controller/src/ackermann_steering_controller.cpp +++ b/ackermann_steering_controller/src/ackermann_steering_controller.cpp @@ -325,8 +325,6 @@ namespace ackermann_steering_controller{ if(cmd_dt < 0) { ROS_ERROR("Invalid time interval, delta time cannot be negative"); - curr_cmd.lin = 0.0; - curr_cmd.ang = 0.0; } limiter_lin_.limit(curr_cmd.lin, last0_cmd_.lin, last1_cmd_.lin, cmd_dt); diff --git a/diff_drive_controller/src/diff_drive_controller.cpp b/diff_drive_controller/src/diff_drive_controller.cpp index ab0b453f6..3f7536fb9 100644 --- a/diff_drive_controller/src/diff_drive_controller.cpp +++ b/diff_drive_controller/src/diff_drive_controller.cpp @@ -474,8 +474,6 @@ namespace diff_drive_controller{ if(cmd_dt < 0) { ROS_ERROR("Invalid time interval, delta time cannot be negative"); - curr_cmd.lin = 0.0; - curr_cmd.ang = 0.0; } limiter_lin_.limit(curr_cmd.lin, last0_cmd_.lin, last1_cmd_.lin, cmd_dt); diff --git a/four_wheel_steering_controller/src/four_wheel_steering_controller.cpp b/four_wheel_steering_controller/src/four_wheel_steering_controller.cpp index 69528250a..0ef4de633 100644 --- a/four_wheel_steering_controller/src/four_wheel_steering_controller.cpp +++ b/four_wheel_steering_controller/src/four_wheel_steering_controller.cpp @@ -366,12 +366,6 @@ namespace four_wheel_steering_controller{ if(cmd_dt < 0) { ROS_ERROR("Invalid time interval, delta time cannot be negative"); - curr_cmd_twist.lin_x = 0.0; - curr_cmd_twist.lin_y = 0.0; - curr_cmd_twist.ang = 0.0; - curr_cmd_4ws.lin = 0.0; - curr_cmd_4ws.front_steering = 0.0; - curr_cmd_4ws.rear_steering = 0.0; } const double angular_speed = odometry_.getAngular();