Class LinearMechanismIOSim

java.lang.Object
com.marslib.mechanisms.LinearMechanismIOSim
All Implemented Interfaces:
LinearMechanismIO

public class LinearMechanismIOSim extends Object implements LinearMechanismIO
Simulation implementation of the LinearMechanismIO interface. Uses Dyn4j to run a rigid-body physics simulation of a 1D elevator mechanism.
  • Constructor Details

    • LinearMechanismIOSim

      public LinearMechanismIOSim(String mechanismName, double gearRatio, double spoolDiameterMeters, double massKg)
      Constructs a physical simulation instance for a 1D linear elevator mechanism.

      This models the mechanism as a Dyn4j prismatic joint and accurately calculates forces based on an attached Kraken X60 motor and the physical spool parameters.

      Parameters:
      mechanismName - The unique identifier used for AdvantageKit logging (e.g. "Elevator").
      gearRatio - The total gear reduction from motor to spool (e.g., 25.0 for a 25:1 reduction).
      spoolDiameterMeters - The diameter of the driven spool in meters.
      massKg - The physical mass of the moving carriage and its load in kilograms.
  • Method Details