NextRobot
NextRobot is the root of your robot.
It’s where you declare the mechanisms that make up your robot,
and it’s automatically discovered and shared across every one of your NextOpModes,
so you never construct or register it yourself.
interface NextRobot { fun periodic() {} val mechanisms: Set<Mechanism> get() = emptySet()}public interface NextRobot { default void periodic() {} default Set<Mechanism> getMechanisms() { return Collections.emptySet(); }}mechanisms
Section titled “mechanisms”The set of Mechanisms that make up your robot.
Every loop,
NextFTC calls periodic() on each mechanism in this set for you.
periodic()
Section titled “periodic()”Called once per loop, before any of your mechanisms’ periodic() methods.
Use it for robot-wide logic that doesn’t belong to any single mechanism.
Example
Section titled “Example”class MyRobot : NextRobot { val claw = Claw() val arm = Arm()
override val mechanisms = setOf(claw, arm)}public class MyRobot implements NextRobot { Claw claw = new Claw(); Arm arm = new Arm();
@Override public Set<Mechanism> getMechanisms() { return Set.of(claw, arm); }}Discovery
Section titled “Discovery”You don’t construct your NextRobot yourself,
and you don’t register it anywhere — NextFTC finds it for you.
Give your implementing class a public no-arg constructor (the recommended approach in both Kotlin and Java) and it will be discovered automatically and made available to your NextOpModes.
Exactly one NextRobot implementation should exist in your project.
See NextFTC robot project structure for the full details of how this discovery works.

