Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main/kotlin/com/team4099/robot2026/Robot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import org.littletonrobotics.junction.wpilog.WPILOGWriter
import org.team4099.lib.units.base.Time
import org.team4099.lib.units.base.inMilliseconds
import org.team4099.lib.units.base.seconds
import org.team4099.lib.units.derived.inDegrees

object Robot : LoggedRobot() {
val logFolderAlert =
Expand Down
20 changes: 10 additions & 10 deletions src/main/kotlin/com/team4099/robot2026/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,16 @@ object RobotContainer {
setOf(superstructure)),
WaitCommand(0.1))))
ControlBoard.forceIntakeFullDown.whileTrue(
RepeatCommand(
SequentialCommandGroup(
Commands.runOnce({
intakeOverridingAngle =
max(IntakeConstants.PIVOT_MIN_ANGLE, intakeOverridingAngle - 10.degrees)
}),
Commands.defer(
{ superstructure.requestForceIntakeCommand(intakeOverridingAngle) },
setOf(superstructure)),
WaitCommand(0.1))))
RepeatCommand(
SequentialCommandGroup(
Commands.runOnce({
intakeOverridingAngle =
max(IntakeConstants.PIVOT_MIN_ANGLE, intakeOverridingAngle - 10.degrees)
}),
Commands.defer(
{ superstructure.requestForceIntakeCommand(intakeOverridingAngle) },
setOf(superstructure)),
WaitCommand(0.1))))

