I was looking at the Tank Drive Example under the examples folder in the startup of Labview. And I was wondering if I choose to use the Tank Drive function, how do I implement it to Robot Main.vi? Do I just copy and paste something? I am very confused on how to incorporate modified vi’s. into Robot Main. vi
I think the most appropriate way to use the example code is indeed to copy it from the example and paste it into your robot project. Only copy the parts you need.
You’ll want to put it in the TeleOp VI and the Autonomous (independent or interative) VI, not directly in the RobotMain VI.
Our team is also trying to change the example program from arcade to tank drive. The tank example is written in the Basic framework. I don’t think the Basic Framework is available in this year. This is causing our team some confusion.
We have replaced the Arcade drive.VIs with Tank.VIs in the Teleop.vi-execute case-true case, Teleop.vi-stop case. We have also added another joystick reference in the open and close VIs.
Anything else we need to change? When we deploy the robot is still driving in tank.
PS- Will changing from arcade to tank affect our ability to camera track with the default camera tracking code?
We also need to know how to do this. The basic robot main.vi is quite different from last years. Also if anybody knows how to wire the gyro the information is to technical for us.
I assume you mean it’s still driving in Arcade mode. Otherwise, you’d be celebrating your success rather than asking for help.
You also need to change from reading the x and y axes of a single joystick to reading the y axes of two different joysticks.
But if you didn’t do that properly, you’d find the robot driving oddly, sort of like a diagonal arcade but not quite. If it is still acting like the original arcade mode software, you might not be running the new code successfully. How are you deploying it?
PS- Will changing from arcade to tank affect our ability to camera track with the default camera tracking code?
The “button 3 to track” code will still work exactly as it used to. It ignores the joystick control and instead uses a PID system to compute a steering value.
As long as you changed the code from arcade to tank in the false case only.
We added a second joystick reference in the begin and close VIs. (see attached) Joystick 1, motors, and gyro error outs are connected to an array function. Do all devices have to be connected to the array? We have been using the videos at LVMastery to learn LabView and the begin VI from the LVMastery videos do not have this array that is built in to the 2010 Game Robot Project.
We changed all arcade drive VIs with tank, in the true and false case. Do we need to change back to arcade in the true case? Can you explain the purpose of this case structure? The videos from LVMastery do not have this case structure.
Thanks in advance.
The error I/O in begin isn’t really that important. Unwired errors will still show up in the diagnostics tab. Wiring the errors give you the ability to filter, respond, and retry, but simply building an array to pass out really doesn’t accomplish anything.
You begin looks fine. How about the Teleop?
Greg McKaskle
I’ve attached the Teleop False case. I changed the True case back to match the default code.
You’re reading Joystick 1 instead of Joystick 2 for your right side control. Unless you’ve changed the joystick read sub-vi, I think your robot will travel straight based on Joystick 1, it will never turn, and it will ignore Joystick 2.
grosh,
can you email me that code, I want to take a closer look at it because it is different from the one that I made.
Oops. I will make the change and test on Monday. Thanks all!
One last question though…Is Arcade mode(default) needed in the True case as Joe stated earlier… or does it matter…or what?
The True case is what executes while you press the joystick button. It uses the gyro and vision tracking to rotate the robot to face the target. It does that by controlling the “turn” input to the Arcade Drive vi.
If you want to change the target-seeking code to give commands to a Tank Drive vi instead, you can.
However, there is no particular reason to do so. The use of Arcade Drive there doesn’t affect your driving controls at all, since with the push of the button you’ve relinquished joystick control of the robot until you release the button.
Your joysticks will not revert to Arcade drive. They will only operate in Tank drive.
Also if anybody knows how to wire the gyro the information is to technical for us.
For gyro wiring, check out the Gyro Example. The example shows generic wiring. For the 2010 kit gyro, the RATE pin is marked. The 5V pin is next to the RATE pin in the row of three pins nearest the edge of the board. The GND pin is next to the 5V pin in the row of pins nearest the edge of the board. For the 2010 kit gyro, the Gain (Volts/Degree/Second) is 0.007. You will need to input that value in the example.
For more on wiring the gyro, see the FIRST Sensor Manual_RevA here
http://www.usfirst.org/roboticsprograms/frc/content.aspx?id=452
If you have trouble with your gyro drifting, try rebooting the cRIO. The cRIO calibrates modules when it boots, so if you added a module afterward, or your robot was moving during bootup, you may have calibration issues.