-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Milestone
Description
System Information
OS: macOS Tahoe 26.0.1
CPU: Apple M2 Pro
SDL revision: SDL-3.3.3-3a59163
Issue
When Joy-Cons are connected via Bluetooth, they report strange values for SDL_SENSOR_ACCEL_L and SDL_SENSOR_ACCEL_R.
My code is like below.
// update sensors
SDL_UpdateGamepads();
// get sensor data
SDL_GetGamepadSensorData(gamepad, SDL_SENSOR_ACCEL_L, accel_l, num_data);
SDL_GetGamepadSensorData(gamepad, SDL_SENSOR_ACCEL_R, accel_r, num_data);
// print sensor data
std::println("Accel [L]: {}, {}, {}", accel_l[0], accel_l[1], accel_l[2]);
std::println("Accel [R]: {}, {}, {}", accel_r[0], accel_r[1], accel_r[2]);The above code prints like below when Joy-Cons are connected via Bluetooth.
The Y components (gravity) are around 5 but it should be around 9.8.
Also, Z component of right Joy-Con is infinite.
// connected via Bluetooth
Accel [L]: 0.68188006, 5.286458, 3.4357657
Accel [R]: -0.11032482, 5.686278, inf
When Joy-Cons are connected via USB (using Joy-Con Charging Grip), the above code prints like below.
The Y components are around 9.8 as expected.
// connected via USB
Accel [L]: 0.19073273, 10.117623, 1.137454
Accel [R]: 0.12826635, 9.966133, 1.1899831
Please take a look at the attached bluetooth.txt for an actual log for Bluetooth connection and usb.txt for USB connection.
How to replicate the issue
I have attached a program (main.cpp) to replicate the issue.
Metadata
Metadata
Assignees
Labels
No labels