Skip to content

base robot program

Ishan edited this page Feb 6, 2022 · 2 revisions

Base Robot Program

After creating a WPILib command-based robot program, and syncing the vendor dependencies, there are some changes that need to be made. The Main.java file can be left alone, but the Robot.java file should be changed to look something like this:

package frc.robot;
import com.lightningrobotics.common.LightningRobot;

public class Robot extends LightningRobot {
  public Robot() {
    super(new RobotContainer());
  }
}

Note that this class now extends LightningRobot and not TimedRobot. The LightningRobot wrapper handles a lot of the behavior that would need to be implemented.

Additionally, the RobotContainer.java can inherit from LightningContainer, which provides a nice template to be filled in.

package frc.robot;

public class VoidContainer extends LightningContainer {
  // Declare Subsystems/Controllers Here
  @Override
  protected void configureAutonomousCommands() { }
  @Override
  protected void configureAutonomousPaths() { }
  @Override
  protected void configureButtonBindings() { }
  @Override
  protected void configureDefaultCommands() { }
  @Override
  protected void configureFaultCodes() { }
  @Override
  protected void configureFaultMonitors() { }
  @Override
  protected void configureSystemTests() { }
  @Override
  public LightningDrivetrain getDrivetrain() { return null; }
  @Override
  protected void initializeDashboardCommands() { }
  @Override
  protected void releaseDefaultCommands() { }
}

Now all that's left to do is implement different subsystems and connect them all together in this class.

Clone this wiki locally