Go to Post I have trouble believing that there's really a regional that isn't fun... - psquared89 [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 28-01-2013, 08:57
bf2416's Avatar
bf2416 bf2416 is offline
Registered User
AKA: Blake Frasur
FRC #4058 (Boombots)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Union County
Posts: 35
bf2416 is an unknown quantity at this point
gamepad programming

Hey, CD,

My team is thinking about using a gamepad style controller (aka xbox style). I need to know if the 'joystick vi' family will work with a game controller.

Thanks for the input.
  #2   Spotlight this post!  
Unread 28-01-2013, 09:15
pasco27 pasco27 is offline
Programming Captain-Team RUSH
FRC #0027
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Michigan
Posts: 15
pasco27 is on a distinguished road
Re: gamepad programming

It should work just fine if it's USB compatible. I dont know if wireless will work though.

Hope this helps
  #3   Spotlight this post!  
Unread 28-01-2013, 09:32
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
Re: gamepad programming

As long as the gamepad is an HID (Human Interface Device) the joystick.vi should be compatible. Most gamepads should be a HID.
  #4   Spotlight this post!  
Unread 28-01-2013, 10:45
bf2416's Avatar
bf2416 bf2416 is offline
Registered User
AKA: Blake Frasur
FRC #4058 (Boombots)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Union County
Posts: 35
bf2416 is an unknown quantity at this point
Re: gamepad programming

Alright, thanks guys. I figured they would work, but was needed confirmation before I request I controller for 'el jefe'. Again thanks for the feedback.

Now for another question: to control a tank drive like a video game, with a button for drive and joystick for steering, how would I control the steering? I think it would be something like the following:

if x<0, 1-lxl= left drive
if x>0, 1-lxl= right drive


I know that some mobility will be compromised, but we have considered this. I am still trying to figure out the best way to control this thing lol. Thanks again for the input


Edit: also, any suggestions for improving this would be greatly appreciated

Last edited by bf2416 : 28-01-2013 at 10:49.
  #5   Spotlight this post!  
Unread 28-01-2013, 10:59
stingray27's Avatar
stingray27 stingray27 is offline
Registered User
AKA: Michael Ray
FRC #0027 (Team RUSH)
Team Role: Alumni
 
Join Date: Mar 2011
Rookie Year: 2010
Location: Clarkston, MI
Posts: 209
stingray27 is a name known to allstingray27 is a name known to allstingray27 is a name known to allstingray27 is a name known to allstingray27 is a name known to allstingray27 is a name known to all
Re: gamepad programming

Quote:
Originally Posted by bf2416 View Post
Alright, thanks guys. I figured they would work, but was needed confirmation before I request I controller for 'el jefe'. Again thanks for the feedback.

Now for another question: to control a tank drive like a video game, with a button for drive and joystick for steering, how would I control the steering? I think it would be something like the following:

if x<0, 1-lxl= left drive
if x>0, 1-lxl= right drive


I know that some mobility will be compromised, but we have considered this. I am still trying to figure out the best way to control this thing lol. Thanks again for the input


Edit: also, any suggestions for improving this would be greatly appreciated
I don't quite follow what variable x is...
__________________
Michael Ray
Team RUSH 27

Driving Record: 93-64-0 Best Finish: Finalist (x4 FiM Districts)
Coaching Record: 16-7-0 Best Finish: Winner (Kettering Invitationa)l

  #6   Spotlight this post!  
Unread 28-01-2013, 11:02
bf2416's Avatar
bf2416 bf2416 is offline
Registered User
AKA: Blake Frasur
FRC #4058 (Boombots)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Union County
Posts: 35
bf2416 is an unknown quantity at this point
Re: gamepad programming

Quote:
Originally Posted by stingray27 View Post
I don't quite follow what variable x is...
X is the x-value of a joystick, between -1 and 1
  #7   Spotlight this post!  
Unread 28-01-2013, 11:06
stingray27's Avatar
stingray27 stingray27 is offline
Registered User
AKA: Michael Ray
FRC #0027 (Team RUSH)
Team Role: Alumni
 
Join Date: Mar 2011
Rookie Year: 2010
Location: Clarkston, MI
Posts: 209
stingray27 is a name known to allstingray27 is a name known to allstingray27 is a name known to allstingray27 is a name known to allstingray27 is a name known to allstingray27 is a name known to all
Re: gamepad programming

Quote:
Originally Posted by bf2416 View Post
X is the x-value of a joystick, between -1 and 1
Oh sorry. Now I understand that. Sorry about that. I was stuck upon the fact that typically tank drive utilizes 2 axis for movement and arcade drive uses 1 axis.
__________________
Michael Ray
Team RUSH 27

Driving Record: 93-64-0 Best Finish: Finalist (x4 FiM Districts)
Coaching Record: 16-7-0 Best Finish: Winner (Kettering Invitationa)l

  #8   Spotlight this post!  
Unread 28-01-2013, 11:17
bf2416's Avatar
bf2416 bf2416 is offline
Registered User
AKA: Blake Frasur
FRC #4058 (Boombots)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Union County
Posts: 35
bf2416 is an unknown quantity at this point
Re: gamepad programming

A button would set the motors to one, then the joystick would reduce the power to a side, causing smooth turning rather than zero turn.
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 02:08.

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