2022 Hyperion Rewrite  0.1.0
Java rewrite of the Titanium Titans (FRC Team #4467)'s 2022 robot, Hyperion
org.titaniumtitans.frc2022.subsystems.DriveSubsystem Class Reference
Inheritance diagram for org.titaniumtitans.frc2022.subsystems.DriveSubsystem:

Public Member Functions

 DriveSubsystem ()
 
void periodic ()
 
Pose2d getPose ()
 
void resetOdometry (Pose2d pose)
 
void resetGyro ()
 
void drive (double xSpeed, double ySpeed, double rot)
 
void resetEncoders ()
 
void zeroHeading ()
 
double getHeading ()
 
double getTurnRate ()
 
void changeDriveMode ()
 
void setTestState (double angle)
 
SwerveModuleState createTestState (double angle)
 
void updateEncoderOffset (double[] angles)
 

Public Attributes

boolean fieldRelative = false
 

Constructor & Destructor Documentation

◆ DriveSubsystem()

org.titaniumtitans.frc2022.subsystems.DriveSubsystem.DriveSubsystem ( )

Creates a new DriveSubsystem.

Member Function Documentation

◆ drive()

void org.titaniumtitans.frc2022.subsystems.DriveSubsystem.drive ( double  xSpeed,
double  ySpeed,
double  rot 
)

Method to drive the robot using joystick info.

Parameters
xSpeedSpeed of the robot in the x direction (forward).
ySpeedSpeed of the robot in the y direction (sideways).
rotAngular rate of the robot.

◆ getHeading()

double org.titaniumtitans.frc2022.subsystems.DriveSubsystem.getHeading ( )

Returns the heading of the robot.

Returns
the robot's heading in degrees, from -180 to 180

◆ getPose()

Pose2d org.titaniumtitans.frc2022.subsystems.DriveSubsystem.getPose ( )

Returns the currently-estimated pose of the robot.

Returns
The pose.

◆ getTurnRate()

double org.titaniumtitans.frc2022.subsystems.DriveSubsystem.getTurnRate ( )

Returns the turn rate of the robot.

Returns
The turn rate of the robot, in degrees per second

◆ resetEncoders()

void org.titaniumtitans.frc2022.subsystems.DriveSubsystem.resetEncoders ( )

Resets the drive encoders to currently read a position of 0.

◆ resetOdometry()

void org.titaniumtitans.frc2022.subsystems.DriveSubsystem.resetOdometry ( Pose2d  pose)

Resets the odometry to the specified pose.

Parameters
poseThe pose to which to set the odometry.

◆ updateEncoderOffset()

void org.titaniumtitans.frc2022.subsystems.DriveSubsystem.updateEncoderOffset ( double[]  angles)

Updates the magnetic offset of the the absolute encoder

Parameters
anglesThe angle offset in degrees of the encoder

◆ zeroHeading()

void org.titaniumtitans.frc2022.subsystems.DriveSubsystem.zeroHeading ( )

Zeroes the heading of the robot.


The documentation for this class was generated from the following file: