Skip to content

Commit

Permalink
Hopefully making it a supplier will fix things
Browse files Browse the repository at this point in the history
  • Loading branch information
Shom770 committed Jul 6, 2024
1 parent 4ae52ee commit a56fe62
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 3 deletions.
Binary file modified .gradle/8.4/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/8.4/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/8.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/8.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/8.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/8.4/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified ctre_sim/Talon FX vers. C - 011 - 0 - ext.dat
Binary file not shown.
Binary file modified ctre_sim/Talon FX vers. C - 012 - 0 - ext.dat
Binary file not shown.
Binary file modified ctre_sim/Talon FX vers. C - 013 - 0 - ext.dat
Binary file not shown.
Binary file modified ctre_sim/Talon FX vers. C - 014 - 0 - ext.dat
Binary file not shown.
Binary file modified ctre_sim/Talon FX vers. C - 021 - 0 - ext.dat
Binary file not shown.
Binary file modified ctre_sim/Talon FX vers. C - 022 - 0 - ext.dat
Binary file not shown.
Binary file modified ctre_sim/Talon FX vers. C - 023 - 0 - ext.dat
Binary file not shown.
Binary file modified ctre_sim/Talon FX vers. C - 024 - 0 - ext.dat
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/kotlin/com/team4099/robot2023/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ object RobotContainer {
// Real Hardware Implementations
// drivetrain = Drivetrain(object: GyroIO {},object: DrivetrainIO {}

drivetrain = Drivetrain(GyroIOPigeon2, SWERVE_MODULES_REAL)
drivetrain = Drivetrain(GyroIOPigeon2, { SWERVE_MODULES_REAL })
vision = Vision(object : CameraIO {})
limelight = LimelightVision(LimelightVisionIOReal)
intake = Intake(IntakeIOFalconNEO)
Expand All @@ -138,7 +138,7 @@ object RobotContainer {
wrist = Wrist(WristIOTalon)
} else {
// Simulation implementations
drivetrain = Drivetrain(object : GyroIO {}, SWERVE_MODULES_SIM)
drivetrain = Drivetrain(object : GyroIO {}, { SWERVE_MODULES_SIM })
vision = Vision(object : CameraIO {})
limelight = LimelightVision(object : LimelightVisionIO {})
intake = Intake(IntakeIOSim)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ 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, val swerveModules: List<SwerveModule>) :
class Drivetrain(private val gyroIO: GyroIO, val swerveModuleSupplier: () -> List<SwerveModule>) :
SubsystemBase() {
object TunableDriveStates {

Expand Down Expand Up @@ -99,6 +99,8 @@ class Drivetrain(private val gyroIO: GyroIO, val swerveModules: List<SwerveModul
private val swerveModuleID =
LoggedTunableValue("Drivetrain/testModule", 0.degrees, Pair({ it.inDegrees }, { it.degrees }))

val swerveModules = swerveModuleSupplier()

var currentRequest: DrivetrainRequest = DrivetrainRequest.ZeroSensors()
set(value) {
when (value) {
Expand Down

0 comments on commit a56fe62

Please sign in to comment.