inputs.turnAppliedVolts = turnAppliedVolts.getValueAsDouble();
inputs.turnCurrentAmps = turnCurrent.getValueAsDouble();
+ // Update encoder inputs
+ inputs.encoderOffset = Units.rotationsToDegrees(CANcoder.getAbsolutePosition().getValueAsDouble());
+
// Update odometry inputs
inputs.odometryTimestamps =
timestampQueue.stream().mapToDouble((Double value) -> value).toArray();
public double[] odometryTimestamps = new double[] {};
public double[] odometryDrivePositionsRad = new double[] {};
public Rotation2d[] odometryTurnPositions = new Rotation2d[] {};
+
+ public double encoderOffset = 0.0;
}
/** Updates the set of loggable inputs. */