java.lang.Object
org.firstinspires.ftc.teamcode.subsystems.hardware.Hardware

public class Hardware extends Object
eg. initialization code
// class declaration public Hardware robot;
// in init robot = new Hardware(); robot.introduce(new HardwareElement(hardwareMap, DcMotorEx.class, "leftFront")); robot.init();
// in loop robot.HardwareElements.get("leftFront").device.setPower(0.5);
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    HashMap<String,com.qualcomm.robotcore.hardware.HardwareDevice>
    HashMap to hold all hardware elements in name/entry:hardwareElement format.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Hardware(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, org.firstinspires.ftc.robotcore.external.Telemetry telemetry)
    Object that contains hardwareElements HashMap.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    get(String name)
    Gets a hardware element.
    com.qualcomm.robotcore.hardware.HardwareMap
    Gets the associated hardware map.
    org.firstinspires.ftc.robotcore.external.Telemetry
    Gets the associated telemetry.
    void
    introduce(HardwareElement<? extends com.qualcomm.robotcore.hardware.HardwareDevice> hardwareElement)
    Adds hardwareElement to hardwareElements arrayList in entry:hardwareElement format.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • hardwareElements

      public HashMap<String,com.qualcomm.robotcore.hardware.HardwareDevice> hardwareElements
      HashMap to hold all hardware elements in name/entry:hardwareElement format.
  • Constructor Details

    • Hardware

      public Hardware(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, org.firstinspires.ftc.robotcore.external.Telemetry telemetry)
      Object that contains hardwareElements HashMap.
  • Method Details

    • introduce

      public void introduce(HardwareElement<? extends com.qualcomm.robotcore.hardware.HardwareDevice> hardwareElement)
      Adds hardwareElement to hardwareElements arrayList in entry:hardwareElement format.
    • get

      public <T> T get(String name)
      Gets a hardware element.
      Parameters:
      name - The name of the element.
    • getHardwareMap

      public com.qualcomm.robotcore.hardware.HardwareMap getHardwareMap()
      Gets the associated hardware map.
    • getTelemetry

      public org.firstinspires.ftc.robotcore.external.Telemetry getTelemetry()
      Gets the associated telemetry.