use of com.qualcomm.robotcore.hardware.ServoController in project robotcode by OutoftheBoxFTC.
the class HardwareFactory method mapUsbServoController.
private void mapUsbServoController(HardwareMap map, DeviceManager deviceMgr, ServoControllerConfiguration ctrlConf) throws RobotCoreException, InterruptedException {
if (!ctrlConf.isEnabled()) {
return;
}
ServoController servoController = deviceMgr.createUsbServoController(ctrlConf.getSerialNumber(), ctrlConf.getName());
map.servoController.put(ctrlConf.getName(), servoController);
for (DeviceConfiguration servoConf : ctrlConf.getDevices()) {
mapServo(map, deviceMgr, servoConf, servoController);
}
}
use of com.qualcomm.robotcore.hardware.ServoController in project robotcode by OutoftheBoxFTC.
the class HardwareFactory method mapNxtServoController.
private void mapNxtServoController(HardwareMap map, DeviceManager deviceMgr, LegacyModule legacyModule, DeviceConfiguration devConf) {
if (!devConf.isEnabled()) {
return;
}
ServoController sc = deviceMgr.createHTServoController(legacyModule, devConf.getPort(), devConf.getName());
map.servoController.put(devConf.getName(), sc);
for (DeviceConfiguration servoConf : ((ServoControllerConfiguration) devConf).getServos()) {
mapServo(map, deviceMgr, servoConf, sc);
}
}
use of com.qualcomm.robotcore.hardware.ServoController in project robotcode by OutoftheBoxFTC.
the class HardwareFactory method mapMatrixController.
private void mapMatrixController(HardwareMap map, DeviceManager deviceMgr, LegacyModule legacyModule, DeviceConfiguration devConf) {
if (!devConf.isEnabled()) {
return;
}
MatrixMasterController master = new MatrixMasterController((ModernRoboticsUsbLegacyModule) legacyModule, devConf.getPort());
DcMotorController mc = new MatrixDcMotorController(master);
map.dcMotorController.put(devConf.getName() + "Motor", mc);
map.dcMotorController.put(devConf.getName(), mc);
for (DeviceConfiguration motorConf : ((MatrixControllerConfiguration) devConf).getMotors()) {
mapMotor(map, deviceMgr, (MotorConfiguration) motorConf, mc);
}
ServoController sc = new MatrixServoController(master);
map.servoController.put(devConf.getName() + "Servo", sc);
map.servoController.put(devConf.getName(), sc);
for (DeviceConfiguration servoConf : ((MatrixControllerConfiguration) devConf).getServos()) {
mapServo(map, deviceMgr, servoConf, sc);
}
}
Aggregations