Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Jaguar Input Values (http://www.chiefdelphi.com/forums/showthread.php?t=92483)

MAldridge 20-02-2011 18:36

Jaguar Input Values
 
I am programming a chunk of code to interface with tankdrive.vi and I need to know what the input range is on the axis values. I have already run over a mentor when I miscalculated the values so I need to know what the valid range is.

I need this to run somewhat slowly, so somewhere about 1/4 total speed is what I'm shooting for.

Vikesrock 20-02-2011 18:45

Re: Jaguar Input Values
 
The inputs are -1 to 1. The joystick Y axes usually output -1 when pushed fully away from the driver and 1 when pulled towards the driver.

MAldridge 20-02-2011 19:04

Re: Jaguar Input Values
 
Is +-1 the full speed value? How do I calculate intermediate speeds?

I notice that the joystick get command has a scaler of 127. What is this for?

Thanks for the fast replies!

Greg McKaskle 20-02-2011 19:41

Re: Jaguar Input Values
 
The HID value for the joysticks is a two byte value, typically between -32768 and 32767. That is converted to an single byte value -128 to 127 to communicate from the DS to the robot, and on the robot it is scaled from an integer byte into a single precision float. The float will go from -1 to +1 with multiples of 1/127 for the inbetween values.

Greg McKaskle

MAldridge 20-02-2011 21:34

Re: Jaguar Input Values
 
So I should pick a value from 1 to 127 then multiply it by 1/127 and/or -1 to achieve a properly scaled output factor? Can someone please post and example of the formatting of the corrected output number.

Vikesrock 20-02-2011 21:43

Re: Jaguar Input Values
 
Quote:

Originally Posted by MAldridge (Post 1027902)
So I should pick a value from 1 to 127 then multiply it by 1/127 and/or -1 to achieve a properly scaled output factor? Can someone please post and example of the formatting of the corrected output number.

That would result in a value that exactly simulates a joystick, but is not necessarily required. The Tank Drive VI will accept any value between 1 and -1 and (I assume) round it to the closest valid output.

Greg McKaskle 20-02-2011 21:53

Re: Jaguar Input Values
 
Just realized i did that wrong. It is 1/256 increments. Anyway, that was just answering your question. the motor and RobotDrive blocks take in -1 to 1. So if you want 1/4 power forward, the value is?

Greg McKaskle


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

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