public class DeviceManager
extends java.lang.Object
DeviceManager
class is used to configure
hardware objects in code with the REV Control/Expansion Hub.
Credit to FTC 16197 SWARM for this idea.Robot
Modifier and Type | Field and Description |
---|---|
com.qualcomm.robotcore.hardware.DcMotor |
backLeft |
com.qualcomm.robotcore.hardware.DcMotor |
backRight |
com.qualcomm.robotcore.hardware.DcMotorEx |
flywheel |
com.qualcomm.robotcore.hardware.DcMotor |
frontLeft |
com.qualcomm.robotcore.hardware.DcMotor |
frontRight |
com.qualcomm.robotcore.hardware.Servo |
grabber |
com.qualcomm.robotcore.hardware.HardwareMap |
hardwareMap |
com.qualcomm.robotcore.hardware.Servo |
indexer |
com.qualcomm.robotcore.hardware.DcMotorEx |
intake |
com.qualcomm.robotcore.hardware.DcMotorEx |
joint |
Constructor and Description |
---|
DeviceManager(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap)
Constructs a
DeviceManager object given a
HardwareMap |
Modifier and Type | Method and Description |
---|---|
void |
init(boolean runningAuto)
Initializes the robot's hardware by configuring them
on the REV Control or Expansion Hub depending on if
an auto opmode is running.
|
public com.qualcomm.robotcore.hardware.HardwareMap hardwareMap
public com.qualcomm.robotcore.hardware.DcMotor backRight
public com.qualcomm.robotcore.hardware.DcMotor backLeft
public com.qualcomm.robotcore.hardware.DcMotor frontRight
public com.qualcomm.robotcore.hardware.DcMotor frontLeft
public com.qualcomm.robotcore.hardware.DcMotorEx intake
public com.qualcomm.robotcore.hardware.DcMotorEx flywheel
public com.qualcomm.robotcore.hardware.Servo indexer
public com.qualcomm.robotcore.hardware.DcMotorEx joint
public com.qualcomm.robotcore.hardware.Servo grabber
public DeviceManager(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap)
DeviceManager
object given a
HardwareMap
hardwareMap
- the robot's hardware mappublic void init(boolean runningAuto)
This matters because if we're running auto, roadrunner configures the drivetrain
wheels in SampleMecanumDrive
so we don't have to. But if we're running teleop, we need to configure the wheels
ourselves.
runningAuto
- whether the opmode is autonomous