Class DriveTrainSimIO

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

public class DriveTrainSimIO extends DriveTrain
  • Constructor Details

    • DriveTrainSimIO

      protected DriveTrainSimIO()
  • Method Details

    • 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.
    • getGyroRate

      public double getGyroRate()
      Description copied from class: DriveTrain
      Returns the rate at which the gyro is spinning.
      Specified by:
      getGyroRate in class DriveTrain
      Returns:
      The gyro rate in degrees per second.
    • resetGyroAngle

      public void resetGyroAngle()
      Description copied from class: DriveTrain
      Resets the gyroscope angle to 0.
      Specified by:
      resetGyroAngle in class DriveTrain
    • 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 - The port number of the drive motor.
      steer_port - The port number of the steer motor.
      sensor_port - The port number of the module's CANcoder.
      Returns:
      The constructed SwerveModule object.
    • periodic

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