Skip to content

Commit

Permalink
made ktlint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
jpothen8 committed Mar 1, 2024
1 parent b992eac commit a2a2cae
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 32 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/frc/team449/control/holonomic/MecanumDrive.kt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ open class MecanumDrive(
companion object {

/** Helper method to create a motor for each wheel */
private fun createCorner(name: String, motorID: Int, inverted: Boolean): CANSparkMax {
private fun createCorner(motorID: Int, inverted: Boolean): CANSparkMax {
return createSparkMax(
motorID,
MecanumConstants.DRIVE_UPR,
Expand All @@ -180,10 +180,10 @@ open class MecanumDrive(
/** Create a new Mecanum Drive from DriveConstants */
fun createMecanum(ahrs: AHRS): MecanumDrive {
return MecanumDrive(
createCorner("frontLeft", MecanumConstants.DRIVE_MOTOR_FL, false),
createCorner("frontRight", MecanumConstants.DRIVE_MOTOR_FR, true),
createCorner("backLeft", MecanumConstants.DRIVE_MOTOR_BL, false),
createCorner("backRight", MecanumConstants.DRIVE_MOTOR_BR, true),
createCorner(MecanumConstants.DRIVE_MOTOR_FL, false),
createCorner(MecanumConstants.DRIVE_MOTOR_FR, true),
createCorner(MecanumConstants.DRIVE_MOTOR_BL, false),
createCorner(MecanumConstants.DRIVE_MOTOR_BR, true),
Translation2d(MecanumConstants.WHEELBASE / 2, MecanumConstants.TRACKWIDTH / 2),
Translation2d(MecanumConstants.WHEELBASE / 2, -MecanumConstants.TRACKWIDTH / 2),
Translation2d(-MecanumConstants.WHEELBASE / 2, MecanumConstants.TRACKWIDTH / 2),
Expand Down
9 changes: 2 additions & 7 deletions src/main/kotlin/frc/team449/control/holonomic/SwerveDrive.kt
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ open class SwerveDrive(
SwerveModule.create(
"FLModule",
makeDrivingMotor(
"FL",
SwerveConstants.DRIVE_MOTOR_FL,
inverted = false
),
Expand All @@ -453,7 +452,7 @@ open class SwerveDrive(
"FL",
frontLeftTurn,
frontLeftTurn.inverted
),
),
driveMotorController(),
turnMotorController(),
driveFeedforward,
Expand All @@ -462,7 +461,6 @@ open class SwerveDrive(
SwerveModule.create(
"FRModule",
makeDrivingMotor(
"FR",
SwerveConstants.DRIVE_MOTOR_FR,
inverted = false
),
Expand All @@ -486,7 +484,6 @@ open class SwerveDrive(
SwerveModule.create(
"BLModule",
makeDrivingMotor(
"BL",
SwerveConstants.DRIVE_MOTOR_BL,
inverted = false
),
Expand All @@ -509,7 +506,6 @@ open class SwerveDrive(
SwerveModule.create(
"BRModule",
makeDrivingMotor(
"BR",
SwerveConstants.DRIVE_MOTOR_BR,
inverted = false
),
Expand Down Expand Up @@ -553,7 +549,6 @@ open class SwerveDrive(

/** Helper to make turning motors for swerve. */
private fun makeDrivingMotor(
name: String,
motorId: Int,
inverted: Boolean
) =
Expand Down Expand Up @@ -582,7 +577,7 @@ open class SwerveDrive(
gearing = 1.0,
unitPerRotation = SwerveConstants.TURN_UPR,
offset = offset,
currentLimit = SwerveConstants.STEERING_CURRENT_LIM
currentLimit = SwerveConstants.STEERING_CURRENT_LIM,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import frc.team449.robot2024.Robot
class RoutineChooser(private val robot: Robot) : SendableChooser<String>() {

fun routineMap(): HashMap<String, Command> {
return hashMapOf(
)
return hashMapOf()
}

init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,27 @@ class ControllerBindings(
private val m_angle = mutable(Radians.of(0.0))
private val m_velocity = mutable(RadiansPerSecond.of(0.0))



val orbitCmd = OrbitAlign(
robot.drive,
robot.driveController.hid,
FieldConstants.SUBWOOFER_POSE
)



private fun robotBindings() {

}
private fun robotBindings() {}

private fun nonRobotBindings() {
// slow drive
driveController.rightBumper().onTrue(
InstantCommand({ robot.drive.maxLinearSpeed = 1.0 })
.andThen(InstantCommand({ robot.drive.maxRotSpeed = PI / 4 }))
).onFalse(
InstantCommand({ robot.drive.maxLinearSpeed = RobotConstants.MAX_LINEAR_SPEED })
.andThen(
InstantCommand({ robot.drive.maxRotSpeed = RobotConstants.MAX_ROT_SPEED })
)
)
driveController.rightBumper()
.onTrue(
InstantCommand(
{ robot.drive.maxLinearSpeed = 1.0 }
).andThen(InstantCommand({ robot.drive.maxRotSpeed = PI / 4 }))
).onFalse(
InstantCommand({ robot.drive.maxLinearSpeed = RobotConstants.MAX_LINEAR_SPEED })
.andThen(
InstantCommand({ robot.drive.maxRotSpeed = RobotConstants.MAX_ROT_SPEED })
)
)

// reset gyro
driveController.start().onTrue(
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/frc/team449/system/SparkUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object SparkUtil {
sparkMax.burnFlash()
}

fun createSparkMax (
fun createSparkMax(
id: Int,
unitPerRotation: Double,
gearing: Double,
Expand All @@ -85,7 +85,7 @@ object SparkUtil {
// encoder information

encInverted: Boolean = false
) : CANSparkMax {
): CANSparkMax {
val motor = CANSparkMax(
id,
CANSparkLowLevel.MotorType.kBrushless
Expand Down

0 comments on commit a2a2cae

Please sign in to comment.