Swerve

public class Swerve extends SubsystemBase

Properties

Link copied to clipboard
public Pose2d currentPose

Functions

Link copied to clipboard
public void chassisSpeedsDrive(ChassisSpeeds chassisSpeeds)
Drives the robot using chassis speeds.
Link copied to clipboard
public ChassisSpeeds getAutoSpeeds()
Gets the chassis speeds for autonomous driving.
Link copied to clipboard
public double getHeading()
Gets the heading of the robot.
Link copied to clipboard
public static Swerve getInstance()
Returns the Singleton instance of this SwerveSubsystem.
Link copied to clipboard
public Array<SwerveModulePosition> getModulePositions()
Gets the positions of the swerve modules.
Link copied to clipboard
public Array<SwerveModuleState> getModuleStates()
Gets the states of the swerve modules.
Link copied to clipboard
public Rotation2d getPidgeyRotation()
Gets the rotation of the Pigeon2 IMU.
Link copied to clipboard
public double getPidgeyYaw()
Gets the yaw of the Pigeon2 IMU.
Link copied to clipboard
public Pose2d getPose()
Gets the current pose of the robot from the pose estimator.
Link copied to clipboard
public Rotation2d getRotationPidggy()
Gets the rotation of the Pigeon2 IMU for PID control.
Link copied to clipboard
public void newPose(Pose2d pose)
Sets a new pose for the robot.
Link copied to clipboard
public Command pathFindTest()
Link copied to clipboard
public Command pathFindToGoal()
Link copied to clipboard
public void periodic()
This method is called periodically by the scheduler.
Link copied to clipboard
public void resetDrive()
Resets the drive positions of all swerve modules.
Link copied to clipboard
public void resetPidgey()
Resets the Pigeon2 IMU.
Link copied to clipboard
public void setAutoPID()
Sets the PID constants for autonomous driving.
Link copied to clipboard
public void setDriveSpeeds(double forwardSpeed, double leftSpeed, double turnSpeed, boolean isFieldOriented)
Sets the drive speeds for the swerve modules.
Link copied to clipboard
public void setModuleStates(Array<SwerveModuleState> states)
Sets the states of the swerve modules.
Link copied to clipboard
public void setTelePID()
Sets the PID constants for teleoperated driving.
Link copied to clipboard
public void stop()
Stops all swerve modules.
Link copied to clipboard
Link copied to clipboard
public void zeroPose()
Resets the pose of the robot to zero.