-
Notifications
You must be signed in to change notification settings - Fork 0
More logging #48
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
base: main
Are you sure you want to change the base?
More logging #48
Changes from all commits
46238bf
66a366b
96ddfea
2629d79
f530708
40486bc
c852808
0f8c6fb
4182ebb
f850972
49dc189
52ad1c4
8f04166
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,10 +22,12 @@ public class IntakeIOSparkFlex implements IntakeIO { | |
| private final DigitalInput sideSensor = new DigitalInput(Constants.SIDE_SENSOR_PORT); | ||
| private final DigitalInput intakeSensor = new DigitalInput(Constants.INTAKE_SENSOR_PORT); | ||
| private final DigitalInput shooterSensor = new DigitalInput(Constants.SHOOTER_SENSOR_PORT); | ||
|
|
||
| public double setpoint; | ||
|
|
||
| public IntakeIOSparkFlex(){ | ||
| sparkFlex.restoreFactoryDefaults(); | ||
| sparkFlex.setInverted(false); | ||
| sparkFlex.setInverted(Constants.isCompBot() ? false : true); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need this anymore because the practice bot is working |
||
|
|
||
| sparkFlex.setIdleMode(IdleMode.kBrake); | ||
| sparkFlex.setSmartCurrentLimit(120, 50); | ||
|
|
@@ -45,6 +47,7 @@ public void updateInputs(IntakeIOInputs inputs) { | |
| inputs.intakeVelocity = encoder.getVelocity(); | ||
| inputs.intakePosition = encoder.getPosition(); | ||
| inputs.shooterSensor = getShooterSensor(); | ||
| inputs.intakeSetpoint = setpoint; | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -100,5 +103,6 @@ public void moveEncoder(double setpoint) { | |
| @Override | ||
| public void setEncoderValue(double encoderPosition) { | ||
| sparkFlex.getEncoder().setPosition(encoderPosition); | ||
| setpoint = encoderPosition; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,7 @@ public LinkageIOTalonFX(DigitalInput zeroButton, DigitalInput brakeButton) { | |
| this.zeroButton = zeroButton; | ||
| this.brakeButton = brakeButton; | ||
|
|
||
|
|
||
| final double kA = 0.0; | ||
| final double kD = 0.0; | ||
| final double kG = 0.0; | ||
|
|
@@ -128,6 +129,14 @@ public LinkageIOTalonFX(DigitalInput zeroButton, DigitalInput brakeButton) { | |
| talonFX.getConfigurator().apply(talonFXConfiguration, 0.050); | ||
| } | ||
|
|
||
| public boolean zeroed() { | ||
| if (talonFX.getPosition().getValueAsDouble() == 0.0) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, just have it return if the zero button has been pressed at any time previously. |
||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| private boolean getRawZeroButton(){ | ||
| return !this.zeroButton.get(); | ||
| } | ||
|
|
@@ -159,6 +168,8 @@ public void updateInputs(LinkageIOInputs inputs) { | |
| inputs.linkagePosition = talonFX.getPosition().getValueAsDouble() * GEAR_RATIO; | ||
| inputs.zeroButton = this.getRawZeroButton(); | ||
| inputs.brakeButton = this.getRawBrakeButton(); | ||
| inputs.linkageSetpoint = talonFX.getClosedLoopReference().getValueAsDouble(); | ||
| inputs.linkageZeroed = zeroed(); | ||
| } | ||
|
|
||
| public void set(double speed) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ public void updateInputs(VisionIOInputs inputs) { | |
| inputs.tyBase = getTYBase(); | ||
| inputs.tyAdjusted = getTYAdjusted(); | ||
| inputs.pipeline = getPipeline(); | ||
| inputs.botpose = getBotPose(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My only concern here is what it does when the bot pose is null. I don't want to tank our code when the limelight isn't seeing a target |
||
| } | ||
|
|
||
| public double getTX() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -377,5 +377,8 @@ public void periodic() { | |
| // Logger.recordOutput("Rotation2d", this.getPigeon2().getRotation2d()); | ||
| Logger.recordOutput("Swerve: CurrentState", this.getState().ModuleStates); | ||
| Logger.recordOutput("Swerve: TargetState", this.getState().ModuleTargets); | ||
| Logger.recordOutput("Pigeon Yaw: ", this.getPigeon2().getYaw().getValueAsDouble()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This nee ds to be tested because this could be the source of our previous seg faults which would kill us on the comp field |
||
| Logger.recordOutput("Pigeon Pitch: ", this.getPigeon2().getPitch().getValueAsDouble()); | ||
| Logger.recordOutput("Pigeon Roll: ", this.getPigeon2().getRoll().getValueAsDouble()); | ||
| } | ||
| } | ||
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.
Let's have this track if the zero button has been pressed or if the zeroing command has ran