Announcement

Collapse
No announcement yet.

Iterative opmode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Alec
    replied
    Originally posted by FTC12676 View Post
    ... For running commands we need to call scheduler in loop so that it can keep executing commands ...
    The iterative opmode is always in one of two loops, either the init_loop() or the play_loop(). Is this not sufficient?

    Leave a comment:


  • FTC12676
    replied
    That is an option but want to avoid as much as possible as my team is still learning

    Leave a comment:


  • Alec
    replied
    You have the option to create worker threads or a thread pool. Make sure your threads terminate before or during stop().

    Leave a comment:


  • FTC12676
    replied
    Thanks so this will not work for us. Will explore other options

    Leave a comment:


  • Alec
    replied
    From the BasicOpMode_Iterative.java sample:

    public void init() - runs ONCE when driver hits INIT

    public void init_loop() - runs REPEATEDLY after init(), but before driver hits PLAY

    public void start() - runs ONCE when driver hits PLAY

    public void loop() - runs REPEATEDLY after start(), but before driver hits STOP

    public void stop() - runs ONCE when driver hits STOP

    Leave a comment:


  • FTC12676
    started a topic Iterative opmode

    Iterative opmode

    we have command based programming implemented just like FRC. For running commands we need to call scheduler in loop so that it can keep executing commands. In autonomous it is challenging as we have commands scheduled one after another in a linear fashion based on specific conditions like VuMarks or mineral detection. So question for gurus here - in iterative op mode start () runs once after player hits start and loop() runs continuously till player hits stop. Does start and and loop runs at same time or loop starts after start() finishes. Also what is time-out for start and loop?
Working...
X