Skip to content
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

Merged
merged 5 commits into from
Aug 10, 2024
Merged

created get next waypoint method #44

merged 5 commits into from
Aug 10, 2024

Conversation

ashum68
Copy link
Contributor

@ashum68 ashum68 commented Aug 6, 2024

No description provided.

Copy link
Contributor

@TongguangZhang TongguangZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed

Comment on lines 295 to 299
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)):
Copy link
Contributor

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

Comment on lines 299 to 302
for i in range(next_command_index, len(commands)):
command = commands[i]
if command.command == self.__MAVLINK_WAYPOINT_COMMAND:
return True, command
Copy link
Contributor

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

Copy link
Contributor

@TongguangZhang TongguangZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ashum68 ashum68 merged commit b55dfd3 into main Aug 10, 2024
1 check passed
@ashum68 ashum68 deleted the get-next-waypoint branch August 10, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants