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

Initialize jump-tracking in AP_Mission::init() #21769

Merged
merged 1 commit into from Sep 27, 2022

Conversation

robertlong13
Copy link
Collaborator

The jump tracking array in AP_Mission only initializes when the mission is restarted, for example when disarming or when the waypoint is set to zero. This means it is possible for that array to never initialize, e.g. if you use Set WP to set the waypoint to anything other than zero after boot but before switching to Auto mode the first time.

It seems like AP_Mission::init() is an appropriate place to call init_jump_tracking.

I encountered this on a quadplane that uses RTL_AUTOLAND. It usually takes more than 30s after boot for me to connect, so it switches to auto mode and sets the waypoint to the landing sequence. Before takeoff, I set the waypoint to 1. In flight, my DO_JUMP commands were not working.

It's really easy to work around: I just set waypoint to 0 now instead of 1, but this should still be fixed.

@rmackay9 rmackay9 added the Plane label Sep 22, 2022
@rmackay9
Copy link
Contributor

@robertlong13,

Thanks for the contribution.

This looks like a good/harmless change to me although there are various ways that init_jump_tracking() can be called from the start and resume methods which makes me slightly suspicious that Plane is using the AP_Mission library differently than other vehicles. I wonder if this same problem happens with Copter.

It would be good to change the commit to be prefixed with "AP_Mission:" to match our regular style. To be clear, I mean the commit itself.. not the PR title.

@robertlong13
Copy link
Collaborator Author

robertlong13 commented Sep 22, 2022

Interesting, you're right, I wasn't able to reproduce the bug in Copter just now. When I get a chance tomorrow, I'll look and see why.

@robertlong13
Copy link
Collaborator Author

robertlong13 commented Sep 22, 2022

Actually, I was able to reproduce this in the latest Copter. Last night, I had accidentally disarmed, causing reset() to get called.

@rmackay9
Copy link
Contributor

Great, txs. I've added this to the next dev call so it'll get discussed and possibly merged.

@tridge tridge merged commit 98b6529 into ArduPilot:master Sep 27, 2022
@tridge tridge added this to Pending in Plane 4.3 Oct 1, 2022
@tridge tridge moved this from Pending to Merged in Plane 4.3 Oct 1, 2022
@rmackay9 rmackay9 added this to Pending in Copter 4.3 Oct 4, 2022
@tridge tridge moved this from Pending to 4.3.0-beta2 in Copter 4.3 Oct 4, 2022
@tridge tridge moved this from beta1 to beta2 in Plane 4.3 Oct 6, 2022
@robertlong13 robertlong13 deleted the mission_jump_init_fix branch February 3, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Copter 4.3
4.3.0-beta2
Development

Successfully merging this pull request may close these issues.

None yet

4 participants