Go to Post I tried to convince my team to use the force but no one would listen. - ngreen [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-01-2016, 14:55
UnderFiveFoot UnderFiveFoot is offline
Registered User
FRC #2001
 
Join Date: Jan 2016
Location: Kansas City
Posts: 1
UnderFiveFoot is an unknown quantity at this point
Xbox Controller Labview Help

This is the first year my team is using an xbox controller. We have looked at old posts for ideas and examples and none have worked. We are using labview tank drive. Does anyone have an recent example code?

An example of our code is attached below.
Attached Thumbnails
Click image for larger version

Name:	xbox program.png
Views:	123
Size:	12.8 KB
ID:	19918  
  #2   Spotlight this post!  
Unread 30-01-2016, 22:53
RoboMo786's Avatar
RoboMo786 RoboMo786 is offline
Student - Design
AKA: Mo Baig
FRC #3538 (Avondale RoboJackets)
Team Role: CAD
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Auburn Hills, MI
Posts: 30
RoboMo786 is an unknown quantity at this point
Re: Xbox Controller Labview Help

My Labview skills are a little rusty, but why are you inputting axis 2 from the "get axis" vi and axis 1 from the unbundled cluster? It seems like you should either use the "get axis" vi for both, or feed the values in from the cluster. It also looks like you have axis 5 feeding into the one drive twice.
  #3   Spotlight this post!  
Unread 30-01-2016, 23:30
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Xbox Controller Labview Help

There should only be a single instance of Tank Drive in that VI. You never want to define the same item twice with different variables The Tank Drive VI takes two numerical values, one for the right and left joysticks. I'm not sure what exactly you're trying to achieve with your current setup. I'm assuming you want to use the two Y-axises of the Xbox joystick as your controls. If so, I would use axis 1 for your left stick and axis 4 for your right stick. I do not have LabVIEW on this computer (we switched to Java), but your VI should look like this: http://prntscr.com/9x2sk7
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)
  #4   Spotlight this post!  
Unread 31-01-2016, 18:32
fargus111111111's Avatar
fargus111111111 fargus111111111 is offline
Registered User
AKA: Tim W
FRC #0343 (Metal in Motion)
Team Role: Alumni
 
Join Date: Nov 2014
Rookie Year: 2010
Location: South Carolina
Posts: 102
fargus111111111 is on a distinguished road
Re: Xbox Controller Labview Help

I have built a "tank drive" control similar to what I think you are looking for for one of our demo robots. Just to clarify, you are trying to use the two Y-values from the sticks on the controller to control your right and left side independent of each other. The two numeric inputs on the "Tank Drive" VI are the two joystick input values. A single instance of the "Tank Drive" VI will control both the right and left sides. Having multiple drive VIs running at the same time will cause problems.

As a side note, this is a hard drive style to get used to if you have done a lot of driving with single stick controls.
__________________
I didn't break it... this time.
  #5   Spotlight this post!  
Unread 31-01-2016, 20:48
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Xbox Controller Labview Help

xBox tank drive would look like this:
Attached Thumbnails
Click image for larger version

Name:	XboxTank.png
Views:	69
Size:	18.2 KB
ID:	19932  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #6   Spotlight this post!  
Unread 01-02-2016, 09:56
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Xbox Controller Labview Help

Quote:
Originally Posted by UnderFiveFoot View Post
This is the first year my team is using an xbox controller. We have looked at old posts for ideas and examples and none have worked. We are using labview tank drive. Does anyone have an recent example code?

An example of our code is attached below.
As far as I know, the labview best practice for joysticks is not clusters anymore, but arrays.

You used to have to use clusters but all teams I've seen recently have used arrays.
__________________
2015 MAR District Champions




  #7   Spotlight this post!  
Unread 02-02-2016, 08:46
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,756
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: Xbox Controller Labview Help

This was done to provide better support for a wide array of joysticks. You can convert between arrays and clusters if you like or you can build an enum that gives useful names to the indices and use that as you index constant.

Greg McKaskle
  #8   Spotlight this post!  
Unread 02-02-2016, 10:08
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Xbox Controller Labview Help

Quote:
Originally Posted by Greg McKaskle View Post
This was done to provide better support for a wide array of joysticks. You can convert between arrays and clusters if you like or you can build an enum that gives useful names to the indices and use that as you index constant.

Greg McKaskle
316 is using enums this year. If anyone has any questions on how we are doing it, please PM me. It really increases the readability of your code.
__________________
2015 MAR District Champions




Closed Thread


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 01:32.

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