Skip to content

Commit d968b39

Browse files
committed
pytest working?
1 parent 5f2b0c5 commit d968b39

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

modules/bootcamp/decision_waypoint_landing_pads.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ def run(
7171
# ============
7272
# ↓ BOOTCAMPERS MODIFY BELOW THIS COMMENT ↓
7373
# ============
74-
min_norm = float("inf")
75-
min_location = []
74+
min_norm, min_location = float("inf"), []
7675

7776
# Do something based on the report and the state of this class...
7877
if report.status == drone_status.DroneStatus.HALTED:
@@ -82,16 +81,14 @@ def run(
8281

8382
elif self.halt_counter == 1:
8483
for landing_pads in landing_pad_locations:
85-
x = landing_pads.location_x - self.waypoint.location_x
86-
y = landing_pads.location_y - self.waypoint.location_y
84+
x, y = landing_pads.location_x - self.waypoint.location_x, landing_pads.location_y - self.waypoint.location_y
8785
curr_norm = x ** 2 + y ** 2
8886

8987
if curr_norm < min_norm:
90-
min_norm = curr_norm
91-
min_location = (x, y)
88+
min_norm, min_location = curr_norm, (x, y)
9289

9390
command = self.travel_to(min_location[0], min_location[1])
94-
self.halt_counter += 1
91+
self.halt_counter += 1
9592

9693
elif self.halt_counter == 2 and not self.has_sent_landing_command:
9794
command = commands.Command.create_land_command()

0 commit comments

Comments
 (0)