Is it possible to write code to change the function of a joystick axis when the driver is holding down a modifier button? For example:
Normally (without holding down a modifier button) axis A is programmed to drive the robot forward (with a positive value) and backward (with a negative value). Axis B is programmed to turn right (positive) and left (negative). The left/right functionality is intuitive for kids when the robot is oriented away from the driver. When the robot turns around and needs to drive toward the driver, the left/right functionality becomes confusing for some kids…left becomes “right” and right becomes “left”. I’d like to give them an option to code a solution to make this driving scenario less confusing.
So, when the robot is oriented back toward the driver, the idea is that they could press and hold the “L down” button while they continue to use the left joystick to drive the robot…but while the “L down” button is being held down, the values of the B axis are reversed…so when the driver pushes the stick left, the robot turns left from the perspective of the driver and not the robot. But when the “L down” button is not being pressed and held, the B axis values are not reversed.
Kind of complicated to describe in words…hopefully the idea comes across clearly.