From 87c55a1b8c17ab00c85f00a0733822f305bcbfa0 Mon Sep 17 00:00:00 2001 From: Lennart Luttkus Date: Tue, 13 Feb 2024 12:23:25 +0100 Subject: [PATCH] Add docs for type aliases for 2D vector, line, circle, robot pose, and range --- robot_sf/sensor/range_sensor.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/robot_sf/sensor/range_sensor.py b/robot_sf/sensor/range_sensor.py index dca24f0..0768cd0 100644 --- a/robot_sf/sensor/range_sensor.py +++ b/robot_sf/sensor/range_sensor.py @@ -8,15 +8,23 @@ from robot_sf.nav.occupancy import ContinuousOccupancy - Vec2D = Tuple[float, float] -RobotPose = Tuple[Vec2D, float] -Range = Tuple[float, float] +"""Type alias for a 2D vector represented as a tuple of two floats""" - -Vec2D = Tuple[float, float] Line2D = Tuple[Vec2D, Vec2D] +"""Type alias for a 2D line represented as a tuple of two 2D vectors (start and end points)""" + Circle2D = Tuple[Vec2D, float] +"""Type alias for a 2D circle represented as a tuple of a 2D vector (center) and a float (radius)""" + +RobotPose = Tuple[Vec2D, float] +""" +Type alias for a robot's pose represented as a tuple of a 2D vector (position) +and a float (orientation) +""" + +Range = Tuple[float, float] +"""Type alias for a range represented as a tuple of two floats""" @numba.njit(fastmath=True)