diff --git a/spot_driver/spot_driver/spot_ros2.py b/spot_driver/spot_driver/spot_ros2.py index d90570299..d523c01e8 100644 --- a/spot_driver/spot_driver/spot_ros2.py +++ b/spot_driver/spot_driver/spot_ros2.py @@ -362,13 +362,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)