Class HardwareElement<T extends com.qualcomm.robotcore.hardware.HardwareDevice>

java.lang.Object
org.firstinspires.ftc.teamcode.subsystems.hardware.HardwareElement<T>

public class HardwareElement<T extends com.qualcomm.robotcore.hardware.HardwareDevice> extends Object
Creates Objects to store hardware elements and initializers. HardwareElement's are essentially HardwareDevices plus initializers.
  • Field Details

    • name

      public String name
      Stores value that is expected to be in the hardware map. Assumed to be both the entry and key values.
    • type

      public Class<T extends com.qualcomm.robotcore.hardware.HardwareDevice> type
      Stores type of device as a HardwareDevice Class.
    • device

      public com.qualcomm.robotcore.hardware.HardwareDevice device
      Stores Hardware device from hardwareMap. Use this to run commands (eg. HardwareElement.device.setPower(0.5))
    • initializers

      public HashMap<String,String> initializers
      Hashmap to store element's initializers in feature:initValue format.
  • Constructor Details

    • HardwareElement

      public HardwareElement(Class<T> deviceType, com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String name)
      Constructs a HardwareElement.
      Parameters:
      deviceType - The type of the device.
      name - Represents value of both Key and Entry.
      hardwareMap - The FTC SDK hardware map.
    • HardwareElement

      public HardwareElement(Class<T> deviceType, com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String name, String initializers)
      Constructs a HardwareElement.
      Parameters:
      deviceType - The type of the device.
      name - Represents value of both Key and Entry.
      hardwareMap - The FTC SDK hardware map.
      initializers - : key:value,key:value eg. "setDirection:REVERSE,setZeroPowerBehavior:BRAKE" Only necessary to list non-default pairs.