From f75ae485b8916d39919b2741950ca6b649cb6fbf Mon Sep 17 00:00:00 2001 From: Gustavo Goretkin Date: Tue, 5 Dec 2023 11:59:27 -0500 Subject: [PATCH] Clean up some frame checks --- spot_driver/spot_driver/spot_ros2.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spot_driver/spot_driver/spot_ros2.py b/spot_driver/spot_driver/spot_ros2.py index 27f4cafb1..714bd0d9c 100644 --- a/spot_driver/spot_driver/spot_ros2.py +++ b/spot_driver/spot_driver/spot_ros2.py @@ -368,13 +368,11 @@ def __init__(self, parameter_list: Optional[typing.List[Parameter]] = None, **kw ) self.tf_name_raw_vision: str = self.frame_prefix + "vision" - if ( - self.preferred_odom_frame.value != self.tf_name_raw_kinematic - and self.preferred_odom_frame.value != self.tf_name_raw_vision - ): + preferred_odom_frame_references = [self.tf_name_raw_kinematic, self.tf_name_raw_vision] + if self.preferred_odom_frame.value not in preferred_odom_frame_references: error_msg = ( - f'rosparam "preferred_odom_frame" should be "{self.tf_name_raw_kinematic}" or' - f' "{self.tf_name_raw_vision}".' + f'rosparam "preferred_odom_frame" should be one of {preferred_odom_frame_references}, got' + f' "{self.preferred_odom_frame.value}"' ) self.get_logger().error(error_msg) raise ValueError(error_msg)