[developerRobot] Add an OpModeRobot instance to DeveloperRobot (#8891)

You can switch to it just by switching Main.java
This commit is contained in:
Thad House
2026-05-14 21:48:09 -07:00
committed by GitHub
parent 97c0b0c40a
commit ffd36eb091
3 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package wpilib.robot;
import org.wpilib.opmode.Autonomous;
import org.wpilib.opmode.PeriodicOpMode;
@Autonomous
public class DefaultAutoMode extends PeriodicOpMode {
@SuppressWarnings("unused")
private final OpRobot robot;
public DefaultAutoMode(OpRobot robot) {
this.robot = robot;
}
@Override
public void start() {}
@Override
public void periodic() {}
}

View File

@@ -0,0 +1,26 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package wpilib.robot;
import org.wpilib.driverstation.DefaultUserControls;
import org.wpilib.opmode.PeriodicOpMode;
import org.wpilib.opmode.Teleop;
@Teleop
public class DefaultTeleMode extends PeriodicOpMode {
@SuppressWarnings("unused")
private final OpRobot robot;
@SuppressWarnings("unused")
private final DefaultUserControls userControls;
public DefaultTeleMode(OpRobot robot, DefaultUserControls userControls) {
this.robot = robot;
this.userControls = userControls;
}
@Override
public void periodic() {}
}

View File

@@ -0,0 +1,16 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package wpilib.robot;
import org.wpilib.driverstation.DefaultUserControls;
import org.wpilib.driverstation.UserControlsInstance;
import org.wpilib.framework.OpModeRobot;
/** This is a dev program for testing OpModeRobot. */
@UserControlsInstance(DefaultUserControls.class)
public class OpRobot extends OpModeRobot {
/** Called once at the beginning of the robot program. */
public OpRobot() {}
}