-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
created get next waypoint method #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed
mavlink/modules/flight_controller.py
Outdated
next_command_index = self.drone.commands.next | ||
if next_command_index >= len(commands): | ||
return False, None | ||
|
||
for i in range(next_command_index, len(commands)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe track the index in the class instead of using .next since it's easier to check index < length
mavlink/modules/flight_controller.py
Outdated
for i in range(next_command_index, len(commands)): | ||
command = commands[i] | ||
if command.command == self.__MAVLINK_WAYPOINT_COMMAND: | ||
return True, command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for command in commands[index :]:
- take the slice instead of using an index to iterate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.