Skip to content

Commit

Permalink
fixing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ellyokes253 committed Aug 20, 2024
1 parent f154f90 commit 7fe5f92
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/waypoint_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ def get_current_waypoint_info(
"""

# Get the current waypoint sequence
current_waypoint = controller.download_commands()[1]
waypoint_info = (current_waypoint, None)
download_success, current_waypoint = controller.download_commands()
if download_success:
waypoint_info = (current_waypoint, None)
else:
return False, (None, None)

# Get the current destination
if current_waypoint < controller.commands.count:
current_command = controller.commands[current_waypoint]
retreive_info_success, destination_reached = (
controller.is_drone_destination_final_waypoint()
)
if retreive_info_success and destination_reached:
waypoint_info = (current_waypoint, (current_command.x, current_command.y))
success, destination_reached = controller.is_drone_destination_final_waypoint()
waypoint_info = (current_waypoint, (current_command.x, current_command.y))

return True, waypoint_info
return (True, waypoint_info) if success and destination_reached else (False, waypoint_info)


def get_current_location(controller: FlightController) -> "tuple[bool, tuple[float, float] | None]":
Expand Down

0 comments on commit 7fe5f92

Please sign in to comment.