TrickfireRobotics / mission-control

The mission control user interface for "Viator" for the University Rover Challenge
1 stars 2 forks source link

Add a "Shift"-like Capability to Controllers #9

Open VladimirKupryukhin opened 3 months ago

VladimirKupryukhin commented 3 months ago

Context

Since there are so many controls, it would be nice if we could have a whole different controller mapping if we held down a button. Essentially the same way that a computer keyboard's "shift" button allows you to either type a "7" (no shift) or "&" (with shift).

Current Behavior

Take a look at the controller code. The main idea is that each controller is mapped to a specific .json file which holds a mapping of each button/axis to a ROS topic name.

How to Implement

Perhaps add another entry to the .json file that indicates if a button is used as a "shifter" or not. Detect this shift button, and change what ROS topic is sent when a button is pressed according to the controller bindings. This would most likely be implemented in the controllerState.ts file.

Example of the json; the entry "isShift" is added:

{
    "name": "bButton",
    "type": "button",
    "index": 1,
    "publisherTopic": "",
    "isShift", true
},