Skip to content

Commit

Permalink
add method to get drone flight mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ashum68 committed Jul 6, 2024
1 parent 1500a1c commit 688e042
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mavlink/modules/flight_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,9 @@ def set_flight_mode(self, mode: str) -> bool:
print("ERROR: an unsupported flight mode is set by dronekit.VehicleMode()")
return False
return True

def get_flight_mode(self) -> str:
"""
Gets the current flight mode of the drone.
"""
return self.drone.mode.name

0 comments on commit 688e042

Please sign in to comment.