Class MicrosystemConf

java.lang.Object
tagalong.subsystems.micro.confs.MicrosystemConf
Direct Known Subclasses:
ElevatorConf, PivotConf, RollerConf

public class MicrosystemConf extends Object
Configuration for a microsystem
  • Field Details

  • Constructor Details

    • MicrosystemConf

      public MicrosystemConf(String name, Motors[] motorTypes, int[] motorDeviceIDs, String[] motorCanBus, com.ctre.phoenix6.signals.InvertedValue[] motorDirection, com.ctre.phoenix6.signals.NeutralModeValue[] motorEnabledBrakeMode, com.ctre.phoenix6.signals.NeutralModeValue[] motorDisabledBrakeMode, int[][] gearRatio, DistanceUnits trapezoidalLengthUnit, VelocityUnits trapezoidalVelocityUnit, double trapezoidalLimitsVelocity, AccelerationUnits trapezoidalAccelerationUnit, double trapezoidalLimitsAcceleration, DistanceUnits defaultTolerancesUnit, double defaultLowerTolerance, double defaultUpperTolerance, com.ctre.phoenix6.configs.CurrentLimitsConfigs currentLimitsConfigs, PIDSGVAConstants slot0, PIDSGVAConstants slot1, PIDSGVAConstants slot2, PIDSGVAConstants simSlot0, PIDSGVAConstants simSlot1, PIDSGVAConstants simSlot2)
      Parameters:
      name - microsystem name
      motorTypes - motor types
      motorDeviceIDs - motor device IDs
      motorCanBus - motor can bus
      motorDirection - motor directions
      motorEnabledBrakeMode - enabled brake mode for the motor
      motorDisabledBrakeMode - disabled brake mode for the motor
      gearRatio - gear ratio
      trapezoidalLengthUnit - unit for trapezoidal length
      trapezoidalVelocityUnit - unit for trapezoidal velocity
      trapezoidalLimitsVelocity - trapezoidal velocity limits
      trapezoidalAccelerationUnit - unit for trapezoidal acceleration
      trapezoidalLimitsAcceleration - trapezoidal acceleration limits
      defaultTolerancesUnit - unit for default tolerances
      defaultLowerTolerance - default lower tolerance
      defaultUpperTolerance - default upper tolerance
      currentLimitsConfigs - configurations for current limits
      slot0 - slot 0 configurations
      slot1 - slot 1 configurations
      slot2 - slot 2 configurations
      simSlot0 - simulation slot 0 configurations
      simSlot1 - simulation slot 1 configurations
      simSlot2 - simulation slot 2 configurations
  • Method Details

    • calculateGearRatio

      public static double calculateGearRatio(int[][] gearPairs)
      Parameters:
      gearPairs - Pairs of gear teeth representing the physical path to the motor. e.g if the motor is using a 14-tooth pinion to a 60-tooth gear, the input should be [[14, 60]]
      Returns:
      The resulting gear ratio coefficient. A reduction (target spinning slower than motor) results in a value g.t. 1 An up-duction (target spinning faster than motor) will result in a value l.t. 1