Class ReduxDevices

java.lang.Object
swervelib.core.parser.deserializer.reflections.ReduxDevices

public class ReduxDevices extends Object
Reflective class for Canandgyro and other devices.
  • Constructor Details

    • ReduxDevices

      public ReduxDevices()
  • Method Details

    • getGyro

      public static org.wpilib.util.Pair<Supplier<org.wpilib.math.geometry.Rotation3d>, Object> getGyro(int canid, String canbus)
      Get the gyroscope attitude supplier and gyroscope object.
      Parameters:
      canid - CAN ID of the gyroscope.
      canbus - CAN bus of the gyroscope, see CANBuses. Anything other than a bus number is used as a ReduxLib bus string, such as "socketcan:can_s1".
      Returns:
      Pair of the attitude Supplier and the gyroscope Object
    • getAbsoluteEncoder

      public static org.wpilib.util.Pair<Supplier<org.wpilib.units.measure.Angle>, Object> getAbsoluteEncoder(int canid, String canbus, boolean inverted)
      Get the Canandmag angle.
      Parameters:
      canid - CAN ID of the encoder.
      canbus - CAN bus of the encoder, see CANBuses. Anything other than a bus number is used as a ReduxLib bus string, such as "socketcan:can_s1".
      inverted - Inverted encoder readings.
      Returns:
      Supplier of Angle and Canandmag