Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Java Autonomous (http://www.chiefdelphi.com/forums/showthread.php?t=102539)

goonsquad3604 11-02-2012 12:45

Java Autonomous
 
We are team 3604 and we program in java. Are autonomous method for interativeRobot is having issues. Any ideas?

public void autonomousContinuous()
{
getWatchdog().setEnabled(true);
getWatchdog().feed();


compressor.start();
in.set(true);
out.set(false);
in.set(false);

getWatchdog().feed();
Timer.delay(4);

getWatchdog().feed();
out.set(true);
out.set(false);

getWatchdog().feed();
Timer.delay(2);

getWatchdog().feed();
in.set(true);
in.set(false);

getWatchdog().feed();
Timer.delay(4);

getWatchdog().feed();
out.set(true);
out.set(false);

getWatchdog().feed();
Timer.delay(2);

getWatchdog().feed();
in.set(true);
in.set(false);
getWatchdog().feed();
}

theprgramerdude 11-02-2012 13:25

Re: Java Autonomous
 
Um.... this is impossible to debug without the rest of the program. One issue, though, is that you're not feeding the watchdog enough. You're also doing absolutely nothing with what I believe is the solenoids... Yeah, you're doing absolutely nothing in your program at all, aside from trying to start the compressor -> which will fail, because you're not feeding the watchdog enough.

Chris27 11-02-2012 14:37

Re: Java Autonomous
 
For one, your going about overriding autonomousContinuous() incorrectly. This is a function that will be executed at a fixed interval. I forgot what the exact interval is, but it is around ~50ms. It makes no sense to call Timer.delay or any function that blocks (i.e. waits for a long time for the function to return before moving on) inside autonomousContinuous() as this function should return quickly (no longer then the interval time).


All times are GMT -5. The time now is 01:21.

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