diff --git a/ipm_image_node/test/test_ipm.py b/ipm_image_node/test/test_ipm.py index 2946f37..d6dc3d7 100644 --- a/ipm_image_node/test/test_ipm.py +++ b/ipm_image_node/test/test_ipm.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, Optional, Tuple +from typing import Optional from cv_bridge import CvBridge from geometry_msgs.msg import TransformStamped @@ -48,7 +48,7 @@ def standard_ipm_image_test_case( input_topic: str, input_msg: Image, output_topic: str, - mode: str = 'mask') -> Tuple[PointCloud2, Image]: + mode: str = 'mask') -> tuple[PointCloud2, Image]: # Init ros rclpy.init() # Create IPM node @@ -64,7 +64,7 @@ def standard_ipm_image_test_case( TFMessage, 'tf', 10) # Create a shared reference to the recived message in the local scope - received_msg: List[Optional[PointCloud2]] = [None] + received_msg: list[Optional[PointCloud2]] = [None] # Create a callback with sets this reference def callback(msg): diff --git a/ipm_library/ipm_library/ipm.py b/ipm_library/ipm_library/ipm.py index 34c8586..71806ff 100644 --- a/ipm_library/ipm_library/ipm.py +++ b/ipm_library/ipm_library/ipm.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Optional, Tuple +from typing import Optional from builtin_interfaces.msg import Time from ipm_library import utils @@ -130,7 +130,7 @@ def map_points( points: np.ndarray, time: Time, plane_frame_id: Optional[str] = None, - output_frame_id: Optional[str] = None) -> Tuple[Header, np.ndarray]: + output_frame_id: Optional[str] = None) -> tuple[Header, np.ndarray]: """ Map image points onto a given plane using the latest CameraInfo intrinsics. diff --git a/ipm_library/ipm_library/utils.py b/ipm_library/ipm_library/utils.py index f68efb2..4fe7def 100644 --- a/ipm_library/ipm_library/utils.py +++ b/ipm_library/ipm_library/utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Optional, Tuple +from typing import Optional from builtin_interfaces.msg import Time import cv2 @@ -25,7 +25,7 @@ import tf2_ros -def plane_general_to_point_normal(plane: Plane) -> Tuple[np.ndarray, np.ndarray]: +def plane_general_to_point_normal(plane: Plane) -> tuple[np.ndarray, np.ndarray]: """ Convert general plane form to point normal form. @@ -44,12 +44,12 @@ def plane_general_to_point_normal(plane: Plane) -> Tuple[np.ndarray, np.ndarray] def transform_plane_to_frame( - plane: Tuple[np.ndarray, np.ndarray], + plane: tuple[np.ndarray, np.ndarray], input_frame: str, output_frame: str, time: Time, buffer: tf2_ros.Buffer, - timeout: Optional[Duration] = None) -> Tuple[np.ndarray, np.ndarray]: + timeout: Optional[Duration] = None) -> tuple[np.ndarray, np.ndarray]: """ Transform a plane from one frame to another.