Class RotaryMechanismIOSim

java.lang.Object
com.marslib.mechanisms.RotaryMechanismIOSim
All Implemented Interfaces:
RotaryMechanismIO

public class RotaryMechanismIOSim extends Object implements RotaryMechanismIO
Simulation implementation of the RotaryMechanismIO interface. Uses Dyn4j to run a rigid-body physics simulation of a 1D rotary arm mechanism.
  • Constructor Details

    • RotaryMechanismIOSim

      public RotaryMechanismIOSim(String mechanismName, double gearRatio, double jKgMetersSquared, double lengthMeters)
      Constructs a physical simulation instance for a 1D rotary arm mechanism.

      This models the mechanism as a Dyn4j revolute joint and accurately calculates rotational inertia and forces based on an attached Kraken X60 motor.

      Parameters:
      mechanismName - The unique identifier used for AdvantageKit logging (e.g. "Arm").
      gearRatio - The total gear reduction from motor to arm axis.
      jKgMetersSquared - The total moment of inertia of the rotating arm in kg*m^2.
      lengthMeters - The physical extended length of the arm for visualization and density mapping.
  • Method Details