Package com.crossbotics.ftchelper.robot
Class Mode
java.lang.Object
com.crossbotics.ftchelper.robot.Mode
- All Implemented Interfaces:
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 Summary
Modifier and TypeMethodDescriptionbooleanisOn()True while on.name()E.g.voidoff()Switches it off.voidon()Switches it on (from code: never refused).voidtoggle()On if off, off if on.booleanTrue if the last try to switch it on was refused (whyRefused()says why).Why it could not be switched on, e.g.
-
Method Details
-
wasRefused
public boolean wasRefused()True if the last try to switch it on was refused (whyRefused()says why). -
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:
togglein interfaceToggleable
-
isOn
public boolean isOn()True while on. -
name
E.g. "Turret follow".
-