Joysitck Controls

How do we fix the invert controls so that when we turn left, the robot also turns left.

Does the robot go forward and backwards according to what you would expect?

Are you using arcade drive? If so you could just negate the rotation input and that would probably be the easiest fix.

I’m not very knowledgeable in LabVIEW so I don’t exactly understand what’s the drive control used here. From your question, I assume arcade drive (joystick Y controls forward/back speed, joystick X controls rotation)? It all boils down to inverting number signs after all…
You can invert/negate the rotation input, that should work.

Is Tank drive the same as arcade drive?

No. Tank drive takes an input for the left side speed and an input for the right side speed. Arcade drive takes an input for the forward speed and an input for the turning rate. They basically work like this (real implementations are a little more complicated):

// Tank drive
left = joystick1.GetY()
right = joystick2.GetY()

// Arcade drive
forward = joystick1.GetY()
turn = joystick2.GetX()
leftMotor.set(forward - turn)
rightMotor.set(forward + turn)

where would I find that, im new to this and didn’t create it so i’m not sure where i would go to change it.

I’ve never used LabVIEW, so I don’t know. I was just demonstrating the difference between the two drive schemes with some pseudocode.

Do you know where you would go to change it in Labview. I didn’t create it so i’m not sure where to find it.

Yes assuming you haven’t changed a lot of things you will go to and look for the code below. You will right click where I placed the red dot and choose Insert navigate to the math palette and choose negate. It looks like a triangle with a minus sign in it.


This is what ours looks like. It already had a negate sign in it, but turning is still inverted on the joystick

See how it has negate on the bottom line. That is the Y axis or straight input. I was asking for an invert on the x axis or the rotation input which is the orange line above it.

Should we remove the negate that was already there or leave it alone?

Leave it please. The controller you are using sends negative signals when the joysticks is moved forward and positive backwards so that negate is correcting for that.

We put a negate in but the controls are still inverted. I read in a separate thread about switching the motors but we weren’t sure.

After doing this you either deployed to the robot or built and ran as startup?

I’m not sure, I thought it automatically applies to the frc driver station after you save it or is that not the case?

No all code changes must be deployed to the robot. See this article

You also might find this page and the other articles around it helpful

Should we be worried about a error code saying theres too much code for the joystick?

Can you give the exact error text or a screenshot?