Skip to content

feat: Normalize IMU data and use buffers for IMU's - #612

Draft
pastaq wants to merge 1 commit into
mainfrom
pastaq/imu_refactor
Draft

feat: Normalize IMU data and use buffers for IMU's#612
pastaq wants to merge 1 commit into
mainfrom
pastaq/imu_refactor

Conversation

@pastaq

@pastaq pastaq commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

This PR does a major overhaul of how IMU data is managed across every aspect of InputPlumber.

  • All source device drivers now normalize IMU data into radians per second for gyroscope data and meters per second squared for accelerometer data.
  • All target devices now denormalize Accelerometer and Gyroscope events into their native format (typically LSB).
  • The iio_imu source device driver now configures a buffer and follows an asynchronous drain/refill pattern to create events. This reduces CPU and RAM overhead by reducing the number of reads per event from 3-6 to 1. This also has the benefit of reducing jitter when using iio_imu based devices as the entire event is now based on a single timestamp, when the old method had significant drift during each poll.

@pastaq
pastaq force-pushed the pastaq/imu_refactor branch 2 times, most recently from 02b9181 to 208de6a Compare June 21, 2026 05:37
@pastaq
pastaq force-pushed the pastaq/imu_refactor branch from 208de6a to 5708e71 Compare August 21, 2026 18:51
This PR does a major overhaul of how IMU data is managed across every
aspect of InputPlumber.
- All source device drivers now normalize IMU data into radians per second
  for gyroscope data and meters per second squared for accelerometer data.
- All target devices now denormalize Accelerometer and Gyroscope events
  into their native format (typically LSB).
- Split BMI and AccelGyro3D Drivers. The AccelGyro3D source device driver
  now configures a buffer and follows an asynchronous drain/refill pattern
  to create events. This reduces CPU and RAM overhead by reducing the
  number of reads per event from 3-6 to 1. This also has the benefit of
  reducing jitter when using AccelGyro3D based devices as the entire event
  is now based on a single timestamp, when the old method had significant
  drift during each poll.
- Removes deprecated Gamepad::Accelerometer and Gamepad:Gyro events.
@pastaq
pastaq force-pushed the pastaq/imu_refactor branch from 5708e71 to 041db89 Compare August 21, 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