|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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(); } |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
||||
|
||||
|
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).
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|