@@ -27,6 +27,10 @@ class DecisionWaypointLandingPads(base_decision.BaseDecision):
2727 def __init__ (self , waypoint : location .Location , acceptance_radius : float ) -> None :
2828 """
2929 Initialize all persistent variables here with self.
30+
31+ Args:
32+ waypoint (location.Location): The waypoint location to travel to.
33+ acceptance_radius (float): The radius within which the waypoint is considered reached.
3034 """
3135 self .waypoint = waypoint
3236 print (f"Waypoint: { waypoint } " )
@@ -37,49 +41,42 @@ def __init__(self, waypoint: location.Location, acceptance_radius: float) -> Non
3741 # ↓ BOOTCAMPERS MODIFY BELOW THIS COMMENT ↓
3842 # ============
3943
40- print (str (waypoint .location_x )+ str (waypoint .location_y ))
44+ print (str (waypoint .location_x ) + str (waypoint .location_y ))
4145
4246 self .has_sent_landing_command = False
43-
4447 self .find_nearest_landing_pad = False
45-
4648 self .reached_waypoint = False
47-
4849 self .moving_to_landing_pad = False
49-
5050 self .counter = 0
5151
52- def at_point (self , current_x : float , current_y : float ):
52+ def at_point (self , current_x : float , current_y : float ) -> bool :
53+ """
54+ Check if the current position is within the acceptance radius of the waypoint.
5355
56+ Args:
57+ current_x (float): The current x-coordinate of the drone.
58+ current_y (float): The current y-coordinate of the drone.
5459
60+ Returns:
61+ bool: True if the drone is within the acceptance radius, False otherwise.
62+ """
5563 distance_squared = (self .waypoint .location_x - current_x ) ** 2 + (
5664 self .waypoint .location_y - current_y
5765 ) ** 2
5866 return distance_squared <= self .acceptance_radius ** 2
5967
60-
61-
62- # ============
63- # ↑ BOOTCAMPERS MODIFY ABOVE THIS COMMENT ↑
64- # ============
65-
6668 def run (
6769 self , report : drone_report .DroneReport , landing_pad_locations : "list[location.Location]"
6870 ) -> commands .Command :
6971 """
7072 Make the drone fly to the waypoint and then land at the nearest landing pad.
7173
72- You are allowed to create as many helper methods as you want,
73- as long as you do not change the __init__() and run() signatures.
74-
75- This method will be called in an infinite loop, something like this:
74+ Args:
75+ report (drone_report.DroneReport): Current status report of the drone.
76+ landing_pad_locations (list[location.Location]): List of available landing pad locations.
7677
77- ```py
78- while True:
79- report, landing_pad_locations = get_input()
80- command = Decision.run(report, landing_pad_locations)
81- put_output(command)
82- ```
78+ Returns:
79+ commands.Command: The command for the drone to execute.
8380 """
8481 # Default command
8582 command = commands .Command .create_null_command ()
0 commit comments