Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   FRC Joystick throttle problems (http://www.chiefdelphi.com/forums/showthread.php?t=85196)

cvitullo 12-04-2010 22:52

FRC Joystick throttle problems
 
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

Re: FRC Joystick throttle problems
 
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

Re: FRC Joystick throttle problems
 
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

Re: FRC Joystick throttle problems
 
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)

Al3+ 13-04-2010 02:14

Re: FRC Joystick throttle problems
 
Quote:

Originally Posted by Radical Pi (Post 953090)
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.

jhersh 13-04-2010 02:24

Re: FRC Joystick throttle problems
 
Quote:

Originally Posted by cvitullo (Post 953075)
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

Re: FRC Joystick throttle problems
 
Quote:

Originally Posted by cvitullo (Post 953075)
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:

Quote:

if (ThirdStick->GetRawButton(3))
{
{ Variable->Set( ( ( ThirdStick->GetThrottle() / 2 ) - 0.5 ) ) ; } ;
};
it works well with our ball magnet


All times are GMT -5. The time now is 13:22.

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