Go to Post It is probable that you will find mroe than a few spotlight worthy phrases or sentences in the following. ;) - sanddrag [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 19-02-2011, 17:55
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
2 questions regarding joysticks

We have decided to not use the Attack 3 joystick and we are now going to use 1 Saitek controller. Because of this switch, I have two questions.

1. Is there a way to read POV using the Get Joystick VIs. If not, the POV also counts as buttons 12 through 20, but I would prefer not to have 8 case structures and just read the direction from the POV. I know that LabVIEW has a connectivity VI that allows the reading of POV, but it does not work with a cRIO.

2. What is the differance between a joystick 'get' vi and a joystick 'get raw' vi. Should I use the get raw if I am not using the Attack 3 controllers?
__________________
"Don't worry, programming can fix it"

Last edited by iblis432 : 19-02-2011 at 22:58. Reason: typo
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2011, 21:05
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: 2 questions regarding joysticks

1. I believe the POV is returned as two of the axes. It will only return values that are multiples of 45 degrees.

2. Get returns a -1 to 1 range, raw returns integers between -128 and 127. Feel free to look at the code of both to see the differences.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2011, 21: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,113
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: 2 questions regarding joysticks

Quote:
Originally Posted by iblis432 View Post
...the POV also counts as buttons 12 through 20,...
The FRC Driver Station only communicates the state of joystick buttons 1-12.
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2011, 21:08
MattCarey3625's Avatar
MattCarey3625 MattCarey3625 is offline
#3625 Programming and Wiring Head
FRC #3625 (Some Assembly Required)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Virginia Beach, VA
Posts: 23
MattCarey3625 is an unknown quantity at this point
Re: 2 questions regarding joysticks

I am sorry to say that I can not answer your first question, I am unsure of what you are asking. But for the second, Get Raw gives you data such as whether a button is pressed or the axis value of the joystick. Get Joystick is rather unclear to me. For button operations use this diagram.
Use Get Raw and feed it to an 'Unbundle by Name' then you can use the boolean values that tunnel from the array to use as qualifiers for While loops or Case Structure i.e While (Button 9 == T) or If(Button 7 ==T)
Good luck!
__________________
matt@hp-mini-110$> sudo make robot
sudo pass for matt:
unable to make robot
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2011, 21:49
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: 2 questions regarding joysticks

To fix the number of buttons issue, couldn't I change the input cluster as shown in the attached picture of the joystickrawvalue.vi ?

And the Joystick we plan to use has a scale of 32470 to -32470. So wouldn't Get Raw give me those numbers and i just have to divide the output by 32470?
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	46
Size:	65.3 KB
ID:	10223  
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #6   Spotlight this post!  
Unread 19-02-2011, 21:55
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: 2 questions regarding joysticks

The DS protocol returns a byte per axis, so that is what raw refers to. The DS scales all HID joystick axes to the same byte range.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 19-02-2011, 22:57
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: 2 questions regarding joysticks

Quote:
Originally Posted by Greg McKaskle View Post
The DS protocol returns a byte per axis, so that is what raw refers to. The DS scales all HID joystick axes to the same byte range.

Greg McKaskle
So then no additional coding is necessary for the new joystick and it is programmed the same as an Attack 3 joystick correct?
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #8   Spotlight this post!  
Unread 20-02-2011, 01:45
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: 2 questions regarding joysticks

Quote:
Originally Posted by iblis432 View Post
So then no additional coding is necessary for the new joystick and it is programmed the same as an Attack 3 joystick correct?
Yes, any USB device that identifies itself as a "joystick" can be read by the Driver Station.

What's the verdict on the POV thing? We were just wondering about that today. I'll try probing some of the other axes tomorrow.

If that doesn't work, who wants an offseason project to figure out how to get it without using the WPI library?
Reply With Quote
  #9   Spotlight this post!  
Unread 21-02-2011, 10:58
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: 2 questions regarding joysticks

Quote:
Originally Posted by WizenedEE View Post
What's the verdict on the POV thing? We were just wondering about that today. I'll try probing some of the other axes tomorrow.

If that doesn't work, who wants an offseason project to figure out how to get it without using the WPI library?
For us, the POV came up as axis 5 and 6. X on the POV was axis 5 with -1 being left, 0 being center, and 1 being right. Y was axis 6 with -1 being up, 0 being center, and 1 being down.
__________________
"Don't worry, programming can fix it"
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 20:36.

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