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.

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.

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!

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

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.

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