Skip to content

Commit

Permalink
merge conflict 🤣🤣
Browse files Browse the repository at this point in the history
kept intake objectized but everything else is shayaans, swervemodules in robotcontainer is now supplier
  • Loading branch information
00magikarp committed Jul 6, 2024
2 parents ad7414d + a56fe62 commit 977a265
Show file tree
Hide file tree
Showing 19 changed files with 11 additions and 4 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 .gradle/buildOutputCleanup/outputFiles.bin
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.
5 changes: 3 additions & 2 deletions src/main/kotlin/com/team4099/robot2023/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import com.team4099.robot2023.subsystems.superstructure.Request
import com.team4099.robot2023.subsystems.superstructure.Superstructure
import com.team4099.robot2023.subsystems.vision.Vision
import com.team4099.robot2023.subsystems.vision.camera.CameraIO
import com.team4099.robot2023.subsystems.vision.camera.CameraIOPhotonvision
import com.team4099.robot2023.subsystems.wrist.Wrist
import com.team4099.robot2023.subsystems.wrist.WristIOSim
import com.team4099.robot2023.subsystems.wrist.WristIOTalon
Expand Down Expand Up @@ -127,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(object : IntakeIO {})
Expand All @@ -137,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 Expand Up @@ -391,11 +393,12 @@ class Drivetrain(private val gyroIO: GyroIO, val swerveModules: List<SwerveModul
)
)
}

CustomLogger.recordDebugOutput(
"Drivetrain/desiredChassisSpeedsVXInMPS", desiredChassisSpeeds.vx.inMetersPerSecond
)
CustomLogger.recordDebugOutput(
"Drivetrain/desiredChassisSpeedsVYInMPS", desiredChassisSpeeds.vx.inMetersPerSecond
"Drivetrain/desiredChassisSpeedsVYInMPS", desiredChassisSpeeds.vy.inMetersPerSecond
)
CustomLogger.recordDebugOutput(
"Drivetrain/omegaDegreesPerSecond", desiredChassisSpeeds.omega.inDegreesPerSecond
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.team4099.robot2023.config.constants.DrivetrainConstants
import com.team4099.robot2023.subsystems.falconspin.Falcon500
import com.team4099.robot2023.subsystems.falconspin.MotorChecker
import com.team4099.robot2023.subsystems.falconspin.MotorCollection
import com.team4099.robot2023.util.CustomLogger
import com.team4099.utils.threads.PhoenixOdometryThread
import edu.wpi.first.wpilibj.AnalogInput
import edu.wpi.first.wpilibj.RobotController
Expand Down Expand Up @@ -50,6 +51,7 @@ import org.team4099.lib.units.derived.inVoltsPerMetersPerSecond
import org.team4099.lib.units.derived.inVoltsPerMetersPerSecondPerSecond
import org.team4099.lib.units.derived.radians
import org.team4099.lib.units.derived.volts
import org.team4099.lib.units.inMetersPerSecond
import org.team4099.lib.units.perSecond
import java.lang.Math.PI
import java.util.Queue
Expand Down Expand Up @@ -237,6 +239,7 @@ class SwerveModuleIOTalon(
DrivetrainConstants.DRIVE_SENSOR_GEAR_RATIO
)
inputs.drivePosition = driveSensor.position
inputs.steerPosition = steeringSensor.position
Logger.recordOutput("$label/rawSteeringValue", steeringFalcon.position.value)

steeringFalcon.position.value
Expand Down

0 comments on commit 977a265

Please sign in to comment.