Turning the Robot(Totally New to programming)

Hi. I would like to ask a quick question.(Sorry, I dont really know how to ask proper question, first post :slight_smile: )

I have been trying to learn Labview throughout this season and its challenging indeed. We have gotten the basic shooting, vision tracking, gyro capabilities, and everything working, but, we are unable to turn our robot in autonomous.

We have used the code that is given in the default autonomous, the turn right for 1 second one, but our robot just drives back, does not turn:S

We are using 4 jaguars and are trying to figure this out. Do we use Button Spin thing instead of arcade drive? :S Can someone post some basic code that might help us accomplish our task? Thank you very much.

Ok, first question, can you turn in teleop? (I realize this is an obvious one, but sometime it gets overlooked.)

Second question, have you tried this with the robot on blocks so you can see what the wheels are doing without having to worry about where the robot is going? I recommend always doing this with autonomous drive code before trying it on the floor so that a mistake on polarity (is -1 forward or backward) or logic doesn’t cause the robot to try to run over a nearby mentor ::ouch::. Make sure that the blocks (or jack stands or whatever) are under a structural part capable of supporting the weight, get all of your powered wheels off the ground, and are not touching any of the wheels.

Do you have a basic four or six wheel drivetrain with kit wheels or something more complicated? I’m going to assume a fairly basic drivetrain for the rest of this.

On the Arcade Drive VI in standard mode (which should work fine for this), the Y axis input (ranging from -1 to 1) controls your forward speed, and the X axis input (same range) controls the amount of turn. Which way forward and right are (negative or positive) depends on your motor physical position, wiring, and what you did in Begin.vi. Since your robot is moving backwards, I suspect that negative is forward and right for you, but the code commenter seems to have assumed the reverse.

The default code has x set to .25 and y set to .5 in the first 1-second while loop (iterating 20 times at 50 ms each), which should cause a gentle forward right (or backward left) turn in which the right and left wheels are all moving in the same direction, but with one side going faster than the other.

The second .5-second while loop reverses the numbers. I’d actually expect this to make the forward right turn tighter, rather than reversing it and going to the left as the comment indicates. Tank drive would produce a left turn with those values, but this is the arcade drive VI.

A good way to make it really obvious whether it’s turning or not is to set Y to 0. This will make it turn in place since there is no motion requested other than the turn (expect the right side tires to go forward and the left backward for a positive value of X, and vice versa for a negative if your polarities are set that way).

You may also want to extend the number of iterations in each loop for testing so that you can get a good look before it moves on.

Yes, we tried teleop and have got it to turn.

We have tried the basic code and put the robot on block. When we try the turn code by setting the x-value to 0.5 and y-value to 0, it moves back. I assume that means that it is somehow getting the y-value set? I am not sure what the problem is. :S

FIXED: For other teams having similar/ same issue.

If you are using a rottery switch of some kind and specifying “buttons” to different autonomous, you might want to check if the number you choose physical matches with in the software.

Because when we put the following on the switch the software gave us these values:

Physical - Software
1 -1
2 -3
3 -0
4 -1
5 -8
6 -7
7 -6
8 -9
9 -0

That is the reason why when we tried to run number “4” we were actually running number “1” which was drive straight back :stuck_out_tongue: Hope this helps any other team having a similar problem.