# DS4 Conflates IMU/Gyro with Sticks

**URL:** <https://discourse.libsdl.org/t/ds4-conflates-imu-gyro-with-sticks/28379>\
**Category:** SDL Development\
**Created:** [November 24, 2020, 8:40am UTC](https://discourse.libsdl.org/t/ds4-conflates-imu-gyro-with-sticks/28379 "2020-11-24T08:40:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedMarsBlueMoon](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@RedMarsBlueMoon](https://discourse.libsdl.org/u/RedMarsBlueMoon)\
**Post date:** [November 24, 2020, 8:40am UTC](https://discourse.libsdl.org/t/ds4-conflates-imu-gyro-with-sticks/28379/1 "2020-11-24T08:40:30Z")

</div>

Hello everyone! First time poster here.

I’v got some strange gamepad behaviour with my DS4 controllers that I’m trying to track down where it’s coming from.

Basically I’m getting IMU/Gyro data passed through with my controller axis calls like these:

state.left\_x = SDL\_GameControllerGetAxis(controller, SDL\_CONTROLLER\_AXIS\_LEFTX);  
state.left\_y = SDL\_GameControllerGetAxis(controller, SDL\_CONTROLLER\_AXIS\_LEFTY);

I have been searching wide and far for information on how the DS4 motion data is being passed around in SDL2 but I just can’t find any information on it.  
The above calls are meant to pick up the analogue stick and it does that fine. But sometimes I also get those variables flushed full of motion data.

Would anyone be able to point me in the direction of some info on how SDL handles IMU/movement? Or if you recognize this behavior and know whats going on?

I’m working on Raspbian Buster 32bit or a RPi4.  
SDL ver: libsdl2-dev is already the newest version (2.0.9+dfsg1-1+rpt1)

Cheers, Fred

---

<div class="post-metadata">

**Author:** ![RedMarsBlueMoon](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@RedMarsBlueMoon](https://discourse.libsdl.org/u/RedMarsBlueMoon)\
**Post date:** [November 24, 2020, 6:32pm UTC](https://discourse.libsdl.org/t/ds4-conflates-imu-gyro-with-sticks/28379/2 "2020-11-24T18:32:42Z")

</div>

Searching this very forum 🙂 I found some more info!  
Seems like there’s something in the works! [https://bugzilla.libsdl.org/show\_bug.cgi?id=4815](https://bugzilla.libsdl.org/show_bug.cgi?id=4815)

Does anyone know if this is close to being merged in, or if it should be working well enough to patch in current sdl?

Otherwise I believe that Gyro/Accel data currently comes in as a completely separate ‘Joystick’ device?

That could match what I’m observing that currently the system (not my original code) seems to add a controller when I start shaking the DS4 around.

EDIT: Is there a way to get an identification of the Joystick device that is representing the Gyro/Accel input?
