![]() |
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? |
What joystick are you using? Does the throttle show up on any of the 6 axes?
|
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? |
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. |
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! |
Re: Joystick getThrottle() returns 0
|
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. |
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 |
Re: Joystick getThrottle() returns 0
Quote:
|
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