Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Five Second Delay at Beginning of TeleOp (http://www.chiefdelphi.com/forums/showthread.php?t=136304)

CorruptedArk 01-04-2015 17:39

Five Second Delay at Beginning of TeleOp
 
Our team's robot has this issue that I haven't been able to figure out. At the beginning of teleop, we consistently have to wait around five seconds for the robot to start responding to user input. I've looked over my code multiple times, looked online for solutions, and I'm not sure what is causing it. I think it might be caused by the initialization of multiple threads, but similar code was implemented last season without this problem.

I use the SampleRobot template for extensive control over operation.

Here's a link to it on Github:https://github.com/CorruptedArk/MTR-...team1528/robot

Robot is the main class, and we've been using autonomous0() for autonomous and teleOpLoop0() for teleop.

Any insight on what could be causing this would be greatly appreciated.

Mark McLeod 01-04-2015 18:15

Re: Five Second Delay at Beginning of TeleOp
 
Do you initialize any cameras at the start of Teleop?
That sucks up about 5-7 seconds.

Jared Russell 01-04-2015 18:30

Re: Five Second Delay at Beginning of TeleOp
 
Line 371 of Robot.java

CorruptedArk 01-04-2015 18:56

Re: Five Second Delay at Beginning of TeleOp
 
Quote:

Originally Posted by Mark McLeod (Post 1464974)
Do you initialize any cameras at the start of Teleop?
That sucks up about 5-7 seconds.

I don't initialize any cameras, so that can't be it.

CorruptedArk 01-04-2015 18:58

Re: Five Second Delay at Beginning of TeleOp
 
Quote:

Originally Posted by Jared Russell (Post 1464975)
Line 371 of Robot.java

That could be it. Do they go to disabled before teleOp during a match? I thought it went straight to teleOp from autonomous.

RufflesRidge 01-04-2015 19:00

Re: Five Second Delay at Beginning of TeleOp
 
Quote:

Originally Posted by CorruptedArk (Post 1464987)
That could be it. Do they go to disabled before teleOp during a match? I thought it went straight to teleOp from autonomous.

Here are the mode transitions from the FMS Whitepaper:
Quote:

Autonomous Disable - state prior to match start
Autonomous Enable - Autonomous period
Autonomous Disable - end of Autonomous period
Teleop Disable - end of Autonomous period, prior to start of Teleop period
Teleop Enable - Teleop period
Teleop Disable - end of Teleop/match end

CorruptedArk 01-04-2015 19:08

Re: Five Second Delay at Beginning of TeleOp
 
Quote:

Originally Posted by RufflesRidge (Post 1464988)
Here are the mode transitions from the FMS Whitepaper:

Thanks, I didn't know about that. I think that's the source of our troubles.

mwtidd 03-04-2015 09:19

Re: Five Second Delay at Beginning of TeleOp
 
Quote:

Originally Posted by CorruptedArk (Post 1464990)
Thanks, I didn't know about that. I think that's the source of our troubles.

The Timer.delays are something I've been combating for years now. I really believe the tutorials that utilize it do a disservice in the long term.

Yes, I can acknowledge that it helps teams get up and running quickly, but teaches bad practices, and has the potential to create really confusing scenarios when you start utilizing command based programming.

Here's a post I wrote on it last year...

http://www.chiefdelphi.com/forums/sh...27&postcount=2

I realize that it's late in the season to change how you handle this, but in future seasons please reconsider using Timer.delay for anything other than giving the brain a break.


All times are GMT -5. The time now is 10:49.

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