Andy Piper 89253f2b9a AP_InertialSensor: keep the board rotation on the accel during gyro cal
_init_gyro() zeroed _board_orientation for the duration of the calibration
so the gyro samples came out in board frame, but that also stripped the
rotation from the accel. The last accel published in that window stays in
_accel[0], and AP_AHRS_DCM::reset() reads it a few lines later during
init_ardupilot(), gating only on the vector magnitude - so a board-frame
9.81 passes and DCM aligns to it. On a board mounted inverted that is 180
degrees out, and drift correction then takes minutes to walk it back,
failing the DCM attitude pre-arm throughout.

Skip the rotation in the gyro backend while _calibrating_gyro is set,
alongside the offset subtraction it already gates, and leave
_board_orientation alone. The accel is then never published in board frame
and DCM aligns level regardless of whether the value it reads is stale.
2026-08-19 21:30:55 +01:00
2026-08-13 11:47:42 +10:00
2026-08-04 13:02:09 +10:00
…
…
…
…
…
…

ArduPilot Project

Discord

Test Copter Test Plane Test Rover Test Sub Test Tracker

Test AP_Periph Test Chibios Test Linux SBC Test Replay

Test Unit Teststest size

Test Environment Setup

Cygwin Build Macos Build

Coverity Scan Build Status

Test Coverage

Autotest Status

OpenSSF Best Practices

ArduPilot is the most advanced, full-featured, and reliable open source autopilot software available. It has been under development since 2010 by a diverse team of professional engineers, computer scientists, and community contributors. Our autopilot software is capable of controlling almost any vehicle system imaginable, from conventional airplanes, quad planes, multi-rotors, and helicopters to rovers, boats, balance bots, and even submarines. It is continually being expanded to provide support for new emerging vehicle types.

The ArduPilot project is made up of

User Support & Discussion Forums

Developer Information

Top Contributors

How To Get Involved

License

The ArduPilot project is licensed under the GNU General Public License, version 3.

Maintainers

ArduPilot is comprised of several parts, vehicles and boards. The list below contains the people that regularly contribute to the project and are responsible for reviewing patches on their specific area.

Languages
C++ 62.3%
Python 17.7%
C 10%
Lua 4.8%
C# 2.1%
Other 2.7%