Repository navigation
fix: General IMU fixes - #816
Merged
Merged
Conversation
The kernel attribute holds a matrix either as "1,0,0;0,1,0;0,0,1" or as nine numbers with no separators. Only the first form parsed, so a device with the second ran without a matrix. Assisted-by: LLM
Each handle reports its accelerometer and gyroscope in the frame its sensor is mounted in, so the two handles disagree and consumers see the device turned. Fix the signs per handle, average only the handles that report attached (a detached handle reads zero and halved the result), and take the gyro scale from the LSM6DSO datasheet: 70 mdps/LSB at +/-2000 dps is 28571 counts, not 32768. Assisted-by: LLM
The accelerometer and gyroscope were signed and swapped differently from each other, which no mount matrix can undo. Negate all three axes for both. Assisted-by: LLM
Accelerometer fields are 16-bit signed counts with a fixed full scale: 2 g on the Deck protocol, 4 g on DualSense. Handheld sensors go past that, and clamping each axis separately rotates gravity, which consumers use to correct gyro drift. Scale the whole vector to the report's full scale instead. Assisted-by: LLM
The rule wrote imu_bypass_enable and vibration_enable. The driver exposes imu_bypass_enabled and vibration_enabled, so the write failed and the IMU stayed off. Co-developed-by: Christopher Lott <lott.ch@googlemail.com> Assisted-by: LLM
These devices report gravity on the wrong axis for the way they are held. The MSI Claw A8 gyro matrix is removed: its firmware reports a correct one and a configured value would override it. Assisted-by: LLM
These have a determinant of -1, which mirrors the gyroscope against gravity: gravity reads correctly but turns go the wrong way. Replaced with the matrix used by the same sensor in other chassis. Not tested on these models. Assisted-by: LLM
Both iio IMU sources returned one shared capability list holding an accelerometer and a gyroscope, so a source with a single channel group advertised the other and downstream consumers waited for events that can never arrive. The driver already discovers which groups a device has, so let it report the events those groups produce and let the source driver convert them into capabilities. A sensor with both groups reports both as before. Assisted-by: LLM
accel_gyro_3d passes corrections_from_config to the driver while bmi_imu passed 1.0 for both factors, so config.imu.accel_correction and gyro_correction had no effect on a BMI source. The option defaults to 1.0 and no config in the tree sets it on one, so behavior is unchanged until a device asks for it. Assisted-by: LLM
pastaq
force-pushed
the
pastaq/imu_validation
branch
from
November 20, 2026 00:54
6c5a3ba to
2e5a468
Compare
Contributor
|
🎉 This PR is included in version 0.85.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds multiple fixes for bugs introduced or missed during the IMU refactor. One major issue was that all updated mount matrices has an incorrect reflection built into them.
Closes #772