diff --git a/.gradle/8.4/checksums/checksums.lock b/.gradle/8.4/checksums/checksums.lock new file mode 100644 index 00000000..c7a27966 Binary files /dev/null and b/.gradle/8.4/checksums/checksums.lock differ diff --git a/.gradle/8.4/checksums/md5-checksums.bin b/.gradle/8.4/checksums/md5-checksums.bin new file mode 100644 index 00000000..2d54e9a5 Binary files /dev/null and b/.gradle/8.4/checksums/md5-checksums.bin differ diff --git a/.gradle/8.4/checksums/sha1-checksums.bin b/.gradle/8.4/checksums/sha1-checksums.bin new file mode 100644 index 00000000..b732798e Binary files /dev/null and b/.gradle/8.4/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.4/dependencies-accessors/dependencies-accessors.lock b/.gradle/8.4/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 00000000..0aecad98 Binary files /dev/null and b/.gradle/8.4/dependencies-accessors/dependencies-accessors.lock differ diff --git a/.gradle/8.4/dependencies-accessors/gc.properties b/.gradle/8.4/dependencies-accessors/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/.gradle/8.4/executionHistory/executionHistory.bin b/.gradle/8.4/executionHistory/executionHistory.bin new file mode 100644 index 00000000..d6b33aa1 Binary files /dev/null and b/.gradle/8.4/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.4/executionHistory/executionHistory.lock b/.gradle/8.4/executionHistory/executionHistory.lock new file mode 100644 index 00000000..6c74b465 Binary files /dev/null and b/.gradle/8.4/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.4/fileChanges/last-build.bin b/.gradle/8.4/fileChanges/last-build.bin new file mode 100644 index 00000000..f76dd238 Binary files /dev/null and b/.gradle/8.4/fileChanges/last-build.bin differ diff --git a/.gradle/8.4/fileHashes/fileHashes.bin b/.gradle/8.4/fileHashes/fileHashes.bin new file mode 100644 index 00000000..e3a72aea Binary files /dev/null and b/.gradle/8.4/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.4/fileHashes/fileHashes.lock b/.gradle/8.4/fileHashes/fileHashes.lock new file mode 100644 index 00000000..08c36350 Binary files /dev/null and b/.gradle/8.4/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.4/fileHashes/resourceHashesCache.bin b/.gradle/8.4/fileHashes/resourceHashesCache.bin new file mode 100644 index 00000000..9f6385f3 Binary files /dev/null and b/.gradle/8.4/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/8.4/gc.properties b/.gradle/8.4/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 00000000..5d704129 Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 00000000..47d905bf --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed Jun 19 14:31:53 EDT 2024 +gradle.version=8.4 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 00000000..01f4532d Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 00000000..4ba8469a Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 00000000..e69de29b diff --git a/src/main/kotlin/com/team4099/robot2023/RobotContainer.kt b/src/main/kotlin/com/team4099/robot2023/RobotContainer.kt index 35560be5..70becbd9 100644 --- a/src/main/kotlin/com/team4099/robot2023/RobotContainer.kt +++ b/src/main/kotlin/com/team4099/robot2023/RobotContainer.kt @@ -240,7 +240,6 @@ object RobotContainer { ControlBoard.passingShot.whileTrue(superstructure.passingShotCommand()) ControlBoard.underStagePassingShot.whileTrue(superstructure.underStageCommand()) ControlBoard.testWrist.whileTrue(superstructure.testWristCommand()) - //ControlBoard.testDriveVelocity.whileTrue(superstructure.testDriveVelocityCommand()) /* ControlBoard.targetAmp.whileTrue( diff --git a/src/main/kotlin/com/team4099/robot2023/config/ControlBoard.kt b/src/main/kotlin/com/team4099/robot2023/config/ControlBoard.kt index 9e4de685..437c9702 100644 --- a/src/main/kotlin/com/team4099/robot2023/config/ControlBoard.kt +++ b/src/main/kotlin/com/team4099/robot2023/config/ControlBoard.kt @@ -70,16 +70,17 @@ object ControlBoard { val ejectGamePiece = Trigger { driver.rightTriggerAxis > 0.5 } val testWrist = Trigger { driver.aButton } - - - val characterizeWrist = Trigger { driver.rightShoulderButton } val climbAlignFar = Trigger { driver.dPadUp } val climbAlignLeft = Trigger { driver.dPadLeft } val climbAlignRight = Trigger { driver.dPadRight } - val targetSpeaker = Trigger { driver.xButton } // TODO: switch back to climbAlignLeft + // TODO: Check if this variable is necessary + // val climbAutoAlign = Trigger { driver.bButton } + + val targetSpeaker = Trigger { driver.xButton } + // TODO: switch back to climbAlignLeft val lockWheels = Trigger { driver.startButton } // week0 controls diff --git a/src/main/kotlin/com/team4099/robot2023/config/constants/DrivetrainConstants.kt b/src/main/kotlin/com/team4099/robot2023/config/constants/DrivetrainConstants.kt index 5d963672..f25700fb 100644 --- a/src/main/kotlin/com/team4099/robot2023/config/constants/DrivetrainConstants.kt +++ b/src/main/kotlin/com/team4099/robot2023/config/constants/DrivetrainConstants.kt @@ -51,10 +51,6 @@ object DrivetrainConstants { const val GYRO_RATE_COEFFICIENT = 0.0 // TODO: Change this value - val TEST_X_VELOCITY = 10.0.meters.perSecond - val TEST_Y_VELOCITY = 10.0.meters.perSecond - val TEST_OMEGA = 5.0.radians.perSecond - val SLOW_AUTO_VEL = 2.meters.perSecond val SLOW_AUTO_ACCEL = 2.0.meters.perSecond.perSecond diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/drive/Drivetrain.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/drive/Drivetrain.kt index 1493a524..a649f8c0 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/drive/Drivetrain.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/drive/Drivetrain.kt @@ -31,38 +31,27 @@ import org.team4099.lib.geometry.Rotation3d import org.team4099.lib.geometry.Transform2d import org.team4099.lib.geometry.Translation2d import org.team4099.lib.kinematics.ChassisSpeeds -import org.team4099.lib.units.* import org.team4099.lib.units.base.inMeters import org.team4099.lib.units.base.inMilliseconds import org.team4099.lib.units.base.inSeconds import org.team4099.lib.units.base.meters -import org.team4099.lib.units.derived.* +import org.team4099.lib.units.inMetersPerSecond +import org.team4099.lib.units.inRadiansPerSecond +import org.team4099.lib.units.perSecond +import org.team4099.lib.units.inDegreesPerSecond +import org.team4099.lib.units.AngularVelocity +import org.team4099.lib.units.derived.radians +import org.team4099.lib.units.derived.degrees +import org.team4099.lib.units.derived.volts +import org.team4099.lib.units.derived.inDegrees +import org.team4099.lib.units.derived.inRotation2ds +import org.team4099.lib.units.derived.Angle +import org.team4099.lib.units.derived.inRadians import java.util.concurrent.locks.Lock import java.util.concurrent.locks.ReentrantLock import com.team4099.robot2023.subsystems.superstructure.Request.DrivetrainRequest as DrivetrainRequest class Drivetrain(private val gyroIO: GyroIO, swerveModuleIOs: DrivetrainIO) : SubsystemBase() { - object TunableDriveStates { - val testXVelocity = - LoggedTunableValue( - "Drivetrain/testXVelocity", - DrivetrainConstants.TEST_X_VELOCITY, - Pair( { it.inMetersPerSecond }, { it.meters.perSecond }) - ) - val testYVelocity = - LoggedTunableValue( - "Drivetrain/testYVelocity", - DrivetrainConstants.TEST_Y_VELOCITY, - Pair( { it.inMetersPerSecond }, { it.meters.perSecond }) - ) - val testOmega = - LoggedTunableValue( - "Drivetrain/testOmega", - DrivetrainConstants.TEST_OMEGA, - Pair( { it.inRadiansPerSecond }, { it.radians.perSecond }) - ) - } - private val gyroNotConnectedAlert = Alert( "Gyro is not connected, field relative driving will be significantly worse.", @@ -92,8 +81,10 @@ class Drivetrain(private val gyroIO: GyroIO, swerveModuleIOs: DrivetrainIO) : Su var targetPose: Pose2d = Pose2d(0.0.meters, 0.0.meters, 0.0.radians) var fieldVelocity = Velocity2d() + private set var robotVelocity = Velocity2d() + private set private var omegaVelocity = 0.0.radians.perSecond @@ -300,7 +291,7 @@ class Drivetrain(private val gyroIO: GyroIO, swerveModuleIOs: DrivetrainIO) : Su VisionConstants.POSE_TOPIC_NAME, doubleArrayOf(odomTRobot.x.inMeters, odomTRobot.y.inMeters, odomTRobot.rotation.inRadians) ) - CustomLogger.recordOutput("FieldRelativePose/robotPose", fieldTRobot.pose2d) + CustomLogger.recordOutput("FieldFrameEstimator/robotPose", fieldTRobot.pose2d) CustomLogger.recordOutput("Drivetrain/ModuleStates", *measuredStates.toTypedArray()) CustomLogger.recordOutput("Drivetrain/setPointStates", *setPointStates.toTypedArray()) diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModule.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModule.kt index 4346c2f6..db9c0f54 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModule.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModule.kt @@ -166,7 +166,7 @@ class SwerveModule(val io: SwerveModuleIO) { modulePosition.angle = inputs.steerPosition.inRotation2ds if (steerkD.hasChanged() || steerkP.hasChanged() || steerkI.hasChanged()) { - io.configSteerPID(steerkP.get(), steerkI.get(), steerkD.get()) + io.configureSteerPID(steerkP.get(), steerkI.get(), steerkD.get()) } if (drivekD.hasChanged() || @@ -175,7 +175,7 @@ class SwerveModule(val io: SwerveModuleIO) { drivekA.hasChanged() || drivekV.hasChanged() ) { - io.configDrivePID(drivekP.get(), drivekI.get(), drivekD.get(), drivekV.get(), drivekA.get()) + io.configureDrivePID(drivekP.get(), drivekI.get(), drivekD.get(), drivekV.get(), drivekA.get()) } if (steerMaxVelo.hasChanged() || steerMaxAccel.hasChanged()) { io.configSteerMotionMagic(steerMaxVelo.get(), steerMaxAccel.get()) diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIO.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIO.kt index d92cf59d..b1dcbbc1 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIO.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIO.kt @@ -152,13 +152,13 @@ interface SwerveModuleIO { fun setSteeringSetpoint(angle: Angle) {} - fun configSteerPID( + fun configureSteerPID( kP: ProportionalGain, kI: IntegralGain, kD: DerivativeGain ) {} - fun configDrivePID( + fun configureDrivePID( kP: ProportionalGain, Volt>, kI: IntegralGain, Volt>, kD: DerivativeGain, Volt>, diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIOSim.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIOSim.kt index 031cb932..381a00c6 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIOSim.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIOSim.kt @@ -254,7 +254,7 @@ class SwerveModuleIOSim(override val label: String) : SwerveModuleIO { turnAbsolutePosition = 0.0.radians } - override fun configDrivePID( + override fun configureDrivePID( kP: ProportionalGain, Volt>, kI: IntegralGain, Volt>, kD: DerivativeGain, Volt>, @@ -264,7 +264,7 @@ class SwerveModuleIOSim(override val label: String) : SwerveModuleIO { driveFeedback.setPID(kP, kI, kD) } - override fun configSteerPID( + override fun configureSteerPID( kP: ProportionalGain, kI: IntegralGain, kD: DerivativeGain diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIOTalon.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIOTalon.kt index 486d9141..7a6be8ae 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIOTalon.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/drivetrain/swervemodule/SwerveModuleIOTalon.kt @@ -261,6 +261,7 @@ class SwerveModuleIOTalon( // } // .toList() as // List + drivePositionQueue.clear() steeringPositionQueue.clear() @@ -358,7 +359,7 @@ class SwerveModuleIOTalon( steeringPositionQueue.clear() } - override fun configDrivePID( + override fun configureDrivePID( kP: ProportionalGain, Volt>, kI: IntegralGain, Volt>, kD: DerivativeGain, Volt>, @@ -376,7 +377,7 @@ class SwerveModuleIOTalon( driveFalcon.configurator.apply(PIDConfig) } - override fun configSteerPID( + override fun configureSteerPID( kP: ProportionalGain, kI: IntegralGain, kD: DerivativeGain diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/superstructure/Superstructure.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/superstructure/Superstructure.kt index e1118138..df771859 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/superstructure/Superstructure.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/superstructure/Superstructure.kt @@ -1168,24 +1168,6 @@ class Superstructure( return returnCommand } - fun testDriveVelocityCommand(): Command { - val returnCommand = runOnce { - currentRequest= Request.SuperstructureRequest.Tuning() - drivetrain.currentRequest = - Request.DrivetrainRequest.OpenLoop( - Drivetrain.TunableDriveStates.testOmega.get(), - Velocity2d( - Drivetrain.TunableDriveStates.testXVelocity.get(), - Drivetrain.TunableDriveStates.testYVelocity.get() - ) - ) - } - returnCommand.name = "TestDriveVelocityCommand" - return returnCommand - } - - // TODO: Test Drivetrain Steer Command - companion object { enum class SuperstructureStates { UNINITIALIZED,