Skip to content

Commit

Permalink
Lower Sampling Frequencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Java4First committed Feb 16, 2024
1 parent 060cb38 commit da0a72e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/drive/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class Module {
private static final double WHEEL_RADIUS = Units.inchesToMeters(2.0);
static final double ODOMETRY_FREQUENCY = 200.0;
static final double ODOMETRY_FREQUENCY = 150.0; // STU:

private final ModuleIO io;
private final ModuleIOInputsAutoLogged inputs = new ModuleIOInputsAutoLogged();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public ModuleIOSparkMax(int index) {
turnSparkMax.enableVoltageCompensation(12.0);

driveEncoder.setPosition(0.0);
driveEncoder.setMeasurementPeriod(10);
driveEncoder.setMeasurementPeriod(15);
driveEncoder.setAverageDepth(2);

turnRelativeEncoder.setPosition(0.0);
Expand Down Expand Up @@ -162,6 +162,8 @@ public void updateInputs(ModuleIOInputs inputs) {
"turnAbsolutePosition[" + m_index + "]", inputs.turnAbsolutePosition.getDegrees());
inputs.turnPosition =
Rotation2d.fromRotations(turnRelativeEncoder.getPosition() / TURN_GEAR_RATIO);
SmartDashboard.putNumber(
"turnRelativePosition[" + m_index + "]", inputs.turnPosition.getDegrees());
inputs.turnVelocityRadPerSec =
Units.rotationsPerMinuteToRadiansPerSecond(turnRelativeEncoder.getVelocity())
/ TURN_GEAR_RATIO;
Expand Down

0 comments on commit da0a72e

Please sign in to comment.