View Single Post
  #2   Spotlight this post!  
Unread 11-03-2013, 16:08
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: abstracting/mapping the joystick(s)

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.
Reply With Quote