Class Mode

java.lang.Object
com.crossbotics.ftchelper.robot.Mode
All Implemented Interfaces:
Toggleable

public final class Mode extends Object implements Toggleable
A rule a module follows every loop while it is on: a turret following the target, a launcher setting its speed from the distance. A button switches it (g2.back.toggle(robot.turret.followMode())); an action or an autonomous can too (robot.turret.followMode().on()).

Modes are for "always" rules; an Action is for steps that end. Docs: docs/reference/robot-java.md (section "Modes")

  • Method Details

    • wasRefused

      public boolean wasRefused()
      True if the last try to switch it on was refused (whyRefused() says why).
    • whyRefused

      public String whyRefused()
      Why it could not be switched on, e.g. "no goal in view" ("" if it could).
    • on

      public void on()
      Switches it on (from code: never refused).
    • off

      public void off()
      Switches it off.
    • toggle

      public void toggle()
      On if off, off if on.
      Specified by:
      toggle in interface Toggleable
    • isOn

      public boolean isOn()
      True while on.
    • name

      public String name()
      E.g. "Turret follow".