-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feeder #15
Feeder #15
Conversation
…constants to be for shooter
# Conflicts: # src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/Flywheel.kt # src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/Shooter.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good overall, get rid of idle state and request though. idle in the case of feeder is just open loop 0 (or whatever voltage needed to hold).
also, open loop intake and open loop shoot shouldn't be two separate states and requests. OpenLoop is a state of the feedersubsystem, different voltages being applied don't constitute them being different states. Looking at the code I see why we felt we should do this, but I would have one open loop state that accepts a voltage and looks like
open loop state -> {
if (note) -> setVoltage(targetVoltage)
else -> setVoltage(idleVoltage)
nextState = nextRequestMapped
}
FeederStates.UNINITIALIZED -> { | ||
nextState = FeederStates.IDLE | ||
} | ||
FeederStates.IDLE -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idle state doesn't make sense. this is setting an open loop voltage, you should reuse states and requests as much as you can
setFeederVoltage(feederTargetVoltage) | ||
nextState = fromRequestToState(currentRequest) | ||
} else { | ||
nextState = FeederStates.IDLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next state should be whatever the next request is
setFeederVoltage(feederTargetVoltage) | ||
nextState = fromRequestToState(currentRequest) | ||
} else { | ||
nextState = FeederStates.IDLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
var feederSupplyCurrent = 0.0.amps | ||
var feederTemp = 0.0.celsius | ||
|
||
var beamBroken = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should log this
|
||
feederSparkMax.idleMode = CANSparkMax.IdleMode.kCoast | ||
|
||
feederSparkMax.openLoopRampRate = 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get rid of it
mutableListOf(Neo(feederSparkMax, "Roller Motor")), | ||
FeederConstants.FEEDER_CURRENT_LIMIT, | ||
70.celsius, | ||
FeederConstants.FEEDER_CURRENT_LIMIT - 0.amps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will break motor checker, needs to be different
inputs.feederStatorCurrent * feederSparkMax.appliedOutput.absoluteValue | ||
inputs.feederTemp = feederSparkMax.motorTemperature.celsius | ||
|
||
Logger.recordOutput( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
"Intake/rollerMotorOvercurrentFault", | ||
feederSparkMax.getFault(CANSparkMax.FaultID.kOvercurrent) | ||
) | ||
Logger.recordOutput("Intake/busVoltage", feederSparkMax.busVoltage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
No description provided.