Go to Post Maybe there's some reason that makes it not that simple... - Cory [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-03-2013, 15:11
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 325
fovea1959 will become famous soon enough
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...
Reply With Quote
  #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
  #3   Spotlight this post!  
Unread 12-03-2013, 09:26
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 325
fovea1959 will become famous soon enough
Re: abstracting/mapping the joystick(s)

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


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:57.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi