Skip to content

Airbrakes Improvements#387

Open
AarC10 wants to merge 10 commits into
mainfrom
feature/Aaron/AirbrakesOptimizations
Open

Airbrakes Improvements#387
AarC10 wants to merge 10 commits into
mainfrom
feature/Aaron/AirbrakesOptimizations

Conversation

@AarC10
Copy link
Copy Markdown
Member

@AarC10 AarC10 commented Apr 13, 2026

Description

Suggestions for a few ways to improve the airbrakes code.

  • Rewrites expGyro to use Rodrigues formula instead of having to explicilty build K, and K^2 and have to add matrix temps. This should reduce the amount of work you need to do in the hot path and achieves ~1.3x speedup on x86
  • Replace the naive implementation for atmosphere polynomial eval with Horner's
  • Prevent airbrake LUT from not dividing by zero
  • FeedGyro also didnt seem to be tilt checking correctly. Added a fix which resulted in a 0.7x speedup making it slower. Have it use cosine space though instead of acos, which is also faster and safer. Also avoid computing full angles every cycle and have a quaternion state in the hot path instead of doing constant matmuls. This results in pretty much the same performance as the original so 1.0x speedup.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

x86 benchmark. Other than that I know Richie got me :)))

Checklist:

  • New functionality is documented in the necessary spots (i.e new functions documented in the header)
  • Unit tests cover any new functionality or edge cases that the PR was meant to resolve (if applicable)
  • The CI checks are passing
  • I reviewed my own code in the GitHub diff and am sure that each change is intentional
  • I feel comfortable about this code flying in a rocket

@AarC10 AarC10 marked this pull request as ready for review April 13, 2026 18:57
@AarC10 AarC10 requested a review from a team as a code owner April 13, 2026 18:57
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.

1 participant