From 15403bdd3d7113fbd53446598e31f14e6073c21a Mon Sep 17 00:00:00 2001 From: taimorioka Date: Tue, 14 Jan 2025 18:34:24 -0800 Subject: [PATCH] fixed issues --- ...otlin-compiler-18277150595480624353.salive | 0 .../kotlin/com/frcteam3636/frc2025/Robot.kt | 22 ------------------- .../frc2025/subsystems/drivetrain/Module.kt | 2 ++ 3 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 .kotlin/sessions/kotlin-compiler-18277150595480624353.salive diff --git a/.kotlin/sessions/kotlin-compiler-18277150595480624353.salive b/.kotlin/sessions/kotlin-compiler-18277150595480624353.salive deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/kotlin/com/frcteam3636/frc2025/Robot.kt b/src/main/kotlin/com/frcteam3636/frc2025/Robot.kt index 95be164..175e1f0 100644 --- a/src/main/kotlin/com/frcteam3636/frc2025/Robot.kt +++ b/src/main/kotlin/com/frcteam3636/frc2025/Robot.kt @@ -2,10 +2,6 @@ package com.frcteam3636.frc2025 import com.ctre.phoenix6.StatusSignal import com.frcteam3636.frc2025.subsystems.drivetrain.Drivetrain -import com.frcteam3636.frc2025.subsystems.drivetrain.Drivetrain.Constants.BUMPER_LENGTH -import com.frcteam3636.frc2025.subsystems.drivetrain.Drivetrain.Constants.BUMPER_WIDTH -import com.frcteam3636.frc2025.subsystems.drivetrain.Drivetrain.Constants.TRACK_WIDTH -import com.frcteam3636.frc2025.subsystems.drivetrain.Drivetrain.Constants.WHEEL_BASE import com.frcteam3636.frc2025.utils.Elastic import com.frcteam3636.frc2025.utils.ElasticNotification import com.frcteam3636.frc2025.utils.NotificationLevel @@ -16,10 +12,6 @@ import com.frcteam3636.version.GIT_SHA import edu.wpi.first.hal.FRCNetComm.tInstances import edu.wpi.first.hal.FRCNetComm.tResourceType import edu.wpi.first.hal.HAL -import edu.wpi.first.math.geometry.Pose2d -import edu.wpi.first.math.geometry.Rotation2d -import edu.wpi.first.math.geometry.Translation2d -import edu.wpi.first.math.system.plant.DCMotor import edu.wpi.first.wpilibj.* import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard import edu.wpi.first.wpilibj.util.WPILibVersion @@ -29,11 +21,6 @@ import edu.wpi.first.wpilibj2.command.Commands import edu.wpi.first.wpilibj2.command.button.CommandXboxController import edu.wpi.first.wpilibj2.command.button.JoystickButton import org.ironmaple.simulation.SimulatedArena -import org.ironmaple.simulation.drivesims.COTS -import org.ironmaple.simulation.drivesims.SwerveDriveSimulation -import org.ironmaple.simulation.drivesims.configs.DriveTrainSimulationConfig -import org.ironmaple.simulation.seasonspecific.reefscape2025.ReefscapeAlgaeOnField -import org.ironmaple.simulation.seasonspecific.reefscape2025.ReefscapeCoral import org.littletonrobotics.junction.LogFileUtil import org.littletonrobotics.junction.LoggedRobot import org.littletonrobotics.junction.Logger @@ -186,15 +173,6 @@ object Robot : LoggedRobot() { } - fun displaySimFieldToAdvantageScope() { - if (Robot.model !== Robot.Model.SIMULATION) return - - Logger.recordOutput("FieldSimulation/RobotPosition", Drivetrain.estimatedPose) - Logger.recordOutput( - "FieldSimulation/Notes", *SimulatedArena.getInstance().getGamePiecesArrayByType("Note") - ) - } - override fun robotPeriodic() { Dashboard.update() Diagnostics.collect(statusSignals).reportAlerts() diff --git a/src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/Module.kt b/src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/Module.kt index 5a545e4..c541a14 100644 --- a/src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/Module.kt +++ b/src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/Module.kt @@ -177,9 +177,11 @@ class DrivingSparkMAX(val id: REVMotorControllerId) : DrivingMotor { class SimSwerveModule(val sim: SwerveModuleSimulation) : SwerveModule { private val driveMotor: SimulatedMotorController.GenericMotorController = sim.useGenericMotorControllerForDrive() + .withCurrentLimit(DRIVING_CURRENT_LIMIT) // reference to the simulated turn motor private val turnMotor: SimulatedMotorController.GenericMotorController = sim.useGenericControllerForSteer() + .withCurrentLimit(TURNING_CURRENT_LIMIT) // TODO: figure out what the moment of inertia actually is and if it even matters private val drivingFeedforward = SimpleMotorFeedforward(DRIVING_FF_GAINS_TALON)