Skip to content
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

Merged
merged 65 commits into from
Jan 28, 2024
Merged

Feeder #15

merged 65 commits into from
Jan 28, 2024

Conversation

MatthewChoulas
Copy link
Contributor

No description provided.

Shilab66 and others added 30 commits January 9, 2024 18:26
# Conflicts:
#	src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/Flywheel.kt
#	src/main/kotlin/com/team4099/robot2023/subsystems/Shooter/Shooter.kt
Copy link
Member

@sswadkar sswadkar left a 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 -> {
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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,
Copy link
Member

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(
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

@MatthewChoulas MatthewChoulas merged commit 3d007bc into main Jan 28, 2024
1 check failed
@00magikarp 00magikarp deleted the feeder branch July 16, 2024 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants