Move robot base classes from opmode to framework (#8344)

Having these in opmode will be confusing to users when opmodes are added.
This commit is contained in:
Peter Johnson
2025-11-08 15:08:38 -08:00
committed by GitHub
parent aeedfa588c
commit 18efd1e534
275 changed files with 285 additions and 285 deletions

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.addressableled;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -7,10 +7,10 @@ package org.wpilib.examples.addressableled;
import static org.wpilib.units.Units.Meters;
import static org.wpilib.units.Units.MetersPerSecond;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.led.AddressableLED;
import org.wpilib.hardware.led.AddressableLEDBuffer;
import org.wpilib.hardware.led.LEDPattern;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.units.measure.Distance;
public class Robot extends TimedRobot {

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.apriltagsvision;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -9,12 +9,12 @@ import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.geometry.Rotation3d;
import org.wpilib.math.geometry.Transform3d;
import org.wpilib.networktables.IntegerArrayPublisher;
import org.wpilib.networktables.NetworkTable;
import org.wpilib.networktables.NetworkTableInstance;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.vision.apriltag.AprilTagDetection;
import org.wpilib.vision.apriltag.AprilTagDetector;
import org.wpilib.vision.apriltag.AprilTagPoseEstimator;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.arcadedrive;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,8 +6,8 @@ package org.wpilib.examples.arcadedrive;
import org.wpilib.drive.DifferentialDrive;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.util.sendable.SendableRegistry;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.arcadedrivexboxcontroller;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,8 +6,8 @@ package org.wpilib.examples.arcadedrivexboxcontroller;
import org.wpilib.drive.DifferentialDrive;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.util.sendable.SendableRegistry;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.armsimulation;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,7 +6,7 @@ package org.wpilib.examples.armsimulation;
import org.wpilib.driverstation.Joystick;
import org.wpilib.examples.armsimulation.subsystems.Arm;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
/** This is a sample program to demonstrate the use of arm simulation with existing code. */
public class Robot extends TimedRobot {

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.canpdp;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -4,8 +4,8 @@
package org.wpilib.examples.canpdp;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.power.PowerDistribution;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.smartdashboard.SmartDashboard;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.differentialdrivebot;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,8 +5,8 @@
package org.wpilib.examples.differentialdrivebot;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.filter.SlewRateLimiter;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private final XboxController m_controller = new XboxController(0);

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.differentialdriveposeestimator;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,10 +5,10 @@
package org.wpilib.examples.differentialdriveposeestimator;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.filter.SlewRateLimiter;
import org.wpilib.networktables.DoubleArrayTopic;
import org.wpilib.networktables.NetworkTableInstance;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private final NetworkTableInstance m_inst = NetworkTableInstance.getDefault();

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.digitalcommunication;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,8 +6,8 @@ package org.wpilib.examples.digitalcommunication;
import java.util.Optional;
import org.wpilib.driverstation.DriverStation;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.discrete.DigitalOutput;
import org.wpilib.opmode.TimedRobot;
/**
* This is a sample program demonstrating how to communicate to a light controller from the robot

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.drivedistanceoffboard;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,7 +6,7 @@ package org.wpilib.examples.drivedistanceoffboard;
import org.wpilib.command2.Command;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
/**
* The methods in this class are called automatically corresponding to each mode, as described in

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.dutycycleencoder;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -4,9 +4,9 @@
package org.wpilib.examples.dutycycleencoder;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.rotation.DutyCycleEncoder;
import org.wpilib.math.util.MathUtil;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.smartdashboard.SmartDashboard;
/** This example shows how to use a duty cycle encoder for devices such as an arm or elevator. */

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.dutycycleinput;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -4,8 +4,8 @@
package org.wpilib.examples.dutycycleinput;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.rotation.DutyCycle;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.smartdashboard.SmartDashboard;
public class Robot extends TimedRobot {

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.elevatorexponentialprofile;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,9 +5,9 @@
package org.wpilib.examples.elevatorexponentialprofile;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.controller.SimpleMotorFeedforward;
import org.wpilib.math.trajectory.ExponentialProfile;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private static double kDt = 0.02;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.elevatorexponentialsimulation;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,7 +6,7 @@ package org.wpilib.examples.elevatorexponentialsimulation;
import org.wpilib.driverstation.Joystick;
import org.wpilib.examples.elevatorexponentialsimulation.subsystems.Elevator;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
/** This is a sample program to demonstrate the use of elevator simulation. */
public class Robot extends TimedRobot {

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.elevatorprofiledpid;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,12 +5,12 @@
package org.wpilib.examples.elevatorprofiledpid;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.math.controller.ElevatorFeedforward;
import org.wpilib.math.controller.ProfiledPIDController;
import org.wpilib.math.trajectory.TrapezoidProfile;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private static double kDt = 0.02;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.elevatorsimulation;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,7 +6,7 @@ package org.wpilib.examples.elevatorsimulation;
import org.wpilib.driverstation.Joystick;
import org.wpilib.examples.elevatorsimulation.subsystems.Elevator;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
/** This is a sample program to demonstrate the use of elevator simulation. */
public class Robot extends TimedRobot {

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.elevatortrapezoidprofile;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,9 +5,9 @@
package org.wpilib.examples.elevatortrapezoidprofile;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.controller.SimpleMotorFeedforward;
import org.wpilib.math.trajectory.TrapezoidProfile;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private static double kDt = 0.02;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.encoder;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -4,9 +4,9 @@
package org.wpilib.examples.encoder;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.discrete.CounterBase;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.smartdashboard.SmartDashboard;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.eventloop;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -7,11 +7,11 @@ package org.wpilib.examples.eventloop;
import org.wpilib.driverstation.Joystick;
import org.wpilib.event.BooleanEvent;
import org.wpilib.event.EventLoop;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.math.controller.PIDController;
import org.wpilib.math.controller.SimpleMotorFeedforward;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
public static final double SHOT_VELOCITY = 200; // rpm

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.flywheelbangbangcontroller;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,6 +5,7 @@
package org.wpilib.examples.flywheelbangbangcontroller;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.math.controller.BangBangController;
@@ -14,7 +15,6 @@ import org.wpilib.math.system.LinearSystem;
import org.wpilib.math.system.plant.DCMotor;
import org.wpilib.math.system.plant.LinearSystemId;
import org.wpilib.math.util.Units;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.simulation.EncoderSim;
import org.wpilib.simulation.FlywheelSim;
import org.wpilib.smartdashboard.SmartDashboard;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.gettingstarted;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,8 +6,8 @@ package org.wpilib.examples.gettingstarted;
import org.wpilib.drive.DifferentialDrive;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.system.Timer;
import org.wpilib.util.sendable.SendableRegistry;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.gyro;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,9 +6,9 @@ package org.wpilib.examples.gyro;
import org.wpilib.drive.DifferentialDrive;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.imu.OnboardIMU;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.util.sendable.SendableRegistry;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.gyromecanum;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,9 +6,9 @@ package org.wpilib.examples.gyromecanum;
import org.wpilib.drive.MecanumDrive;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.imu.OnboardIMU;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.util.sendable.SendableRegistry;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.hatchbotinlined;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -7,7 +7,7 @@ package org.wpilib.examples.hatchbotinlined;
import org.wpilib.command2.Command;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.driverstation.DriverStation;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
import org.wpilib.system.DataLogManager;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.hatchbottraditional;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -7,7 +7,7 @@ package org.wpilib.examples.hatchbottraditional;
import org.wpilib.command2.Command;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.driverstation.DriverStation;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
import org.wpilib.system.DataLogManager;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.hidrumble;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,7 +6,7 @@ package org.wpilib.examples.hidrumble;
import org.wpilib.driverstation.GenericHID.RumbleType;
import org.wpilib.driverstation.XboxController;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
/** This is a demo program showing the use of GenericHID's rumble feature. */
public class Robot extends TimedRobot {

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.httpcamera;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -8,7 +8,7 @@ import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
import org.wpilib.vision.camera.CvSink;
import org.wpilib.vision.camera.CvSource;
import org.wpilib.vision.camera.HttpCamera;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.i2ccommunication;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,9 +6,9 @@ package org.wpilib.examples.i2ccommunication;
import java.util.Optional;
import org.wpilib.driverstation.DriverStation;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.bus.I2C;
import org.wpilib.hardware.bus.I2C.Port;
import org.wpilib.opmode.TimedRobot;
/**
* This is a sample program demonstrating how to communicate to a light controller from the robot

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.intermediatevision;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -8,7 +8,7 @@ import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
import org.wpilib.vision.camera.CvSink;
import org.wpilib.vision.camera.CvSource;
import org.wpilib.vision.camera.UsbCamera;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.mecanumbot;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,8 +5,8 @@
package org.wpilib.examples.mecanumbot;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.filter.SlewRateLimiter;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private final XboxController m_controller = new XboxController(0);

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.mecanumdrive;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,8 +6,8 @@ package org.wpilib.examples.mecanumdrive;
import org.wpilib.drive.MecanumDrive;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.util.sendable.SendableRegistry;
/** This is a demo program showing how to use Mecanum control with the MecanumDrive class. */

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.mecanumdriveposeestimator;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,8 +5,8 @@
package org.wpilib.examples.mecanumdriveposeestimator;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.filter.SlewRateLimiter;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private final XboxController m_controller = new XboxController(0);

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.mechanism2d;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,10 +5,10 @@
package org.wpilib.examples.mechanism2d;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.AnalogPotentiometer;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.smartdashboard.Mechanism2d;
import org.wpilib.smartdashboard.MechanismLigament2d;
import org.wpilib.smartdashboard.MechanismRoot2d;

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.motorcontrol;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,9 +5,9 @@
package org.wpilib.examples.motorcontrol;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.smartdashboard.SmartDashboard;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.potentiometerpid;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,10 +5,10 @@
package org.wpilib.examples.potentiometerpid;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.AnalogPotentiometer;
import org.wpilib.math.controller.PIDController;
import org.wpilib.opmode.TimedRobot;
/**
* This is a sample program to demonstrate how to use a soft potentiometer and a PID controller to

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.quickvision;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.quickvision;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
import org.wpilib.vision.stream.CameraServer;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.rapidreactcommandbot;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -8,7 +8,7 @@ import org.wpilib.command2.Command;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.epilogue.Epilogue;
import org.wpilib.epilogue.Logged;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
import org.wpilib.system.DataLogManager;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.romireference;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,7 +6,7 @@ package org.wpilib.examples.romireference;
import org.wpilib.command2.Command;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
/**
* The methods in this class are called automatically corresponding to each mode, as described in

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.selectcommand;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,7 +6,7 @@ package org.wpilib.examples.selectcommand;
import org.wpilib.command2.Command;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
/**
* The methods in this class are called automatically corresponding to each mode, as described in

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.simpledifferentialdrivesimulation;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,6 +6,7 @@ package org.wpilib.examples.simpledifferentialdrivesimulation;
import java.util.List;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.controller.LTVUnicycleController;
import org.wpilib.math.filter.SlewRateLimiter;
import org.wpilib.math.geometry.Pose2d;
@@ -14,7 +15,6 @@ import org.wpilib.math.kinematics.ChassisSpeeds;
import org.wpilib.math.trajectory.Trajectory;
import org.wpilib.math.trajectory.TrajectoryConfig;
import org.wpilib.math.trajectory.TrajectoryGenerator;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.system.Timer;
public class Robot extends TimedRobot {

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.solenoid;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,11 +5,11 @@
package org.wpilib.examples.solenoid;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.pneumatic.Compressor;
import org.wpilib.hardware.pneumatic.DoubleSolenoid;
import org.wpilib.hardware.pneumatic.PneumaticsModuleType;
import org.wpilib.hardware.pneumatic.Solenoid;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.smartdashboard.SmartDashboard;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.statespacearm;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,6 +5,7 @@
package org.wpilib.examples.statespacearm;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.math.controller.LinearQuadraticRegulator;
@@ -19,7 +20,6 @@ import org.wpilib.math.system.plant.LinearSystemId;
import org.wpilib.math.trajectory.TrapezoidProfile;
import org.wpilib.math.util.Nat;
import org.wpilib.math.util.Units;
import org.wpilib.opmode.TimedRobot;
/**
* This is a sample program to demonstrate how to use a state-space controller to control an arm.

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.statespaceelevator;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,6 +5,7 @@
package org.wpilib.examples.statespaceelevator;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.math.controller.LinearQuadraticRegulator;
@@ -19,7 +20,6 @@ import org.wpilib.math.system.plant.LinearSystemId;
import org.wpilib.math.trajectory.TrapezoidProfile;
import org.wpilib.math.util.Nat;
import org.wpilib.math.util.Units;
import org.wpilib.opmode.TimedRobot;
/**
* This is a sample program to demonstrate how to use a state-space controller to control an

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.statespaceflywheel;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,6 +5,7 @@
package org.wpilib.examples.statespaceflywheel;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.math.controller.LinearQuadraticRegulator;
@@ -17,7 +18,6 @@ import org.wpilib.math.system.plant.DCMotor;
import org.wpilib.math.system.plant.LinearSystemId;
import org.wpilib.math.util.Nat;
import org.wpilib.math.util.Units;
import org.wpilib.opmode.TimedRobot;
/**
* This is a sample program to demonstrate how to use a state-space controller to control a

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.statespaceflywheelsysid;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,6 +5,7 @@
package org.wpilib.examples.statespaceflywheelsysid;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.hardware.rotation.Encoder;
import org.wpilib.math.controller.LinearQuadraticRegulator;
@@ -16,7 +17,6 @@ import org.wpilib.math.system.LinearSystemLoop;
import org.wpilib.math.system.plant.LinearSystemId;
import org.wpilib.math.util.Nat;
import org.wpilib.math.util.Units;
import org.wpilib.opmode.TimedRobot;
/**
* This is a sample program to demonstrate how to use a state-space controller to control a

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.swervebot;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,9 +5,9 @@
package org.wpilib.examples.swervebot;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.filter.SlewRateLimiter;
import org.wpilib.math.util.MathUtil;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private final XboxController m_controller = new XboxController(0);

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.swervedriveposeestimator;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -5,8 +5,8 @@
package org.wpilib.examples.swervedriveposeestimator;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.math.filter.SlewRateLimiter;
import org.wpilib.opmode.TimedRobot;
public class Robot extends TimedRobot {
private final XboxController m_controller = new XboxController(0);

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.sysidroutine;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,7 +6,7 @@ package org.wpilib.examples.sysidroutine;
import org.wpilib.command2.Command;
import org.wpilib.command2.CommandScheduler;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.framework.TimedRobot;
/**
* The methods in this class are called automatically corresponding to each mode, as described in

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.tankdrive;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,8 +6,8 @@ package org.wpilib.examples.tankdrive;
import org.wpilib.drive.DifferentialDrive;
import org.wpilib.driverstation.Joystick;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.util.sendable.SendableRegistry;
/**

View File

@@ -4,7 +4,7 @@
package org.wpilib.examples.tankdrivexboxcontroller;
import org.wpilib.opmode.RobotBase;
import org.wpilib.framework.RobotBase;
/**
* Do NOT add any static variables to this class, or any initialization at all. Unless you know what

View File

@@ -6,8 +6,8 @@ package org.wpilib.examples.tankdrivexboxcontroller;
import org.wpilib.drive.DifferentialDrive;
import org.wpilib.driverstation.XboxController;
import org.wpilib.framework.TimedRobot;
import org.wpilib.hardware.motor.PWMSparkMax;
import org.wpilib.opmode.TimedRobot;
import org.wpilib.util.sendable.SendableRegistry;
/**

Some files were not shown because too many files have changed in this diff Show More