Class SimSysIdTuner

java.lang.Object
com.marslib.util.SimSysIdTuner

public class SimSysIdTuner extends Object
Offline System Identification Tuner for MARSLib.

Parses AdvantageKit .wpilog telemetry files directly using WPILib's DataLogReader. Applies Multiple Linear Regression (OLS) to calculate mechanistic constants (kS, kV, kA), then back-calculates true Simulated Mass / Moment of Inertia for injection into dyn4j.

  • Constructor Details

    • SimSysIdTuner

      public SimSysIdTuner()
  • Method Details

    • solveForSimConstants

      public static void solveForSimConstants(String logFilePath, String voltageKey, String velocityKey, double gearing, double torqueConstant, double resistance)
      Executes regression over a given WPILog file.
      Parameters:
      logFilePath - Path to your AdvantageKit .wpilog file.
      voltageKey - AdvantageKit log key for Applied Voltage (e.g. "Shooter/AppliedVolts").
      velocityKey - AdvantageKit log key for Velocity (rad/s or m/s).
      gearing - Gear ratio (e.g., 1.5 for 1.5:1).
      torqueConstant - Motor Kt in N*m/A (Falcon 500 = ~0.0183).
      resistance - Motor internal resistance in Ohms (Falcon 500 = ~0.046).
    • main

      public static void main(String[] args)
      Offline testing entrypoint. Run natively via IDE to tune robots without deploying.