Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Tank Drive in Autonomous (http://www.chiefdelphi.com/forums/showthread.php?t=103417)

dmitch 20-02-2012 18:04

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

drive->Drive(x,y);

(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?

DavisC 20-02-2012 18:17

Re: Tank Drive in Autonomous
 
I bekieve you are refering to the part like below:
Code:

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).

dmitch 20-02-2012 18:28

Re: Tank Drive in Autonomous
 
When i try that the motors sort of give a little twitch and then do nothing.

teh_lol 20-02-2012 18:44

Re: Tank Drive in Autonomous
 
is it humming like the motors are running?

dmitch 20-02-2012 18:54

Re: Tank Drive in Autonomous
 
No, and the lights on the jaguars aren't lit up either.

mikets 20-02-2012 18:58

Re: Tank Drive in Autonomous
 
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?

dmitch 20-02-2012 19:02

Re: Tank Drive in Autonomous
 
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...

teh_lol 20-02-2012 19:22

Re: Tank Drive in Autonomous
 
:/ sorry I don't know what that means either

DavisC 20-02-2012 19:47

Re: Tank Drive in Autonomous
 
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?

mikets 20-02-2012 19:56

Re: Tank Drive in Autonomous
 
Quote:

Originally Posted by dmitch (Post 1131162)
No, and the lights on the jaguars aren't lit up either.

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.

DavisC 20-02-2012 20:06

Re: Tank Drive in Autonomous
 
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.

Alan Anderson 21-02-2012 00:51

Re: Tank Drive in Autonomous
 
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.

mikets 21-02-2012 02:36

Re: Tank Drive in Autonomous
 
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?

Alan Anderson 21-02-2012 08:01

Re: Tank Drive in Autonomous
 
Quote:

Originally Posted by mikets (Post 1131464)
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.


All times are GMT -5. The time now is 12:23.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi