abstracting/mapping the joystick(s)

we may be going through some button/joystick remapping in the next few days. Has anyone already written and published anything for remapping/abstracting the buttons? I want to refer to the buttons by function “Shoot”, not by “Button 1”?

I know how to do it myself, but if someone has already published it, I’m a lazy guy…

We’ve been doing it for years. It’s not published anywhere, but it’s pretty easy.

The biggest help I can suggest is to create a “typedef” .ctl file to define a cluster containing the functional names. Use an instance of it as the “type” input to a Bundle by Name function, and you’ll end up with the output of the mapping subVI being the same type. If you don’t use a .ctl, when you add more functions, there will be a lot of places that will break and need to be deleted/recreated/reconnected.

You have a choice of reading the actual joystick(s) inside the mapping function, or reading the joystick outside and passing the axis and button clusters as inputs to it.

If you have a clean split between driver and operator functions, you can create separate mapping subVIs for each. If there’s some overlap/override/cooperative action, you can probably work out a good way to have separate output clusters, and use each where appropriate.

Alan, thanks! If existing practice wasn’t available, I was going to have them write it themselves, and confirmation that it is not a biggie helps, as well as pointing out some of the design considerations.

I was a little worried about the overhead of doing all the work of constructing the new bundle in both Teleop and some loops of Periodic Tasks (as needed), but this is apparently not an issue.

The reminder of using the .ctl is appreciated. Best practices and all…