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

AP_AHRS: View: get_gyro_latest should include pitch trim. #20059

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Feb 11, 2022

A long standing bug that means pitch trim is not applied to the latest gyro reading. This causes odd cross coupling effects if Q_TRIM_PITCH is none 0. Latest gyro should use the same rotation as smoothed uses here:

gyro = rot_view * gyro;

Flight tested on a Blackfly style tail sitter with 45 deg (ish) pitch trim. (IRL not SITL).

Spotted because the logged gyro in the RATE message was not the same as that in the PIQ messages, one was using "old" and the other latest. With this patch they match.

@IamPete1
Copy link
Member Author

IamPete1 commented Feb 11, 2022

Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

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

i'd like to remove get_gyro_latest() as well

@tridge tridge merged commit e56b6d2 into ArduPilot:master Feb 15, 2022
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