Skip to content

Commit

Permalink
log grabber applied voltage and bus voltage
Browse files Browse the repository at this point in the history
  • Loading branch information
varun7654 committed Apr 16, 2023
1 parent f6a758c commit 07316d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/subsytem/grabber/GrabberIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public static class GrabberInputs {
double grabberCurrent = 0.0;
double grabberTemp = 0.0;
double grabberVoltage = 0.0;
double grabberAppliedOutput = 0.0;
double grabberBusVoltage = 0.0;


double rollerMainPosition = 0.0;
double rollerMainVelocity = 0.0;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/frc/subsytem/grabber/GrabberIOSparkMax.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public synchronized void updateInputs(GrabberInputsAutoLogged inputs) {
inputs.grabberCurrent = grabberSparkMax.getOutputCurrent();
inputs.grabberTemp = grabberSparkMax.getMotorTemperature();
inputs.grabberVoltage = grabberSparkMax.getAppliedOutput() * grabberSparkMax.getBusVoltage();
inputs.grabberAppliedOutput = grabberSparkMax.getAppliedOutput();
inputs.grabberBusVoltage = grabberSparkMax.getBusVoltage();

if (USE_GRABBER_ENCODER) {
assert grabberAbsoluteEncoder != null;
inputs.grabberAbsolutePosition = grabberAbsoluteEncoder.getPosition() - 180; // Closed is 180 to avoid wrapping issues
Expand Down

0 comments on commit 07316d8

Please sign in to comment.