Package com.crossbotics.ftchelper.robot
Interface Devices
public interface Devices
Where the modules find their motors, servos and sensors by configuration name. On the robot it is
the OpMode's
hardwareMap (of(HardwareMap)); tests give pretend devices instead.
You rarely need it yourself: RobotDefinition hands it to every module.
Docs: docs/modules/robot.md
-
Method Summary
Modifier and TypeMethodDescription<T> TThe device with this name and type.default com.qualcomm.robotcore.hardware.HardwareMapThe OpMode's hardwareMap, for code that needs it whole (a path follower); null in tests.static Devicesof(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap) The robot's devices, from the OpMode's hardwareMap.<T> TThe device with this name and type, or null if there is none (for optional parts).
-
Method Details
-
get
The device with this name and type. Stops with a clear message (the names that DO exist) if it is not in the configuration.- Parameters:
type- the device type, e.g.DcMotorEx.classname- the configuration name (exact, case matters)
-
tryGet
The device with this name and type, or null if there is none (for optional parts). -
hardwareMap
default com.qualcomm.robotcore.hardware.HardwareMap hardwareMap()The OpMode's hardwareMap, for code that needs it whole (a path follower); null in tests. -
of
The robot's devices, from the OpMode's hardwareMap.- Parameters:
hardwareMap- the OpMode'shardwareMap
-