From fa64058ccd2df4838ff921d697041f2f9fce5dd0 Mon Sep 17 00:00:00 2001 From: Mehul Goel Date: Sun, 5 Jan 2025 12:18:41 -0800 Subject: [PATCH] fixed for python 3.8 --- .../src/buggy/buggy/controller/controller_node.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rb_ws/src/buggy/buggy/controller/controller_node.py b/rb_ws/src/buggy/buggy/controller/controller_node.py index af60dc0..132efce 100644 --- a/rb_ws/src/buggy/buggy/controller/controller_node.py +++ b/rb_ws/src/buggy/buggy/controller/controller_node.py @@ -38,12 +38,14 @@ def __init__(self): start_index = self.cur_traj.get_index_from_distance(start_dist) self.declare_parameter("controller_name", "stanley") - match (self.get_parameter("controller_name").value): - case "stanley": - self.controller = StanleyController(start_index = start_index, namespace = self.get_namespace(), node=self) #IMPORT STANLEY - case _: - self.get_logger().error("Invalid Controller Name!") - raise Exception("Invalid Controller Argument") + + controller_name = self.get_parameter("controller_name").value + print(controller_name.lower) + if (controller_name.lower() == "stanley"): + self.controller = StanleyController(start_index = start_index, namespace = self.get_namespace(), node=self) #IMPORT STANLEY + else: + self.get_logger().error("Invalid Controller Name: " + controller_name.lower()) + raise Exception("Invalid Controller Argument") # Publishers self.init_check_publisher = self.create_publisher(Bool,