From fcdffd93330349c15de0f943d1e3bb4e26151c53 Mon Sep 17 00:00:00 2001 From: schwalga Date: Fri, 17 Feb 2023 22:13:23 +0100 Subject: [PATCH 1/2] fix(#184): fixed default value for speed_limit --- code/acting/src/acting/velocity_controller.py | 7 ++++++- code/acting/src/acting/velocity_publisher_dummy.py | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/acting/src/acting/velocity_controller.py b/code/acting/src/acting/velocity_controller.py index bd0f258f..8a3ec11f 100755 --- a/code/acting/src/acting/velocity_controller.py +++ b/code/acting/src/acting/velocity_controller.py @@ -6,6 +6,8 @@ from simple_pid import PID from std_msgs.msg import Float32 +SPEED_LIMIT_DEFAULT: float = 5.0 + class VelocityController(CompatibleNode): """ @@ -83,7 +85,10 @@ def loop(timer_event=None): "publish a throttle value") return if self.__speed_limit is None or self.__speed_limit < 0: - self.__speed_limit = float("inf") + self.logdebug("VelocityController hasn't received a acceptable" + " speed_limit yet. speed_limit has been set to" + f"default value {SPEED_LIMIT_DEFAULT}") + self.__speed_limit = SPEED_LIMIT_DEFAULT if self.__max_velocity < 0: self.logerr("Velocity controller doesn't support backward " "driving yet.") diff --git a/code/acting/src/acting/velocity_publisher_dummy.py b/code/acting/src/acting/velocity_publisher_dummy.py index cb16d741..e165d02e 100755 --- a/code/acting/src/acting/velocity_publisher_dummy.py +++ b/code/acting/src/acting/velocity_publisher_dummy.py @@ -23,9 +23,9 @@ def __init__(self): Float32, f"/carla/{self.role_name}/max_velocity", qos_profile=1) - self.velocity = 4 + self.velocity = 4.0 self.delta_velocity = 0.125 - self.max_velocity = 5 + self.max_velocity = 5.5 self.min_velocity = 4 self.__dv = self.delta_velocity From c24b65352dbdf6e7303abb5fcbeb4ce139c95bca Mon Sep 17 00:00:00 2001 From: schwalga <50154233+schwalga@users.noreply.github.com> Date: Fri, 17 Feb 2023 22:18:24 +0100 Subject: [PATCH 2/2] fix(#184): raised default speed limit to ~130 km/h --- code/acting/src/acting/velocity_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/acting/src/acting/velocity_controller.py b/code/acting/src/acting/velocity_controller.py index 8a3ec11f..08346a00 100755 --- a/code/acting/src/acting/velocity_controller.py +++ b/code/acting/src/acting/velocity_controller.py @@ -6,7 +6,7 @@ from simple_pid import PID from std_msgs.msg import Float32 -SPEED_LIMIT_DEFAULT: float = 5.0 +SPEED_LIMIT_DEFAULT: float = 36.0 class VelocityController(CompatibleNode):