public interface DeviceManager
Modifier and Type | Interface and Description |
---|---|
static class |
DeviceManager.UsbDeviceType
Enum of known USB Device Types
|
Modifier and Type | Method and Description |
---|---|
ColorSensor |
createAdafruitI2cColorSensor(I2cController controller,
DeviceConfiguration.I2cChannel channel,
java.lang.String name)
Create an instance of a ColorSensor
|
ColorSensor |
createAdafruitI2cColorSensor(RobotCoreLynxModule module,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
AnalogOutput |
createAnalogOutputDevice(AnalogOutputController controller,
int channel,
java.lang.String name) |
HardwareDevice |
createAnalogSensor(AnalogInputController controller,
int channel,
AnalogSensorConfigurationType type) |
CRServo |
createCRServo(ServoController controller,
int portNumber,
java.lang.String name) |
CRServo |
createCRServoEx(ServoControllerEx controller,
int portNumber,
java.lang.String name,
ServoConfigurationType servoType) |
HardwareDevice |
createCustomServoDevice(ServoController controller,
int portNumber,
ServoConfigurationType servoConfigurationType) |
DcMotor |
createDcMotor(DcMotorController controller,
int portNumber,
MotorConfigurationType motorType,
java.lang.String name)
Create an instance of a DcMotor
|
DcMotor |
createDcMotorEx(DcMotorController controller,
int portNumber,
MotorConfigurationType motorType,
java.lang.String name) |
DeviceInterfaceModule |
createDeviceInterfaceModule(SerialNumber serialNumber,
java.lang.String name) |
HardwareDevice |
createDigitalDevice(DigitalChannelController controller,
int channel,
DigitalIoDeviceConfigurationType type) |
AccelerationSensor |
createHTAccelerationSensor(LegacyModule legacyModule,
int physicalPort,
java.lang.String name)
Create an instance of a AccelerationSensor
|
ColorSensor |
createHTColorSensor(LegacyModule controller,
int channel,
java.lang.String name)
Create an instance of a ColorSensor
|
CompassSensor |
createHTCompassSensor(LegacyModule legacyModule,
int physicalPort,
java.lang.String name)
Create an instance of a NxtCompassSensor
|
DcMotorController |
createHTDcMotorController(LegacyModule legacyModule,
int physicalPort,
java.lang.String name)
Create an instance of an NXT DcMotorController
|
GyroSensor |
createHTGyroSensor(LegacyModule legacyModule,
int physicalPort,
java.lang.String name)
Create an instance of a GyroSensor
|
IrSeekerSensor |
createHTIrSeekerSensor(LegacyModule legacyModule,
int physicalPort,
java.lang.String name)
Create an instance of a IrSeekerSensor
|
LightSensor |
createHTLightSensor(LegacyModule legacyModule,
int physicalPort,
java.lang.String name)
Create an instance of a LightSensor
|
ServoController |
createHTServoController(LegacyModule legacyModule,
int physicalPort,
java.lang.String name)
Create an instance of an NXT ServoController
|
TouchSensorMultiplexer |
createHTTouchSensorMultiplexer(LegacyModule legacyModule,
int port,
java.lang.String name) |
I2cDevice |
createI2cDevice(I2cController controller,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
I2cDeviceSynch |
createI2cDeviceSynch(RobotCoreLynxModule module,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
LED |
createLED(DigitalChannelController controller,
int channel,
java.lang.String name)
Create an instance of an LED
|
ColorSensor |
createLynxColorRangeSensor(RobotCoreLynxModule module,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
HardwareDevice |
createLynxCustomServoDevice(ServoControllerEx controller,
int portNumber,
ServoConfigurationType servoConfigurationType) |
RobotCoreLynxModule |
createLynxModule(RobotCoreLynxUsbDevice lynxUsbDevice,
int moduleAddress,
boolean isParent,
java.lang.String name)
Creates an instance of a LynxModule
|
RobotCoreLynxUsbDevice |
createLynxUsbDevice(SerialNumber serialNumber,
java.lang.String name)
Creates an instance of a Lynx USB device
|
ColorSensor |
createModernRoboticsI2cColorSensor(I2cController controller,
DeviceConfiguration.I2cChannel channel,
java.lang.String name)
Create an instance of a ColorSensor
|
ColorSensor |
createModernRoboticsI2cColorSensor(RobotCoreLynxModule module,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
GyroSensor |
createModernRoboticsI2cGyroSensor(I2cController i2cController,
DeviceConfiguration.I2cChannel channel,
java.lang.String name)
Create an instance of a GyroSensor
|
GyroSensor |
createModernRoboticsI2cGyroSensor(RobotCoreLynxModule module,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
TouchSensor |
createMRDigitalTouchSensor(DigitalChannelController digitalController,
int physicalPort,
java.lang.String name)
Create an instance of a Modern Robotics TouchSensor on a digital controller
|
IrSeekerSensor |
createMRI2cIrSeekerSensorV3(I2cController i2cController,
DeviceConfiguration.I2cChannel channel,
java.lang.String name)
Create an instance of a IrSeekerSensorV3
|
IrSeekerSensor |
createMRI2cIrSeekerSensorV3(RobotCoreLynxModule module,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
TouchSensor |
createNxtTouchSensor(LegacyModule legacyModule,
int physicalPort,
java.lang.String name) |
UltrasonicSensor |
createNxtUltrasonicSensor(LegacyModule legacyModule,
int physicalPort,
java.lang.String name)
Create an instance of an UltrasonicSensor
|
PWMOutput |
createPwmOutputDevice(PWMOutputController controller,
int channel,
java.lang.String name) |
Servo |
createServo(ServoController controller,
int portNumber,
java.lang.String name)
Create an instance of a Servo
|
Servo |
createServoEx(ServoControllerEx controller,
int portNumber,
java.lang.String name,
ServoConfigurationType servoType) |
DcMotorController |
createUsbDcMotorController(SerialNumber serialNumber,
java.lang.String name)
Create an instance of a DcMotorController
|
LegacyModule |
createUsbLegacyModule(SerialNumber serialNumber,
java.lang.String name)
Create an instance of a LegacyModule
|
ServoController |
createUsbServoController(SerialNumber serialNumber,
java.lang.String name)
Create an instance of a ServoController
|
HardwareDevice |
createUserI2cDevice(I2cController controller,
DeviceConfiguration.I2cChannel channel,
I2cDeviceConfigurationType type,
java.lang.String name)
Returns a new instance of a user-defined sensor type.
|
HardwareDevice |
createUserI2cDevice(RobotCoreLynxModule lynxModule,
DeviceConfiguration.I2cChannel channel,
I2cDeviceConfigurationType type,
java.lang.String name) |
WebcamName |
createWebcamName(SerialNumber serialNumber,
java.lang.String name)
Creates a
WebcamName from the indicated serialized contents |
ScannedDevices |
scanForUsbDevices()
Get a listing of currently connected USB devices
|
ScannedDevices scanForUsbDevices() throws RobotCoreException
This method will attempt to open all USB devices that are using an FTDI USB chipset. It will then probe the device to determine if it is a Modern Robotics device. Finally, it will close the device.
Because of the opening and closing of devices, it is recommended that this method is not called while any FTDI devices are in use.
RobotCoreException
- if unable to open a deviceDcMotorController createUsbDcMotorController(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- serial number of controllerRobotCoreException
- if unable to create instancejava.lang.InterruptedException
DcMotor createDcMotor(DcMotorController controller, int portNumber, MotorConfigurationType motorType, java.lang.String name)
controller
- DC Motor controller this motor is attached toportNumber
- physical port number on the controllermotorType
- the optional type we know of for this motorDcMotor createDcMotorEx(DcMotorController controller, int portNumber, MotorConfigurationType motorType, java.lang.String name)
ServoController createUsbServoController(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- serial number of controllerRobotCoreException
- if unable to create instancejava.lang.InterruptedException
Servo createServo(ServoController controller, int portNumber, java.lang.String name)
controller
- Servo controller this servo is attached toportNumber
- physical port number on the controllerServo createServoEx(ServoControllerEx controller, int portNumber, java.lang.String name, ServoConfigurationType servoType)
CRServo createCRServo(ServoController controller, int portNumber, java.lang.String name)
CRServo createCRServoEx(ServoControllerEx controller, int portNumber, java.lang.String name, ServoConfigurationType servoType)
HardwareDevice createCustomServoDevice(ServoController controller, int portNumber, ServoConfigurationType servoConfigurationType)
HardwareDevice createLynxCustomServoDevice(ServoControllerEx controller, int portNumber, ServoConfigurationType servoConfigurationType)
LegacyModule createUsbLegacyModule(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- serial number of legacy moduleRobotCoreException
- if unable to create instancejava.lang.InterruptedException
DeviceInterfaceModule createDeviceInterfaceModule(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- serial number of Core Device Interface moduleRobotCoreException
- if unable to create instancejava.lang.InterruptedException
TouchSensor createNxtTouchSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- the Legacy Module this sensor is attached tophysicalPort
- port number on Legacy Module it's connected toTouchSensorMultiplexer createHTTouchSensorMultiplexer(LegacyModule legacyModule, int port, java.lang.String name)
legacyModule
- the Legacy Module this sensor is attached toport
- port number on Legacy Module this sensor is connected to.HardwareDevice createAnalogSensor(AnalogInputController controller, int channel, AnalogSensorConfigurationType type)
controller
- Analog Input Controller Module this device is connected toAnalogOutput createAnalogOutputDevice(AnalogOutputController controller, int channel, java.lang.String name)
controller
- Analog Output Controller Module this device is connected toHardwareDevice createDigitalDevice(DigitalChannelController controller, int channel, DigitalIoDeviceConfigurationType type)
controller
- Device Interface Module this device is connected totype
- PWMOutput createPwmOutputDevice(PWMOutputController controller, int channel, java.lang.String name)
controller
- PWM Output Controller Module this device is connected toI2cDevice createI2cDevice(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)
controller
- I2c Controller Module this device is conneced tochannel
- the channel it's connected to on the ControllerI2cDeviceSynch createI2cDeviceSynch(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)
HardwareDevice createUserI2cDevice(I2cController controller, DeviceConfiguration.I2cChannel channel, I2cDeviceConfigurationType type, java.lang.String name)
HardwareDevice createUserI2cDevice(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, I2cDeviceConfigurationType type, java.lang.String name)
DcMotorController createHTDcMotorController(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected toRobotCoreLynxUsbDevice createLynxUsbDevice(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
serialNumber
- RobotCoreException
java.lang.InterruptedException
RobotCoreLynxModule createLynxModule(RobotCoreLynxUsbDevice lynxUsbDevice, int moduleAddress, boolean isParent, java.lang.String name)
lynxUsbDevice
- moduleAddress
- WebcamName createWebcamName(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
WebcamName
from the indicated serialized contentsRobotCoreException
java.lang.InterruptedException
ServoController createHTServoController(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected toCompassSensor createHTCompassSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected toTouchSensor createMRDigitalTouchSensor(DigitalChannelController digitalController, int physicalPort, java.lang.String name)
digitalController
- controller this device is connected tophysicalPort
- the port number of the device on that controllername
- the name of this device in the hardware mapAccelerationSensor createHTAccelerationSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected toLightSensor createHTLightSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected toIrSeekerSensor createHTIrSeekerSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected toIrSeekerSensor createMRI2cIrSeekerSensorV3(I2cController i2cController, DeviceConfiguration.I2cChannel channel, java.lang.String name)
i2cController
- the I2cController
this device is connected tochannel
- port number on the Device Interface Module this device is connected toIrSeekerSensor createMRI2cIrSeekerSensorV3(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)
UltrasonicSensor createNxtUltrasonicSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected toGyroSensor createHTGyroSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
legacyModule
- Legacy Module this device is connected tophysicalPort
- port number on the Legacy Module this device is connected toGyroSensor createModernRoboticsI2cGyroSensor(I2cController i2cController, DeviceConfiguration.I2cChannel channel, java.lang.String name)
i2cController
- module this device is connected tochannel
- i2c connection channelGyroSensor createModernRoboticsI2cGyroSensor(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)
ColorSensor createAdafruitI2cColorSensor(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)
controller
- Device Interface Module this sensor is connected tochannel
- the I2C port on the Device Interface this module is connected toColorSensor createAdafruitI2cColorSensor(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)
ColorSensor createLynxColorRangeSensor(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)
ColorSensor createHTColorSensor(LegacyModule controller, int channel, java.lang.String name)
controller
- Legacy Module this sensor is attached tochannel
- the I2C port it's connected toColorSensor createModernRoboticsI2cColorSensor(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)
controller
- Device Interface Module this sensor is attached tochannel
- the I2C port it's connected toColorSensor createModernRoboticsI2cColorSensor(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)
LED createLED(DigitalChannelController controller, int channel, java.lang.String name)
controller
- Digital Channel Controller this LED is connected tochannel
- the digital port it's connected to