Tank Drive in Autonomous

I thought that when programming autonomous for tank drive the two values x and y in the


(we named our robot drive “drive” , we’re original)

were the two motor values, but they are not. What are these values and what do I have to do to get the robot to back straight up in autonomous?

I bekieve you are refering to the part like below:

myRobot.Drive(1.0, 0.0);

That represents driving forward at full speed with no turn (so I believe, unless it has been changed this year).

When i try that the motors sort of give a little twitch and then do nothing.

is it humming like the motors are running?

No, and the lights on the jaguars aren’t lit up either.

It sounds like you may have a watchdog issue? What does the Driver Station say when things stopped? Did you check your console to see if there are any messages?

ERROR: A timeout has been exceeded: RobotDrive… Output not updated often enough. …in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 123

I don’t know what it means though…

:confused: sorry I don’t know what that means either

Well with the lights not lit up on the Jaguars, it seems like the code they are getting is not telling them to run near full speed or they would go either Green/Red or for off would be Orange.

Is there an issue with how it is declared?

Could you post your Autonomous code?

And how long is your “Wait()” function set for?

Wait, no LEDs lit on the Jaguars? You need to check if you have connected power to the Jaguar correctly. Make sure not only the +12V and GND are connected to the correct side of the Jaguar (Red and Black screws) that marked V+ and V- (not M+ and M-). Also make sure you have the polarity connected correctly and there is a fuse for each Jaguar on the PDB. To be absolute sure, use a volt meter and check if each Jaguar has 12V across the V+ and V- terminals. If there is and the LED is still dark, your Jaguars may be bad.

I would check the voltage (in case of a bad Jaguar), but if it runs fine in Teleop then that shouldn’t be it. Sounds like it should be properly connected because he mentions that the motors twitch.

Drive motors will be turned off after a tenth of a second by the Motor Safety feature if you don’t give them a command. You can disable the safeties for the duration of Autonomous (remember to turn them back on in Teleop), or you can continuously set their values in a loop.

BTW, I always thought motor safety is to safe guard buggy code from losing control of the robot. But then I think about it, even with motor safety, buggy code can still cause the robot to runaway uncontrollably. So the purpose of motor safety is really for safe guarding losing communication with the joystick such that the motors will stop instead of running at the last set speeds. Therefore, that’s why there is no point of turning safety on during Autonomous since there is no joystick involved. Is my assumption correct?

Your first thought is correct. The motor safety code is there to prevent a motor from continuing to run if the program doesn’t keep controlling it. There’s a separate system watchdog that shuts down all robot outputs if communication is lost.