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(Joystick.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(Joystick.AxisType.kY);

Is there something I am missing here?

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

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?

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.

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!

Picture of our Logitech Attack 3

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

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.

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/docman/do/downloadDocument/projects.wpilib/docman.root.c_and_java_documentation/doc1196/2

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-content-search/results/ref=cm_srch_q_rtr/?query=throttle&search-alias=community-reviews&Go.x=0&Go.y=0&idx.asin=B0000ALFC5

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