Go to Post but you can rest assured: I have restored the balance by letting the GDC know that I know that they know that you know they have a pattern. -Leav - Leav [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 30-01-2012, 21:53
SoyStuff SoyStuff is offline
Registered User
FRC #1257
 
Join Date: Jan 2012
Location: Brooklyn
Posts: 29
SoyStuff is a jewel in the roughSoyStuff is a jewel in the roughSoyStuff is a jewel in the rough
Logitech Gamepad

How is a Logitech gamepad initialized? We had been using joysticks, but we decided to switch to a gamepad. Also, how do you read from buttons 11 and 12 (the two "joystick" buttons)? Do you use the AnalogIOButton class?
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2012, 22:13
Cecil's Avatar
Cecil Cecil is online now
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: Logitech Gamepad

We initialized it just the same as the KOP joysticks. it is read as a 3 axis joystick (if you are using the same one) - axis one (x and y) is the left stick, axis 2 is the right stick, and axis 3 was the L2 and R2 buttons. The buttons should be just like the joysticks too - in LabVIEW, you would unbundle the button data. We just pulled up the Windows joystick configuration to figure out what buttons were which
__________________
I'm right 90% of the time, so why worry about the other 3%?
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2012, 23:23
SoyStuff SoyStuff is offline
Registered User
FRC #1257
 
Join Date: Jan 2012
Location: Brooklyn
Posts: 29
SoyStuff is a jewel in the roughSoyStuff is a jewel in the roughSoyStuff is a jewel in the rough
Re: Logitech Gamepad

So, by that I presume you mean that the left stick is the x-axis and the y-stick is the y axis, but it is just one joystick object. Correct?
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2012, 23:26
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Logitech Gamepad

This is how common gamepads map to the FRC joystick data bundle:

Logitech DualAction:
All buttons labeled on the gamepad (including 11 and 12) are accessed as their button # - In LabVIEW, you can unbundle the Buttons and pick 11 or 12, in C++ you can do whatever you normally would do to get a button (I don't know exactly what that is)
Axis 1 -> Left X
Axis 2 -> Left Y
Axis 3 -> Right X
Axis 3 -> Right Y
Axis 5 -> D-Pad X (this is binary - +-1 is left/right)
Axis 6 -> D-Pad Y (binary also)

Logitech F310 or Xbox 360 is slightly different:
-Buttons 1-8 are used. They are not labeled, you can try reading all 8 and seeing what maps to what. I know that 9-12 are not used.
Axis 1 -> Left X
Axis 2 -> Left Y
Axis 3 -> Sum of L2 and R2 analog triggers - One is positive, the other is negative, both or neither is 0.
Axis 4 -> Right X
Axis 5 -> Right y
Axis 6 -> D-Pad X (binary like above - Note that you can't read D-Pad Y)

Any way you do it, a gamepad is a single joystick object.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2012, 00:10
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Logitech Gamepad

Use the forum search feature. This has been asked and answered before.
__________________
Attending: MN Duluth Regional
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:41.

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