Go to Post You know you've overdosed on FIRST when you set your alarm clock to your team # ex: 9:32 - bladetech932 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 17-02-2012, 11:50
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 162
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Joystick getThrottle() returns 0

I'm having an issue getting the throttle position of the joystick. When I call the getThrottle() method on joystick the value is always 0 regardless of the throttle position. Below is the code I am using:

OI.getInstance().getDriverJoystick().getThrottle() ;
OI.getInstance().getDriverJoystick().getAxis(Joyst ick.AxisType.kThrottle);

When I make a call to get the stick x-axis position it works fine. Value is between -1 and 1.

OI.getInstance().getDriverJoystick().getAxis(Joyst ick.AxisType.kY);

Is there something I am missing here?
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2012, 12:55
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
What joystick are you using? Does the throttle show up on any of the 6 axes?
Reply With Quote
  #3   Spotlight this post!  
Unread 17-02-2012, 15:11
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 162
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Joystick getThrottle() returns 0

It's the Logitech Attack 3.

Not sure what you mean by "the throttle show up on any of the 6 axes"...

In software I'm using the wpilibj Joystick class. Below are the default axes:


static final byte kDefaultXAxis = 1;
static final byte kDefaultYAxis = 2;
static final byte kDefaultZAxis = 3;
static final byte kDefaultTwistAxis = 3;
static final byte kDefaultThrottleAxis = 4;
static final int kDefaultTriggerButton = 1;
static final int kDefaultTopButton = 2;


Is the throttle a different axis on this controller?
Reply With Quote
  #4   Spotlight this post!  
Unread 17-02-2012, 15:24
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
Re: Joystick getThrottle() returns 0

Well, I'm looking at our Logitech Attack 3, and I'm not seeing a throttle. You should just use getX, getY, and getZ.

This is what a joystick throttle looks like.
Reply With Quote
  #5   Spotlight this post!  
Unread 17-02-2012, 15:33
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 162
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Joystick getThrottle() returns 0

I figured it out... the throttle on the Logitech Attack 3 is axis 3 (defined as the twist axis in the wpilibj Joystick class).

Patrick: Not sure how to attach an image... but ours is a single stick "fighter jet" style controller different than your picture.

Thanks for the help!
Reply With Quote
  #6   Spotlight this post!  
Unread 17-02-2012, 15:38
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 162
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Joystick getThrottle() returns 0

Picture of our Logitech Attack 3

http://www.logitech.com/gaming/joysticks/devices/302
Reply With Quote
  #7   Spotlight this post!  
Unread 17-02-2012, 15:41
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
Re: Joystick getThrottle() returns 0

Glad you figured it out.
I know what an Attack 3 looks like; I'm looking at one. The picture I linked is what a throttle looks like, and an Attack 3 doesn't have one of those.
Reply With Quote
  #8   Spotlight this post!  
Unread 17-02-2012, 16:07
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 162
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Joystick getThrottle() returns 0

My confusion mainly came from the image of the Logitech Attack 3 in the WPILib User's Guide. It annotates the dial/lever on the rear of the controller as a "throttle".

http://http://firstforge.wpi.edu/sf/...tion/doc1196/2
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2012, 16:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Joystick getThrottle() returns 0

Quote:
Originally Posted by Patrick Chiang View Post
I know what an Attack 3 looks like; I'm looking at one. The picture I linked is what a throttle looks like, and an Attack 3 doesn't have one of those.
Logitech never explicit labels the wheel at the base of Attack 3. What would you call it? Colloquially, many people call it a throttle. http://www.amazon.com/gp/community-c...sin=B0000ALFC5
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2012, 18:50
nickpeq nickpeq is offline
Turing-complete
FRC #1255 (Blarglefish)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Baytown, TX
Posts: 60
nickpeq is an unknown quantity at this point
Re: Joystick getThrottle() returns 0

It can be referenced with getRawAxis(3) or more simply getZ()
It is the 3rd axis since the Logitec Attack doesn't have a Z/twist.

Also, I don't understand what you're calling the joystick through. What is OI?

Last edited by nickpeq : 17-02-2012 at 18:54.
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 10:42.

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