Package frc.robot

Class RobotContainer

java.lang.Object
frc.robot.RobotContainer

public class RobotContainer extends Object
Central wiring hub for subsystems, commands, and driver inputs.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Builds the robot container and wires subsystems, command factories, and bindings.
  • Method Summary

    Modifier and Type
    Method
    Description
    edu.wpi.first.wpilibj2.command.Command
    Returns the command to run during autonomous mode.
    void
    Runs once per robot loop to perform non-subsystem periodic checks.
    void
    resetPose(edu.wpi.first.math.geometry.Pose2d pose)
    Resets the robot pose for both the drivebase and the robot state estimator.
    void
    Resets the robot pose using the latest vision measurement from the cameras.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RobotContainer

      public RobotContainer()
      Builds the robot container and wires subsystems, command factories, and bindings.
  • Method Details

    • resetPose

      public void resetPose(edu.wpi.first.math.geometry.Pose2d pose)
      Resets the robot pose for both the drivebase and the robot state estimator.

      Use this in simulation or autonomous init to place the robot at a known field location.

      Parameters:
      pose - desired starting pose in meters and radians
    • resetPoseFromVision

      public void resetPoseFromVision()
      Resets the robot pose using the latest vision measurement from the cameras.

      Call this at match start so the pose estimator begins from the camera-derived position rather than a default origin. If no vision measurement is available yet, the reset is safely skipped by the underlying subsystem.

    • getAutonomousCommand

      public edu.wpi.first.wpilibj2.command.Command getAutonomousCommand()
      Returns the command to run during autonomous mode.

      Update this method to swap between auto routines.

      Returns:
      command scheduled at the start of autonomous
    • periodic

      public void periodic()
      Runs once per robot loop to perform non-subsystem periodic checks.

      Call from Robot.robotPeriodic() after the environment snapshot is refreshed.