Session 2.1 “Timed Robot” Template
Bare minimum driving XRP Robot (blank template for Robot.java):
package frc.robot;
import edu.wpi.first.wpilibj.TimedRobot;
/** The methods in this class are called automatically corresponding to each mode, as described in the TimedRobot documentation. */
public class Robot extends TimedRobot {
/** This function is run when the robot is first started up and should be used for any initialization code. */
public Robot() {}
/** This function is called once when teleop is enabled. */
@Override
public void teleopInit() {}
/** This function is called periodically during operator control. */
@Override
public void teleopPeriodic() {}
/** This function is called once when the robot is disabled. */
@Override
public void disabledInit() {}
/** This function is called periodically when disabled. */
@Override
public void disabledPeriodic() {}
}
To get into a good spot to use the template, the following is the recommended approach:
- Create a new XRP Timed Template project
- Delete the default XRPDrivetrain class
- Open the Robot.java file, delete all contents, and paste the above code in place of it
This approach is needed because the XRP libraries are not a part of the regular VendorDeps that you can install in a normal blank FRC project. This is one of the shortest paths to a blank project with the correct libraries for XRPMotor, XRPServo, etc to be available within the project.
From there we can walk through the build-out of a simple single-file robot program (no autonomous, etc.)
See the next section (if unlocked) for the completed example.
Published @ June 4, 2025 1:32 am