diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/ShooterIO.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/ShooterIO.kt index 887217ca..73c0b53d 100644 --- a/src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/ShooterIO.kt +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/ShooterIO.kt @@ -1,34 +1,67 @@ package com.team4099.robot2023.subsystems.Shooter -interface ShooterIO () { +import org.littletonrobotics.junction.LogTable +import org.littletonrobotics.junction.inputs.LoggableInputs +import org.team4099.lib.units.base.* +import org.team4099.lib.units.derived.* +import org.team4099.lib.units.inRadiansPerSecond +import org.team4099.lib.units.perMinute +import org.team4099.lib.units.perSecond + +interface ShooterIO { class ShooterIOInputs : LoggableInputs { var rollerVelocity = 0.rotations.perMinute var rollerAppliedVoltage = 0.volts var rollerStatorCurrent = 0.amps var rollerSupplyCurrent = 0.amps var rollerTempreature = 0.celsius - } - fun toLog(table:LogTable){ - table?.put("rollerVelocityRPM", rollerVelocity.inRadians.perSecond) - table?.put("rollerAppliedVoltage", rollerAppliedVoltage.inVolts) - table?.put("rollerStatorCurrent", rollerStatorCurrent.inamps) - table?.put("rollerVelocityRPM", rollerSupplyCurrent.inamps) - table?.put("rollerTempreature", rollerTempreature.celsisus) - } - fun fromLog(table:LogTable){ - table?.getDouble("rollerVelocityRPM", rollerVelocityRPM.inRadiansPerSecond)?.let{ - rollerVelocity = it.radians.perSecond - } - table?.getDouble("rollerAppliedVoltage", rollerAppliedVoltage.involts)?.let { - rollerAppliedVoltage = it.volts + override fun toLog(table: LogTable) { + table?.put("rollerVelocityRPM", rollerVelocity.inRadiansPerSecond) + table?.put("rollerAppliedVoltage", rollerAppliedVoltage.inVolts) + table?.put("rollerStatorCurrent", rollerStatorCurrent.inAmperes) + table?.put("rollerSupplyCurrent", rollerSupplyCurrent.inAmperes) + table?.put("rollerTempreature", rollerTempreature.inCelsius) + } - table?.getDouble("rollerStatorCurrent", rollerStatorCurrent.inRadiansPerSecond)?.let{ + + override fun fromLog(table: LogTable) { + table?.get("rollerVelocityRPM", rollerVelocity.inRadiansPerSecond)?.let { + rollerVelocity = it.radians.perSecond + } + table?.get("rollerAppliedVoltage", rollerAppliedVoltage.inVolts)?.let { + rollerAppliedVoltage = it.volts + } + table?.get("rollerStatorCurrent", rollerStatorCurrent.inAmperes)?.let { + rollerStatorCurrent = it.amps + } + table?.get("rollerSupplyCurrent", rollerSupplyCurrent.inAmperes)?.let { + rollerSupplyCurrent = it.amps + + } + + table?.get("rollerTempreature", rollerTempreature.inCelsius)?.let { + rollerTempreature = it.celsius + } + } - table?.getDouble("rollerVelocityRPM", rollerVelocityRPM.inRadiansPerSecond) - table?.getDouble("rollerVelocityRPM", rollerVelocityRPM.inRadiansPerSecond) + } + fun updateInputs(inputs: ShooterIOInputs) + fun setRollerPower (voltage: ElectricalPotential){ + + } + fun setRollerBrakeMode (brake: Boolean){ } + fun configPID( + kP: ProportionalGain , + kI: IntegralGain , + kD: DerivativeGain , + ){} + fun zeroEncoder(){ + + } + } \ No newline at end of file diff --git a/src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/ShooterIONeo.kt b/src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/ShooterIONeo.kt new file mode 100644 index 00000000..6ee6352b --- /dev/null +++ b/src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/ShooterIONeo.kt @@ -0,0 +1,5 @@ +package com.team4099.robot2023.subsystems.Shooter + +class ShooterIONeo { + val +} \ No newline at end of file