cockpit
cockpit copied to clipboard
frontend: joystick: add a "reverse" mode
Current behaviour
Controls are currently fixed to "forwards" style. That's fine for most users, but if a vehicle is reversible it can be convenient to reverse the controls.
That's technically already possible via a workaround, by duplicating a functions mapping and swapping just the desired axes, but then it's awkward to swap between them (they need to open the joystick configuration to do so, instead of just pressing a button), swapping mappings is currently confusing, there's needless extra work to keep the button mappings in sync, and it loses the user a mapping set.
Expected or desired behaviour
Add a "reverse" Action, to reverse the user's motion control inputs:
- A minimal implementation could just directly reverse all the axis mapping ranges except for Z, although there may be some confusion if that change is persistent across reboots.
- To make it more configurable the reversing status could be defined by a boolean data-lake variable (with optional value persistence?), which would then also integrate nicely with #1759, in future development.
- Variables can be toggled, or controlled as momentary switches (e.g. while holding a joystick button), which opens some additional usage possibilities
- This has the side benefit that it could be used to trigger an automatic switch between Views (e.g. to one with a rear-facing camera as the main display), via a custom Action
- If we want to provide more control to the user we could allow them to select which axes are "reversible", as part of the joystick configuration interface.
- This perhaps lends itself more into expansion to areas like dynamic axis switching
Prerequisites
- [x] I have checked to make sure that a similar request has not already been filed or fixed.