ControlBoard.rotateTrench.whileTrue(
TargetAngleCommand(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import org.team4099.lib.units.base.Length
import org.team4099.lib.units.base.Time
import org.team4099.lib.units.base.inMilliseconds
import org.team4099.lib.units.derived.Angle
import org.team4099.lib.units.derived.inDegrees
import org.team4099.lib.units.inMetersPerSecond
import org.team4099.lib.units.max

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface ShooterIO {
var shooterLeaderVoltage = 0.0.volts
var shooterLeaderSupplyCurrent = 0.0.amps
var shooterLeaderStatorCurrent = 0.0.amps
var shooterLeaderTorqueCurrent = 0.0.amps
var shooterLeaderTemperature = 0.0.celsius
var shooterLeaderVelocity = 0.0.rotations.perMinute
var shooterLeaderAcceleration = 0.0.rotations.perMinute.perMinute
Expand All @@ -40,33 +41,34 @@ interface ShooterIO {
var shooterFollowerVoltage = 0.0.volts
var shooterFollowerSupplyCurrent = 0.0.amps
var shooterFollowerStatorCurrent = 0.0.amps
var shooterFollowerTorqueCurrent = 0.0.amps
var shooterFollowerTemperature = 0.0.celsius
var shooterFollowerVelocity = 0.0.rotations.perMinute
var shooterFollowerAcceleration = 0.0.rotations.perMinute.perMinute

override fun toLog(table: LogTable?) {

override fun toLog(table: LogTable) {
// leader
table?.put("ShooterLeaderVoltage", shooterLeaderVoltage.inVolts)
table?.put("ShooterLeaderSupplyCurrent", shooterLeaderSupplyCurrent.inAmperes)
table?.put("ShooterLeaderStatorCurrent", shooterLeaderStatorCurrent.inAmperes)
table?.put("ShooterLeaderTemperature", shooterLeaderTemperature.inCelsius)
table?.put("ShooterLeaderVelocityRPM", shooterLeaderVelocity.inRotationsPerMinute)
table?.put(
table.put("ShooterLeaderVoltage", shooterLeaderVoltage.inVolts)
table.put("ShooterLeaderSupplyCurrent", shooterLeaderSupplyCurrent.inAmperes)
table.put("ShooterLeaderStatorCurrent", shooterLeaderStatorCurrent.inAmperes)
table.put("ShooterLeaderTorqueCurrent", shooterLeaderTorqueCurrent.inAmperes)
table.put("ShooterLeaderTemperature", shooterLeaderTemperature.inCelsius)
table.put("ShooterLeaderVelocityRPM", shooterLeaderVelocity.inRotationsPerMinute)
table.put(
"ShooterLeaderAccelerationRPMPM", shooterLeaderAcceleration.inRotationsPerMinutePerMinute)
// follower
table?.put("ShooterFollowerVoltage", shooterFollowerVoltage.inVolts)
table?.put("ShooterFollowerSupplyCurrent", shooterFollowerSupplyCurrent.inAmperes)
table?.put("ShooterFollowerStatorCurrent", shooterFollowerStatorCurrent.inAmperes)
table?.put("ShooterFollowerTemperature", shooterFollowerTemperature.inCelsius)
table?.put("ShooterFollowerVelocityRPM", shooterFollowerVelocity.inRotationsPerMinute)
table?.put(
table.put("ShooterFollowerVoltage", shooterFollowerVoltage.inVolts)
table.put("ShooterFollowerSupplyCurrent", shooterFollowerSupplyCurrent.inAmperes)
table.put("ShooterFollowerStatorCurrent", shooterFollowerStatorCurrent.inAmperes)
table.put("ShooterFollowerTorqueCurrent", shooterFollowerTorqueCurrent.inAmperes)
table.put("ShooterFollowerTemperature", shooterFollowerTemperature.inCelsius)
table.put("ShooterFollowerVelocityRPM", shooterFollowerVelocity.inRotationsPerMinute)
table.put(
"ShooterFollowerAccelerationRPMPM",
shooterFollowerAcceleration.inRotationsPerMinutePerMinute)
}

override fun fromLog(table: LogTable) {

// leader
table.get("ShooterLeaderVoltage", shooterLeaderVoltage.inVolts).let {
shooterLeaderVoltage = it.volts
Expand All @@ -77,6 +79,9 @@ interface ShooterIO {
table.get("ShooterLeaderStatorCurrent", shooterLeaderStatorCurrent.inAmperes).let {
shooterLeaderStatorCurrent = it.amps
}
table.get("ShooterLeaderTorqueCurrent", shooterLeaderTorqueCurrent.inAmperes).let {
shooterLeaderTorqueCurrent = it.amps
}
table.get("ShooterLeaderTemperature", shooterLeaderTemperature.inCelsius).let {
shooterLeaderTemperature = it.celsius
}
Expand All @@ -98,6 +103,9 @@ interface ShooterIO {
table.get("ShooterFollowerStatorCurrent", shooterFollowerStatorCurrent.inAmperes).let {
shooterFollowerStatorCurrent = it.amps
}
table.get("ShooterFollowerTorqueCurrent", shooterFollowerTorqueCurrent.inAmperes).let {
shooterFollowerTorqueCurrent = it.amps
}
table.get("ShooterFollowerTemperature", shooterFollowerTemperature.inCelsius).let {
shooterFollowerTemperature = it.celsius
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ object ShooterIOSim : ShooterIO {
inputs.shooterLeaderVoltage = shooterSim.inputVoltage.volts
inputs.shooterLeaderSupplyCurrent = 0.0.amps
inputs.shooterLeaderStatorCurrent = shooterSim.currentDrawAmps.amps
inputs.shooterLeaderTorqueCurrent = shooterSim.currentDrawAmps.amps.absoluteValue
inputs.shooterLeaderTemperature = 0.0.celsius

inputs.shooterFollowerVelocity = shooterSim.angularVelocityRadPerSec.radians.perSecond
Expand All @@ -63,6 +64,7 @@ object ShooterIOSim : ShooterIO {
inputs.shooterFollowerVoltage = shooterSim.inputVoltage.volts
inputs.shooterFollowerSupplyCurrent = 0.0.amps
inputs.shooterFollowerStatorCurrent = shooterSim.currentDrawAmps.amps
inputs.shooterFollowerTorqueCurrent = shooterSim.currentDrawAmps.amps.absoluteValue
inputs.shooterFollowerTemperature = 0.0.celsius
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ object ShooterIOTalon : ShooterIO {
followerTalon, ShooterConstants.GEAR_RATIO, ShooterConstants.VOLTAGE_COMPENSATION)

private var leaderStatorCurrentSignal: StatusSignal<WPILibCurrent>
private var leaderTorqueCurrentSignal: StatusSignal<WPILibCurrent>
private var leaderSupplyCurrentSignal: StatusSignal<WPILibCurrent>
private var leaderTempSignal: StatusSignal<WPILibTemperature>
private var leaderVoltageSignal: StatusSignal<WPILibVoltage>
private var leaderAccelSignal: StatusSignal<WPILibAngularAcceleration>
private var leaderVelocitySignal: StatusSignal<WPILibAngularVelocity>

private var followerStatorCurrentSignal: StatusSignal<WPILibCurrent>
private var followerTorqueCurrentSignal: StatusSignal<WPILibCurrent>
private var followerSupplyCurrentSignal: StatusSignal<WPILibCurrent>
private var followerTempSignal: StatusSignal<WPILibTemperature>
private var followerVoltageSignal: StatusSignal<WPILibVoltage>
Expand All @@ -88,13 +90,15 @@ object ShooterIOTalon : ShooterIO {
followerTalon.configurator.apply(configs)

leaderSupplyCurrentSignal = leaderTalon.supplyCurrent
leaderTorqueCurrentSignal = leaderTalon.torqueCurrent
leaderStatorCurrentSignal = leaderTalon.statorCurrent
leaderVelocitySignal = leaderTalon.velocity
leaderTempSignal = leaderTalon.deviceTemp
leaderVoltageSignal = leaderTalon.motorVoltage
leaderAccelSignal = leaderTalon.acceleration

followerSupplyCurrentSignal = followerTalon.supplyCurrent
followerTorqueCurrentSignal = followerTalon.torqueCurrent
followerStatorCurrentSignal = followerTalon.statorCurrent
followerVelocitySignal = followerTalon.velocity
followerTempSignal = followerTalon.deviceTemp
Expand All @@ -109,11 +113,13 @@ object ShooterIOTalon : ShooterIO {
BaseStatusSignal.refreshAll(
leaderSupplyCurrentSignal,
leaderStatorCurrentSignal,
leaderTorqueCurrentSignal,
leaderVelocitySignal,
leaderTempSignal,
leaderVoltageSignal,
leaderAccelSignal,
followerStatorCurrentSignal,
followerTorqueCurrentSignal,
followerSupplyCurrentSignal,
followerVelocitySignal,
followerTempSignal,
Expand Down Expand Up @@ -141,11 +147,13 @@ object ShooterIOTalon : ShooterIO {
inputs.shooterLeaderTemperature = leaderTempSignal.valueAsDouble.celsius
inputs.shooterLeaderSupplyCurrent = leaderSupplyCurrentSignal.valueAsDouble.amps
inputs.shooterLeaderStatorCurrent = leaderStatorCurrentSignal.valueAsDouble.amps
inputs.shooterLeaderTorqueCurrent = leaderTorqueCurrentSignal.valueAsDouble.amps
inputs.shooterLeaderVoltage = leaderVoltageSignal.valueAsDouble.volts

inputs.shooterFollowerTemperature = followerTempSignal.valueAsDouble.celsius
inputs.shooterFollowerSupplyCurrent = followerSupplyCurrentSignal.valueAsDouble.amps
inputs.shooterFollowerStatorCurrent = followerStatorCurrentSignal.valueAsDouble.amps
inputs.shooterFollowerStatorCurrent = followerTorqueCurrentSignal.valueAsDouble.amps
inputs.shooterFollowerVoltage = followerVoltageSignal.valueAsDouble.volts
}

Expand Down
Loading