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 from 18ce410 to 02b9181 Compare June 21, 2026 03:56
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.
- Removes deprecated Gamepad::Accelerometer and Gamepad:Gyro events.
@pastaq pastaq force-pushed the pastaq/imu_refactor branch from 02b9181 to 208de6a Compare June 21, 2026 05:37
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