not sure if correct but turretsubsystem auto stubs filled#29
not sure if correct but turretsubsystem auto stubs filled#29lQuasar9206 wants to merge 14 commits intomainfrom
Conversation
| public class TurretSubsystem extends SubsystemBase implements Shooter { | ||
| /** Creates a new TurretSubsystem. */ | ||
| public TurretSubsystem() {} | ||
| public static double HOOD_GEAR_RATIO = 24.230769; |
There was a problem hiding this comment.
typically we leave this in terms of like x / y so it's easier to see what the gears actually are
| flywheelIO.updateInputs(flywheelInputs); | ||
| Logger.processInputs("Shooter/Flywheel", flywheelInputs); |
There was a problem hiding this comment.
make sure to also update and process hood inputs
src/main/java/frc/robot/Robot.java
Outdated
| shooter = | ||
| new TurretSubsystem( | ||
| ROBOT_MODE == RobotMode.REAL | ||
| ? new FlywheelIO(FlywheelIO.getFlywheelConfiguration(), canivore) |
There was a problem hiding this comment.
make sure you're not using the same getFlywheelConfiguration and getHoodConfigurations as the alpha shooter. these will need to be new methods returning diff configs
src/main/java/frc/robot/Robot.java
Outdated
| : new FlywheelIOSim(FlywheelIO.getFlywheelConfiguration(), canivore), | ||
| ROBOT_MODE == RobotMode.REAL | ||
| ? new HoodIO(HoodIO.getHoodConfiguration(), canivore) | ||
| : new HoodIOSim(canivore)); |
There was a problem hiding this comment.
also, hoodio should probably have the motor passed in to the constructor as it's not always going to be the same motor or have the same settings. this then also means hoodiosim needs to also have the motor passed in the constructor as well as the physics sim with the physical parameters specific to the mechanism. you could make like a static getAlphaHoodSim method if that makes it easier
There was a problem hiding this comment.
should this also be hood min rotation?
There was a problem hiding this comment.
idk what spit is actually supposed to do (did not write the command) so idk, just resets to zeroing position ig?
There was a problem hiding this comment.
spit is supposed to just eject all the balls from the robot in case stuff gets jammed (so spitting out balls). but vivi is right that the minimum position the hood can go to is not 0 on the alpha and likely won't be 0 on comp either
vivi-o
left a comment
There was a problem hiding this comment.
Looks good to me. Make sure to run build as well before pushing so the formatter is happy
| } | ||
|
|
||
| @Override | ||
| public Command zeroHood() { |
There was a problem hiding this comment.
Add a method to the current zero the hood. You can steal this from the alpha code, but basically run the motors backwards until it's hitting the physical stop (using the current to tell), and then do zeroHood() so it's zeroed
There was a problem hiding this comment.
did you want a command like current rezeroing like on seahorse:
public Command runCurrentZeroing() {
return setPivotVoltage(() -> -5.0)
.until(
new Trigger(() -> Math.abs(pivotCurrentFilterValue) > CURRENT_THRESHOLD).debounce(0.25))
.andThen(
Commands.parallel(Commands.print("Intake Zeroed"), zeroPivot(() -> ZEROING_POSITION)));
}
the rezero command is pretty similar on that compared to whats on here:
public Command rezero() {
// return this.runOnce(() -> pivotIO.resetEncoder(Rotation2d.kCCW_90deg));
return this.runOnce(() -> pivotIO.resetEncoder(ZEROING_ANGLE));
}
There was a problem hiding this comment.
you can just look at the code in ShooterSubsystem on the feature/alpha-sotm branch. here
| /** Creates a new TurretSubsystem. */ | ||
| public static double HOOD_GEAR_RATIO = 1; | ||
| public static double HOOD_GEAR_RATIO_C = 1; | ||
| public static double FLYWHEEL_GEAR_RATIO_C = 1; |
There was a problem hiding this comment.
why is there FLYWHEEL_GEAR_RATIO_C and FLYWHEEL_GEAR_RATIO? (ig we don't know actual gear ratio yet bc cads not final?)
There was a problem hiding this comment.
mb on naming but fwc is comp ratio and fw is alpha ratio (fixed now including gear ratios)
There was a problem hiding this comment.
in case the motor id's end up being different between alpha and comp it would be good to pass these in as 2 parameters instead (similar to how you passed in the gear ratio as a parameter for the sim to account for 2 different cases)
| /** Fixed shooter. !! ALPHA !! */ | ||
| public class ShooterSubsystem extends SubsystemBase implements Shooter { | ||
| public static double HOOD_GEAR_RATIO = 24.230769; | ||
| public static double HOOD_GEAR_RATIO_A = 24.230769; |
There was a problem hiding this comment.
because the alpha and comp gear ratios now live in 2 different files i think you can just name them both HOOD_GEAR_RATIO since they'll only ever be referred to with turret/shooter subsystem in front of them so there isn't confusion anymore
| @@ -55,7 +55,7 @@ public static class HoodIOInputs { | |||
|
|
|||
| public HoodIO(TalonFXConfiguration talonFXConfiguration, CANBus canbus) { | |||
| hoodMotor = new TalonFX(11, canbus); | |||
There was a problem hiding this comment.
same note here about passing in the id as a parameter
| return config; | ||
| } | ||
|
|
||
| public static TalonFXConfiguration getHoodCompConfiguration() { |
There was a problem hiding this comment.
nitpick but i'd rename this to getCompHood... or getAlphaHood.. etc. also for flywheel
There was a problem hiding this comment.
spit is supposed to just eject all the balls from the robot in case stuff gets jammed (so spitting out balls). but vivi is right that the minimum position the hood can go to is not 0 on the alpha and likely won't be 0 on comp either
| } | ||
|
|
||
| @Override | ||
| public Command zeroHood() { |
There was a problem hiding this comment.
you can just look at the code in ShooterSubsystem on the feature/alpha-sotm branch. here
src/main/java/frc/robot/Robot.java
Outdated
| SimulatedArena.overrideInstance(new EvergreenArena()); | ||
| } | ||
|
|
||
| Indexer indexer = null; |
There was a problem hiding this comment.
remove. these only exist in the constructor because they immediately get passed to the superstructure and Robot.java doesn't need to "hold on" to them
src/main/java/frc/robot/Robot.java
Outdated
| // autoChooser.addOption("Index Roller Sysid", indexer.runRollerSysId()); | ||
| // autoChooser.addOption("Intake Roller Sysid", intake.runRollerSysid()); | ||
| // autoChooser.addOption("Flywheel Sysid", shooter.runFlywheelSysid()); | ||
| autoChooser.addOption( |
There was a problem hiding this comment.
remove this for now because the pit checks are going to be in a separate pr
| @@ -0,0 +1,24 @@ | |||
| package frc.robot.subsystems.climber; | |||
There was a problem hiding this comment.
remove for now as ronan's doing the climber now
No description provided.