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

Copter:fix bug in autotrim #29341

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Hwurzburg
Copy link
Collaborator

@Hwurzburg Hwurzburg commented Feb 20, 2025

This:

  1. Fixes bugs in Copter: use Auxiliary function to control adjusting of AHRS trim from RC inputs #28881 (aux func was not init'd and auto trim not saved properly)
  2. refactors to use an "allows_auto_trim" bool to avoid entering autotrim and then immediately cancelling; and neaten the code a bit
  3. Adds Loiter/PosHold to autotrim for hands off trimming
  4. Add a warning on attempting to enable autotrim when allowed, but not flying, rather than just entering and exiting immediately leaving a user to wonder why.
  5. adjust marginally failing autotest

@rmackay9
Copy link
Contributor

Hi @Hwurzburg, I'm not sure Loiter works though does it? I don't think it should work in Loiter..

@Hwurzburg Hwurzburg force-pushed the copter_auto_trim_fix branch from 3b726a0 to 7aaa4ea Compare February 21, 2025 03:03
@Hwurzburg
Copy link
Collaborator Author

Hwurzburg commented Feb 21, 2025

Hi @Hwurzburg, I'm not sure Loiter works though does it? I don't think it should work in Loiter..

you are right....I got ahead of myself......removed the bool in Loiter.....will follow up with a modification that uses nav_controller->get_roll and pitch if in Loiter or PosHold modes instead of RC inputs in the auto_trim_run function....thanks for the catch....

@Hwurzburg Hwurzburg changed the title Copter:fix bug in autotrim and add Loiter as valid autotrim mode Copter:fix bug in autotrim Feb 21, 2025
@Hwurzburg Hwurzburg force-pushed the copter_auto_trim_fix branch 2 times, most recently from df2c737 to d9381ae Compare February 21, 2025 14:55
@Hwurzburg
Copy link
Collaborator Author

Hwurzburg commented Feb 21, 2025

@rmackay9 I found another bug and fixed it (was not properly saving trim and terminating auto_trim_run)
also got Loiter and Pos_hold working....checked sensitivities for using sticks or letting AP do it and they seem reasonable and unchanged

@Hwurzburg Hwurzburg requested a review from rmackay9 February 21, 2025 14:56
@Hwurzburg Hwurzburg force-pushed the copter_auto_trim_fix branch from d9381ae to 7ea7e1f Compare February 21, 2025 15:04
@Hwurzburg Hwurzburg force-pushed the copter_auto_trim_fix branch from 7ea7e1f to d67d9a6 Compare February 21, 2025 15:30
@Hwurzburg Hwurzburg force-pushed the copter_auto_trim_fix branch from 2136fef to fe577b1 Compare February 21, 2025 18:33
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.

2 participants