Skip to content

Commit

Permalink
Clean up some frame checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoretkin-bdai committed Dec 18, 2023
1 parent d0a52c3 commit f75ae48
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spot_driver/spot_driver/spot_ros2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f75ae48

Please sign in to comment.