teamclouday / AndroidSteering

Use your Android phone as steering wheel for Windows games
MIT License
29 stars 8 forks source link

Use virtual gravity sensor instead of accelerometer #8

Closed Dadido3 closed 2 years ago

Dadido3 commented 2 years ago

Hello,

the app itself works really well, but there is one thing that makes it hardly usable for me: You are querying the accelerometer to determine the steering angle, which means that any lateral acceleration of the phone will cause a change in the steering angle.

An easy fix for this is to use a different sensor like Sensor.TYPE_GRAVITY, which is a fusion of the acceleration and gyroscope sensors (And possibly more sensors) and returns an estimated gravitational acceleration vector. It's only a two line change to apply this change, see my pull request for the BeamNG remote controll app, which had the same issue.

This fix should make steering feel much more "direct".

teamclouday commented 2 years ago

Hey, thanks for that info! I'm busy recently but will definitely try it afterwards

teamclouday commented 2 years ago

Hey, just an update. I've tried the gravity sensor and it worked well. I'll release this together with future release. Thanks again!

Dadido3 commented 2 years ago

Thank you for your time and for fixing the problem.