Skip to content

Commit

Permalink
Handle missions without takeoff block
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaldwin committed Nov 12, 2019
1 parent 64da145 commit b59ffae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def parse_mission(self, mission_code):
# Split the mission into a command list
commands = mission_code.split("|")

# Remove any empty strings from the list. This can happen in cases where there is a mission without a takeoff block
while ("" in commands):
commands.remove("")

print("Mission is: ", mission_code)
print("Commands are: ", commands)

Expand Down Expand Up @@ -125,8 +129,6 @@ def parse_mission(self, mission_code):

command_to_execute = "land"



# Send the command
self.udp.send_command(command_to_execute)

Expand Down

0 comments on commit b59ffae

Please sign in to comment.