Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Joystick getThrottle() returns 0 (http://www.chiefdelphi.com/forums/showthread.php?t=103078)

Brian Selle 17-02-2012 11:50

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?

Joe Ross 17-02-2012 12:55

What joystick are you using? Does the throttle show up on any of the 6 axes?

Brian Selle 17-02-2012 15:11

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?

Patrick Chiang 17-02-2012 15:24

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.

Brian Selle 17-02-2012 15:33

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!

Brian Selle 17-02-2012 15:38

Re: Joystick getThrottle() returns 0
 
Picture of our Logitech Attack 3

http://www.logitech.com/gaming/joysticks/devices/302

Patrick Chiang 17-02-2012 15:41

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.

Brian Selle 17-02-2012 16:07

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

Joe Ross 17-02-2012 16:23

Re: Joystick getThrottle() returns 0
 
Quote:

Originally Posted by Patrick Chiang (Post 1128919)
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

nickpeq 17-02-2012 18:50

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? :P


All times are GMT -5. The time now is 10:42.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi