Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

Commit 3bca007

Browse files
committed
fixing linter error
1 parent fbfcc79 commit 3bca007

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

modules/auto_landing/auto_landing.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,28 @@ def __init__(
6464
self.__logger = local_logger
6565

6666
def run(
67-
self, input: merged_odometry_detections.MergedOdometryDetections
68-
) -> "tuple[bool, tuple[float, float, float]]":
67+
self, odometry_detections: merged_odometry_detections.MergedOdometryDetections
68+
) -> "tuple[bool, list[tuple[float, float, float]]]":
6969
"""
7070
Calculates the x and y angles in radians of the bounding box based on its center.
7171
72-
input: A merged odometry dectections object.
72+
odometry_detections: A merged odometry dectections object.
7373
74-
Return: Tuple of the x and y angles in radians respectively and the target distance in meters.
74+
Return: A list of tuples containing the x and y angles in radians
75+
respectively, and the target distance in meters.
76+
77+
ex. [(angle_x_1, angle_y_1, target_dist_1), (angle_x_2, angle_y_2, target_dist_2)]
7578
"""
7679

77-
for bounding_box in input.detections:
80+
landing_commands = []
81+
82+
for bounding_box in odometry_detections.detections:
7883
x_center, y_center = bounding_box.get_centre()
7984

8085
angle_x = (x_center - self.im_w / 2) * (self.fov_x * (math.pi / 180)) / self.im_w
8186
angle_y = (y_center - self.im_h / 2) * (self.fov_y * (math.pi / 180)) / self.im_h
8287

83-
height_agl = input.odometry_local.position.down * -1
88+
height_agl = odometry_detections.odometry_local.position.down * -1
8489

8590
x_dist = math.tan(angle_x) * height_agl
8691
y_dist = math.tan(angle_y) * height_agl
@@ -93,5 +98,6 @@ def run(
9398
)
9499

95100
time.sleep(self.period)
101+
landing_commands.append((angle_x, angle_y, target_to_vehicle_dist))
96102

97-
return True, (angle_x, angle_y, target_to_vehicle_dist)
103+
return True, landing_commands

0 commit comments

Comments
 (0)