Skip to content

[FW Att ctrl] FW: Add quaternion-based attitude controller#26259

Closed
ttechnick wants to merge 3 commits intoPX4:mainfrom
ttechnick:pr-fw_attitude_quaternion_clean
Closed

[FW Att ctrl] FW: Add quaternion-based attitude controller#26259
ttechnick wants to merge 3 commits intoPX4:mainfrom
ttechnick:pr-fw_attitude_quaternion_clean

Conversation

@ttechnick
Copy link
Copy Markdown
Member

Solved Problem

The goal is to provide a better alternative to the Euler-angle error attitude controller for fixed-wing. This is very important near high pitch angles to prevent gimbal-lock.

Solution

This PR introduces a quaternion-based attitude controller for fixed-wing attitude control. The new controller computes attitude error using the shortest-rotation quaternion error, avoids Euler singularities/wrap issues, and optionally applies tilt-priority shaping.

Changelog Entry

For release notes:

Feature: Quaternion-based FW Attitude Controller
Documentation: Diagrams need to be updated....TBD

Test coverage

SITL tests:

Doing a barrel roll (Not possible currently without hacks)
Doing a looping (Not possible currently without hacks)
Flying straight up (Also possible currently, but bad edge casing handling)

HW tests

will follow

Notes

This is still very much a work-in-progress PR. However, feel free to drop any feedback or comments to improve this endevour.

This parameter is to be removed, and should, if desired, be replaced with angle based scheduling (as foreseen in the code).
@ttechnick ttechnick closed this Jan 13, 2026
@ttechnick ttechnick deleted the pr-fw_attitude_quaternion_clean branch January 26, 2026 12:56
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