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

Vehicle: keep commands in list if in progress #10850

Closed
wants to merge 2 commits into from

Conversation

julianoes
Copy link
Contributor

We should not remove commands from the command list when we receive an IN_PROGRESS ack because we should eventually receive a final ack.

We should not remove commands from the command list when we receive an
IN_PROGRESS ack because we should eventually receive a final ack.

Signed-off-by: Julian Oes <[email protected]>
@peterbarker
Copy link
Contributor

Ah, glad you're doing this; I was looking at changing the ArduPilot-specific calibration stuff to use this mechanism....

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

The change is fine with me, but autotune does not follow that semantics and needs to be checked.

@@ -3254,7 +3254,10 @@ void Vehicle::_handleCommandAck(mavlink_message_t& message)
int entryIndex = _findMavCommandListEntryIndex(message.compid, static_cast<MAV_CMD>(ack.command));
bool commandInList = false;
if (entryIndex != -1) {
MavCommandListEntry_t commandEntry = _mavCommandList.takeAt(entryIndex);
// We remove the command from the list unless it's still in progress.
Copy link
Member

Choose a reason for hiding this comment

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

While in progress, are retries handled correctly?

@DonLakeFlyer
Copy link
Contributor

Beat is correct. Supporting this is more involved than just the list management. I'll take a look.

@DonLakeFlyer
Copy link
Contributor

There are also big problems with how MAV_RESULT_IN_PROGRESS and progress values were plumbed through Vehicle::sendMavCommandWithHandler. Given the fact that any command can start to send IN_PROGRESS before sending an ack, all callbacks from Vehicle::sendMavCommandWithHandler as currently implemented need to handle IN_PROGRESS specifically otherwise they will break if the command ever sends that.

@DonLakeFlyer
Copy link
Contributor

I should have a pull which cleans this all up in a day or so...

@julianoes
Copy link
Contributor Author

Closing this. Thanks @DonLakeFlyer for #10852.

@julianoes julianoes closed this Nov 9, 2023
@julianoes julianoes deleted the pr-fix-in-progress-commands branch November 9, 2023 23:14
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.

5 participants