Go to Post a good team can do almost anything - Wayne C. [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 Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 11-02-2012, 12:37
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
How to program the Xbox 360 Wired Controller...

So, my team is trying to use the Xbox 360 controller over the provided joysticks for running our robot.

The left joystick is used for our drive motors, both x and y.

We would like to use the "A" button digitally to toggle on/off another motor for collecting balls off of the ground. However, I have no clue how to do this, and really need help.

Another problem is programming the right stick on the controller to control a window motor as an analog value.

The only "preset" programming that works with LabVIEW is the left stick, and I would love to know how to add more variety using A, B, X, Y, and the right stick.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2012, 18:38
CRLS97 CRLS97 is offline
Registered User
FRC #0097
 
Join Date: Jan 2011
Location: Cambridge
Posts: 28
CRLS97 is an unknown quantity at this point
Re: How to program the Xbox 360 Wired Controller...

I'm using a logitech f510 and the button layout may be very similar (windows installed the xbox driver for it) although I can't confirm.

I suggest that to make sure you create a vi that with indicators for the joystick get axes and buttons and then map it yourself.
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2012, 18:57
juchong's Avatar
juchong juchong is offline
Electrical Engineer
AKA: Juan Chong
FRC #2655 (Flying Platypi)
Team Role: Engineer
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Greensboro, NC
Posts: 104
juchong is a jewel in the roughjuchong is a jewel in the roughjuchong is a jewel in the rough
Re: How to program the Xbox 360 Wired Controller...

Once windows finishes installing drivers, plug the controller into the driver station and take a look at the joystick VI. Click on the two axis that are selected by default and change them to 1,2 for the left stick and 4,5 for the right stick (I think, I can't quite recall, but play with it a bit). Also, you might want to take a look at the "button latch" example that comes with labview to see how NI recommends you to make buttons act as latches.
__________________
Teams I've worked with:My Website: http://www.juanjchong.com/
What I do: Analog Devices iSensor Product Engineer
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2012, 11:53
mswalker mswalker is offline
Mentor
FRC #2583 (Westwood Robotics)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 26
mswalker is on a distinguished road
Re: How to program the Xbox 360 Wired Controller...

The layout CLRS97 shows is not what we got for our xBox controller. The approach of using the joystick.vi to test your actual controller is what we did. That way you know for sure what your computer and controller are registering.
__________________
http://team2583.org
Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2012, 21:50
MAldridge's Avatar
MAldridge MAldridge is offline
Lead Programmer
AKA: Rube #1
FRC #0418 (LASA Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Austin
Posts: 117
MAldridge will become famous soon enoughMAldridge will become famous soon enough
Re: How to program the Xbox 360 Wired Controller...

On the subject of the toggle, that is a little more complex. First, you'll need a rising edge trigger, so that the toggle doesn't get called multiple times in rapid succession. Then you'll need to send that value into the future, a shift register or something. Last, run both into an exclusive or. This is how you would do it (see attached).
Attached Files
File Type: vi Boolean Latch.vi (19.6 KB, 61 views)
__________________
'Why are you a programer?' --Team Captain
'Because the robot isn't complicated enough!' --Me
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2012, 11:14
BOSS BOSS is offline
Registered User
FRC #2883
 
Join Date: Jan 2010
Location: MN
Posts: 40
BOSS is on a distinguished road
Re: How to program the Xbox 360 Wired Controller...

How do we find this out, what VI are you using and how can we get it to test the outputs. I assume someone can use both joysticks on the Xbox controller right? If someone could also tell us how to get this information in a vi that would be great as we also want to use both joysticks on the controller one to drive arcade style and one to control a window motor attached to a jaguar. Is that possible. Thanks a ton in advance.

TEAM 2883
Reply With Quote
  #7   Spotlight this post!  
Unread 13-02-2012, 12:05
DavidGitz's Avatar
DavidGitz DavidGitz is offline
Lead Technical Advisor
FRC #1208 (MeTool Brigade)
Team Role: Coach
 
Join Date: Dec 2006
Rookie Year: 1996
Location: O'Fallon, IL
Posts: 341
DavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud ofDavidGitz has much to be proud of
Send a message via AIM to DavidGitz Send a message via MSN to DavidGitz Send a message via Yahoo to DavidGitz
Re: How to program the Xbox 360 Wired Controller...

Quote:
Originally Posted by MAldridge View Post
send that value into the future
Sorry, I can't help myself: http://www.youtube.com/watch?v=bB0dI0GnOYc

I don't know if the WPILibrary has a FluxCapacitor.vi in it.

A better choice of wording is that a Shift Register (or Global Variables or Local Variables) can be used to store data that can be used the next time the loop is ran.
__________________
Reply With Quote
  #8   Spotlight this post!  
Unread 13-02-2012, 19:32
MAldridge's Avatar
MAldridge MAldridge is offline
Lead Programmer
AKA: Rube #1
FRC #0418 (LASA Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Austin
Posts: 117
MAldridge will become famous soon enoughMAldridge will become famous soon enough
Re: How to program the Xbox 360 Wired Controller...

haha, very funny.

Actually, I was referring to a feedback node.

as for polling the values from the joystick, just probe the cluster coming off of the joystick get while the robot is running and move the joysticks around. It will quickly become apparent what axis is what.

You should know that the POV hat is read as a joystick. You might want this to help with that (see attachment).
Attached Files
File Type: vi POV Hat Selector.vi (21.4 KB, 37 views)
__________________
'Why are you a programer?' --Team Captain
'Because the robot isn't complicated enough!' --Me
Reply With Quote
  #9   Spotlight this post!  
Unread 14-02-2012, 16:33
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
Re: How to program the Xbox 360 Wired Controller...

Quote:
Originally Posted by CRLS97 View Post
I'm using a logitech f510 and the button layout may be very similar (windows installed the xbox driver for it) although I can't confirm.

I suggest that to make sure you create a vi that with indicators for the joystick get axes and buttons and then map it yourself.
How do I do all of this?
Reply With Quote
  #10   Spotlight this post!  
Unread 14-02-2012, 16:54
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: How to program the Xbox 360 Wired Controller...

Quote:
Originally Posted by Team3763 Adam View Post
How do I do all of this?
Run the Robot Main vi. Open Teleop and probe the Axes and Buttons outputs from the Joystick Get while the robot is enabled. You will see the results in the probe window.
Reply With Quote
  #11   Spotlight this post!  
Unread 18-02-2012, 16:53
Rogue Leader Rogue Leader is offline
Registered User
FRC #0696 (Circuit Breakers)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Glendale, CA
Posts: 78
Rogue Leader is an unknown quantity at this point
Re: How to program the Xbox 360 Wired Controller...

A way you could tell what buttons are which in LabVIEW is to open the joystick and get button and axis information using the "Open" and "Get" VI's in the WPI robotics library. You can connect an "unbundle by name" block from the cluster palette to get the button/axis info after you get the info from "Get" VI. Then you can hook up some booleans to the info to see button info. And as for joystick info, you can create a boolean light, then on the block diagram, right click, "create", "property node", "position", then "left", and "top". Right click those nodes, and click "change to write" so the joysticks can control their position on the front panel (you might need a scalar to make the joysticks less sensitive). Although, your right joystick should be able to get the motor to work... (Hope this helped).
Attached Thumbnails
Click image for larger version

Name:	LabVIEW Tutorial 2 copy.jpg
Views:	169
Size:	86.3 KB
ID:	11981  
Reply With Quote
  #12   Spotlight this post!  
Unread 27-01-2014, 02:12
gerry gerry is offline
Registered User
FRC #4144
 
Join Date: Jan 2013
Location: inglewood
Posts: 19
gerry is an unknown quantity at this point
Re: How to program the Xbox 360 Wired Controller...

this is my first time programming a xbox 360 controller can any one help me on figuring out what to put in the begin vi and the telop vi so i can use the controllers left joystick as the front and back and the right joystick as the left and right motion
Reply With Quote
  #13   Spotlight this post!  
Unread 27-01-2014, 09:02
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: How to program the Xbox 360 Wired Controller...

Quote:
Originally Posted by gerry View Post
this is my first time programming a xbox 360 controller can any one help me on figuring out what to put in the begin vi and the telop vi so i can use the controllers left joystick as the front and back and the right joystick as the left and right motion
Open it just like a joystick in Begin.

Look back a couple of posts (and a couple of years) for a suggestion on how to determine which controls appear on which axes of the Joystick Get function.
Reply With Quote
  #14   Spotlight this post!  
Unread 27-01-2014, 10:47
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: How to program the Xbox 360 Wired Controller...

Here you are, from another recent thread
Quote:
Axis 1: Left Thumbstick Left-Right
Axis 4: Right Thumbstick Left-Right
Axis 2: Left Thumb Stick Up-Down(Needs to be negated or else up-down controls are inverted)
Axis 5: Right Thumb Stick Up-Down(Needs to be negated or else up-down controls are inverted)
Axis 3(>0): Left Trigger
Axis 3(<0): Right Trigger

1: A Button
2: B Button
3: X Button
4: Y Button
5: Left Bumper
6: Right Bumper
7: Stop/Back Button
8: Start Button
9: Left Thumbstick Button
10: Right Thumbstick Button

DPAD:
-1: No Thumbpad Button
0: North Thumbpad Button
45: North-East Thumbpad Button
90: East Thumbpad Button
135: South-East Thumbpad Button
180: South Thumbpad Button
225: South-West Thumbpad Button
270: West Thumbpad Button
315: North-West Thumbpad Button
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
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 06:20.

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