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

Sub: auto & circle mode keep controllers initialized when disarmed #18719

Conversation

hendjoshsr71
Copy link
Member

@hendjoshsr71 hendjoshsr71 commented Sep 20, 2021

This fixes an issue reported on discuss here.

Auto_mode starts in auto_loiter. However, while disarmed it does not keep wp_nav and pos_control initialized for the next time when the vehicle is armed and pos_control_run() occurs. Thus when pos_control_run() happens we get the internal error in SITL below because we have not initialized the controllers recently.

Same happens in CircleMode.

To replicate the issue:

-upload a mission with a few WPs
mode auto (or 'mode circle) arm throttle`
You should get this internal error (just a difference between modes)

image

@hendjoshsr71 hendjoshsr71 force-pushed the pr/sub_auto_initialize_control_when_disarmed branch from 68560dd to 77e330b Compare September 21, 2021 20:25
@peterbarker
Copy link
Contributor

Probably allows the new test created with #17846 (from June) to pass. Haven't tested or read this PR, however :-)

@hendjoshsr71
Copy link
Member Author

Probably allows the new test created with #17846 (from June) to pass. Haven't tested or read this PR, however :-)

I grabbed the DoubleCircle test and it passes with this PR.

@hendjoshsr71 hendjoshsr71 changed the title Sub: auto mode keep controllers initialized when disarmed Sub: auto & circle mode keep controllers initialized when disarmed Sep 22, 2021
@hendjoshsr71 hendjoshsr71 force-pushed the pr/sub_auto_initialize_control_when_disarmed branch from 77e330b to 45b0d09 Compare September 22, 2021 19:17
@hendjoshsr71
Copy link
Member Author

An internal error also occurs in guided but only with speedup above 3 see this issue #18744

I've changed guided's pos_control_run() method for keeping the controller's initialized when disarmed. It does not appear to be keeping wp-nav initialized as well currently.

@peterbarker peterbarker merged commit 6999762 into ArduPilot:master Sep 28, 2021
@peterbarker
Copy link
Contributor

merged, thanks!

@hendjoshsr71 hendjoshsr71 deleted the pr/sub_auto_initialize_control_when_disarmed branch September 28, 2021 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants