Class DriveTrainRealIO

java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.DriveTrain.DriveTrain
frc.robot.subsystems.DriveTrain.DriveTrainRealIO
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj2.command.Subsystem

public class DriveTrainRealIO extends DriveTrain
  • Constructor Details

    • DriveTrainRealIO

      public DriveTrainRealIO()
  • Method Details

    • initializeModule

      public SwerveModule initializeModule(int drive_port, int steer_port, int sensor_port)
      Description copied from class: DriveTrain
      Creates either a SwerveModuleRealIO or SwerveModuleSimIO object.
      Specified by:
      initializeModule in class DriveTrain
      Parameters:
      drive_port - port number of the drive motor
      steer_port - port number of the steer motor
      sensor_port - port number of the module's CANcoder
      Returns:
      The constructed SwerveModule object
    • getGyroAngle

      public edu.wpi.first.math.geometry.Rotation2d getGyroAngle()
      Description copied from class: DriveTrain
      Gets either the measured yaw from the AHRS or the calculated angle from the simulation. Forward is 0, CCW is positive.
      Specified by:
      getGyroAngle in class DriveTrain
      Returns:
      The robot yaw.
    • periodic

      public void periodic()
      Specified by:
      periodic in interface edu.wpi.first.wpilibj2.command.Subsystem
      Overrides:
      periodic in class DriveTrain
    • simulationPeriodic

      public void simulationPeriodic()
      Specified by:
      simulationPeriodic in interface edu.wpi.first.wpilibj2.command.Subsystem
      Overrides:
      simulationPeriodic in class DriveTrain