View Full Version : FRC Joystick throttle problems
cvitullo
12-04-2010, 22:52
My team is using the throttle on the Attack 3 joystick for our kicker speed control, but for some reason it's only returning -1, 0, or 1. Never anything else, despite being an analog input. Anyone else have this problem?
We're passing it to a Victor (also, does anyone know the values a victor takes in? I can't find them anywhere) after a bit of math to convert it.
Radical Pi
12-04-2010, 22:57
I believe Victors work the same as jaguars, a value between -1 and 1. Are you looking at the output directly from the joystick? The problem could be in your conversion code
cvitullo
12-04-2010, 23:06
Do they now. My mentor was under the impression is was 0 - 255. That would explain some of our problems. Can you/anyone confirm that? I don't have any hardware to actually test on right now :(
By the way, we're switching from LabVIEW to C++ for nationals, so it's kind of... urgent that we figure all this out.
Radical Pi
12-04-2010, 23:09
Both the Victor and Jaguar class implement the same MotorController interface which defines the use of the Set function, so I'd assume they take the same inputs (and I'm 100% sure it's -1 to 1 on jags)
The 0-255 confusion is probably from the IFI system. I've never used it personally, but apparantly that is how the pwms on that board were controlled (no floating point capabilities on IFI)
Both the Victor and Jaguar class implement the same MotorController interface which defines the use of the Set function, so I'd assume they take the same inputs (and I'm 100% sure it's -1 to 1 on jags)
Confirmed. The Joystick::GetThrottle() function also returns a float from -1 to +1.
And yes, it used to be 0 to 255 on the IFI control system.
Refer to the help docs that come with WindRiver (I believe it's C:\WindRiver\docs\extensions\something). The return types and such are all in there.
My team is using the throttle on the Attack 3 joystick for our kicker speed control, but for some reason it's only returning -1, 0, or 1. Never anything else, despite being an analog input. Anyone else have this problem?
We're passing it to a Victor (also, does anyone know the values a victor takes in? I can't find them anywhere) after a bit of math to convert it.
Sounds like you are storing the joystick axis data in an integer variable. Make sure you store it in a float or a double.
krudeboy51
14-04-2010, 20:46
My team is using the throttle on the Attack 3 joystick for our kicker speed control, but for some reason it's only returning -1, 0, or 1. Never anything else, despite being an analog input. Anyone else have this problem?
We're passing it to a Victor (also, does anyone know the values a victor takes in? I can't find them anywhere) after a bit of math to convert it.
TRY THIS:
if (ThirdStick->GetRawButton(3))
{
{ Variable->Set( ( ( ThirdStick->GetThrottle() / 2 ) - 0.5 ) ) ; } ;
};
it works well with our ball magnet
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.