#imu #gyro #gamepad #motion #handheld

app aimu

Motion control for handheld computers equipped with a BMI160/BMI260 IMU

2 releases

0.2.3 Nov 3, 2023
0.2.1 Oct 14, 2023

#260 in Hardware support

50 downloads per month

Custom license

26KB
602 lines

AIMU

  • Userspace IMU-assisted aiming for Linux.
  • Maps accelerometer+gyroscope motions to virtual mouse movements.
  • Accounts for angle between screen and keyboard (configurable).

Usage

  1. Prepare the system.
    1. BMI160 only: Disable bmi160_i2c and bmi160_core kernel modules.
      sudo rmmod bmi160_i2c bmi160_core
      
    2. Enable i2c_dev kernel module.
      sudo modprobe i2c_dev
      
    3. Add user to i2c group.
      sudo usermod -aG i2c $(whoami)
      newgrp i2c
      
  2. Build and run:
    1. Default: Dynamic dispatch (less performant, more convenient):
      1. Build and run:
        cargo run --release -- --help
        
    2. Static dispatch (more performant, less convenient):
      1. Tweak default values in source code.
      2. Build and run:
        # Optional: add `--features cli` for command line options
        cargo run --release --features bmi160 -- --help
        # or
        cargo run --release --features bmi260 -- --help
        

TODO

  • Revisit virtual gamepad/joystick (separate branch)
  • Expand trigger mappings
  • Add configuration file and env parsing

Aknowledgements

Dependencies

~9–13MB
~291K SLoC