Package frc.robot
Class RobotContainer
java.lang.Object
frc.robot.RobotContainer
Central wiring hub for subsystems, commands, and driver inputs.
-
Constructor Summary
ConstructorsConstructorDescriptionBuilds the robot container and wires subsystems, command factories, and bindings. -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.wpilibj2.command.CommandReturns the command to run during autonomous mode.voidperiodic()Runs once per robot loop to perform non-subsystem periodic checks.voidresetPose(edu.wpi.first.math.geometry.Pose2d pose) Resets the robot pose for both the drivebase and the robot state estimator.voidResets the robot pose using the latest vision measurement from the cameras.
-
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.
-