I am mentoring for a team in OKC and we’re using a joystick to control the robot with mechanum drive. We want to use the slider on the joystick to be a throttle slow to fast. Currently it sends a value -1 to 1.
How would I go about normalizing it from 0 to 1 using lab view?
For the slider:Add 1, then divide by 2 (that gives you a percentage between 0 and 100)
The multiply the joystick value by the slider result.
That will give you a value between 0 and 100% of full joystick power.
I’d adjust the math to make the range 50% to 100% though.
Using 0% would make you think the joystick was broken.
Not really if you are asking for this (what @Mark_McLeod was saying - minus a slider:
Or like this (taking the absolute value so extremes output +1, but center outputs 0):
But if I’m reading your post correctly, you want to take the inputs to the holomnic drive and scale them by the third axis (the slider on an Attack 3 or similar joystick).
Yes, I think the third example is more of what I am looking for. The slider being a throttle perhaps from 10% to 100% speed which I can adjust the above to be .1 to 1 I am sure to accomplish that.
On our joystick (i’ll have to wait til tomorrow when i go there again to get the exact type) the third axis is rotation for the holomnic drive and a slider button is available to get a value.
Gotcha, so it would probably be the fourth axis that you want (you can use the DriverStation to view what axis is moving on the USB tab with the joystick selected). Please feel free to PM me if you need anything else.
The throttle is most likely -1 when all the way forward and +1 when all the way backward. So if that’s the case, you will need to multiply the throttle value by -1 to begin with. LabVIEW has a Negate function that simply multiplies by -1.
The throttle is most likely -1 when all the way forward and +1 when all the way backward. So if that’s the case, you will need to multiply the throttle value by -1 to begin with. LabVIEW has a Negate function that simply multiplies by -1.
I thought that was just on the y-axis . . . DS would make it clear (I don’t have joystick I can plug in right now).