Search in sources :

Example 1 with HiTechnicNxtDcMotorController

use of com.qualcomm.hardware.hitechnic.HiTechnicNxtDcMotorController in project robotcode by OutoftheBoxFTC.

the class HardwareFactory method mapNxtDcMotorController.

private void mapNxtDcMotorController(HardwareMap map, DeviceManager deviceMgr, LegacyModule legacyModule, DeviceConfiguration ctrlConf) {
    if (!ctrlConf.isEnabled()) {
        return;
    }
    HiTechnicNxtDcMotorController dcMotorController = (HiTechnicNxtDcMotorController) deviceMgr.createHTDcMotorController(legacyModule, ctrlConf.getPort(), ctrlConf.getName());
    map.dcMotorController.put(ctrlConf.getName(), dcMotorController);
    for (MotorConfiguration motorConf : ((MotorControllerConfiguration) ctrlConf).getMotors()) {
        mapMotor(map, deviceMgr, motorConf, dcMotorController);
    }
    VoltageSensor voltageSensor = dcMotorController;
    map.voltageSensor.put(ctrlConf.getName(), voltageSensor);
}
Also used : MotorControllerConfiguration(com.qualcomm.robotcore.hardware.configuration.MotorControllerConfiguration) LynxVoltageSensor(com.qualcomm.hardware.lynx.LynxVoltageSensor) VoltageSensor(com.qualcomm.robotcore.hardware.VoltageSensor) HiTechnicNxtDcMotorController(com.qualcomm.hardware.hitechnic.HiTechnicNxtDcMotorController) MotorConfiguration(com.qualcomm.robotcore.hardware.configuration.MotorConfiguration)

Aggregations

HiTechnicNxtDcMotorController (com.qualcomm.hardware.hitechnic.HiTechnicNxtDcMotorController)1 LynxVoltageSensor (com.qualcomm.hardware.lynx.LynxVoltageSensor)1 VoltageSensor (com.qualcomm.robotcore.hardware.VoltageSensor)1 MotorConfiguration (com.qualcomm.robotcore.hardware.configuration.MotorConfiguration)1 MotorControllerConfiguration (com.qualcomm.robotcore.hardware.configuration.MotorControllerConfiguration)1