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 Summary
Modifier and TypeFieldDescriptioncom.qualcomm.robotcore.hardware.HardwareDevice
Stores Hardware device from hardwareMap.Hashmap to store element's initializers in feature:initValue format.Stores value that is expected to be in the hardware map.Stores type of device as a HardwareDevice Class. -
Constructor Summary
ConstructorDescriptionHardwareElement
(Class<T> deviceType, com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String name) Constructs a HardwareElement.HardwareElement
(Class<T> deviceType, com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String name, String initializers) Constructs a HardwareElement. -
Method Summary
-
Field Details
-
name
Stores value that is expected to be in the hardware map. Assumed to be both the entry and key values. -
type
Stores type of device as a HardwareDevice Class. -
device
public com.qualcomm.robotcore.hardware.HardwareDevice deviceStores Hardware device from hardwareMap. Use this to run commands (eg. HardwareElement.device.setPower(0.5)) -
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.
-