View Single Post
  #5   Spotlight this post!  
Unread 10-02-2017, 21:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,766
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: So apparently flat sequence structures don't work well in Teleop.

Quote:
I just didn't expect the flat sequence structure to kill Teleop
That was what I thought. It really isn't the flat sequence, but what is in it.

The tele function is effectively a callback. It is called eery 20 milliseconds/fifty times per second. Your teleOp code therefore needs to respond to the joystick inputs and finish in about 20ms or it will be too busy to process the next one. The events aren't queued or you would have the robot running delayed joystick info - acting laggy and generally very difficult to control.

So if you put code into tele that doesn't return, that doesn't work very well. If it takes seconds to return, then tele is delayed for that time. It is the code inside the sequence that delays, not the sequence itself.

The sequence simply runs one frame after the other. When if finishes, the other code downstream runs. When tele is finished, it waits for the next joystick input.

Greg McKaskle
Reply With Quote