Sensor API clarifications.
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
I have been trying to implement udev and sdl drivers for accelerometer and gyroscope but there seems to be a bit of miscommunication between the retropad, gamepad designers, and the libretro core developers.
So Retropad gives the following bindings for sensors.
RETRO_SENSOR_ACCELEROMETER_X
RETRO_SENSOR_ACCELEROMETER_Y
RETRO_SENSOR_ACCELEROMETER_Z
RETRO_SENSOR_GYROSCOPE_X
RETRO_SENSOR_GYROSCOPE_Y
RETRO_SENSOR_GYROSCOPE_Z
These are ambiguous. udev uses a similar thing calling the accelerometer ABS_X, ABS_Y and ABS_Z and the gyroscope ABS_RX, ABS_RY and ABS_RZ. SDL has a similar thing where you poll either the accelerometer or the gyroscope once and then get 3 floats with no context. The gamepads I have access to disagree on which is which. This causes things like the dualsense requiring you to hold it with the shoulder buttons facing up and tilting backwards for kirby to move forwards. I would like to make retropad bindings for gamepads but the ambiguity still exists in retropad itself. You could say there is a similar ambiguity with the analog stick, but we're basically in de-facto agreement that X is left->right and Y is up->down like how Latin (English) text is written. Not so with the six axes of the sensors, especially because those axes depend on how you hold the gamepad or mobile device.
I would propose renaming the gyroscope axes to pitch yaw and roll (I think calling the accelerometer X Y and Z is fine as long as it's fomalized), but these are public API values. So a better solution would be to modify the retropad documentation here to show the gyroscope and accelerometer axes including which direction is negative and which is positive.
Thank you.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the retropad input-and-controls documentation linked in the issue and review the existing accelerometer and gyroscope bindings. Clarify the six sensor axes by documenting which direction is positive and negative, while preserving the public API names. Done means the guide removes the ambiguity described for udev, SDL, and gamepad implementations.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100