Skip to content

Commit

Permalink
Made swerve actually run
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiopeia3 committed Feb 6, 2025
1 parent 62254e6 commit 268584e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/Robot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ object Robot : TimedRobot() {
}

override fun disabledPeriodic() {
vision.updateOdometryFromDisabled()
// vision.updateOdometryFromDisabled()
}

/** This autonomous runs the autonomous command selected by your [RobotContainer] class. */
Expand All @@ -95,7 +95,7 @@ object Robot : TimedRobot() {

/** This method is called periodically during operator control. */
override fun teleopPeriodic() {
vision.updateOdometry(1, false)
// vision.updateOdometry(1, false)
}

override fun testInit() {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ object RobotContainer {
drivetrain.setDefaultCommand(teleopDriveCommand)

drivetrain.registerTelemetry(logger::telemeterize)

// teleopDriveCommand.schedule()
}

val autonomousCommand: Command
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/frc/robot/commands/TeleopDriveCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class TeleopDriveCommand : Command() {

SmartDashboard.putNumber("ControlledSpeed", ControlledSpeed)
SmartDashboard.putNumber("ControlledAngularRate", ControlledAngularRate)
SmartDashboard.putNumber("Right Joy Y", rightJoystick.y)
SmartDashboard.putNumber("Drive X", -MiscCalculations.calculateDeadzone(
rightJoystick.y,
.1
) * ControlledSpeed)


val fieldOriented = !rightJoystick.button(2).asBoolean
Expand Down Expand Up @@ -68,7 +73,7 @@ class TeleopDriveCommand : Command() {
.1
) * ControlledAngularRate
)
}
}.execute()
} else {
drivetrain.applyRequest {
robotRelative.withVelocityX(
Expand All @@ -93,7 +98,7 @@ class TeleopDriveCommand : Command() {
.1
) * ControlledAngularRate
)
}
}.execute()
}


Expand Down

0 comments on commit 268584e

Please sign in to comment.