public final class ModernRoboticsUsbServoController extends ModernRoboticsUsbController implements ServoController
This is an implementation of ServoController.
Use HardwareDeviceManager to create an instance of this class
ModernRoboticsUsbController.WRITE_STATUSModernRoboticsUsbDevice.CreateReadWriteRunnableServoController.PwmStatusHardwareDevice.Manufacturer| Modifier and Type | Field and Description |
|---|---|
static byte[] |
ADDRESS_CHANNEL_MAP |
static int |
ADDRESS_CHANNEL1 |
static int |
ADDRESS_CHANNEL2 |
static int |
ADDRESS_CHANNEL3 |
static int |
ADDRESS_CHANNEL4 |
static int |
ADDRESS_CHANNEL5 |
static int |
ADDRESS_CHANNEL6 |
static int |
ADDRESS_PWM |
static int |
ADDRESS_UNUSED |
protected static double |
apiPositionMax |
protected static double |
apiPositionMin |
protected LastKnown<java.lang.Double>[] |
commandedServoPositions |
static boolean |
DEBUG_LOGGING
Enable DEBUG_LOGGING logging
|
protected LastKnown<java.lang.Boolean> |
lastKnownPwmEnabled |
static int |
MONITOR_LENGTH |
static byte |
PWM_DISABLE |
static byte |
PWM_ENABLE |
static byte |
PWM_ENABLE_WITHOUT_TIMEOUT |
protected static int |
SERVO_FIRST |
protected static int |
SERVO_LAST |
protected static double |
servoPositionMax |
protected static double |
servoPositionMin |
static byte |
START_ADDRESS |
static java.lang.String |
TAG |
callbackLock, callbackWaiterCount, concurrentClientLock, readCompletionCount, readWriteRunnableIsRunning, writeStatuscreateReadWriteRunnable, readWriteRunnable, readWriteService| Constructor and Description |
|---|
ModernRoboticsUsbServoController(Context context,
SerialNumber serialNumber,
OpenRobotUsbDevice openRobotUsbDevice,
SyncdDevice.Manager manager) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doArm() |
protected void |
doCloseFromArmed() |
protected void |
doCloseFromOther() |
protected void |
doDisarm() |
protected void |
doPretend() |
protected void |
floatHardware() |
java.lang.String |
getConnectionInfo()
Get connection information about this device in a human readable format
|
java.lang.String |
getDeviceName()
Device Name
|
HardwareDevice.Manufacturer |
getManufacturer()
Returns an indication of the manufacturer of this device.
|
ServoController.PwmStatus |
getPwmStatus()
Returns the enablement status of the collective set of servos connected to this controller
|
double |
getServoPosition(int servo)
Get the position of a servo at a given channel
|
protected java.lang.String |
getTag() |
void |
initializeHardware() |
void |
pwmDisable()
Disables all of the servos connected to this controller
|
void |
pwmEnable()
Enables all of the servos connected to this controller
|
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
void |
setServoPosition(int servo,
double position)
Set the position of a servo at the given channel
|
isOkToReadOrWrite, read, readComplete, shutdownComplete, startupComplete, write, writeCompletearmDevice, disarmDevice, getCreateReadWriteRunnable, getOpenRobotUsbDevice, getPretendDevice, getReadWriteRunnable, getVersion, read8, readFromWriteCache, readFromWriteCache, write8, write8, write8clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getVersionpublic static final java.lang.String TAG
public static final boolean DEBUG_LOGGING
public static final int MONITOR_LENGTH
protected static final int SERVO_FIRST
protected static final int SERVO_LAST
public static final byte PWM_ENABLE
public static final byte PWM_ENABLE_WITHOUT_TIMEOUT
public static final byte PWM_DISABLE
public static final byte START_ADDRESS
public static final int ADDRESS_CHANNEL1
public static final int ADDRESS_CHANNEL2
public static final int ADDRESS_CHANNEL3
public static final int ADDRESS_CHANNEL4
public static final int ADDRESS_CHANNEL5
public static final int ADDRESS_CHANNEL6
public static final int ADDRESS_PWM
public static final int ADDRESS_UNUSED
public static final byte[] ADDRESS_CHANNEL_MAP
protected static final double apiPositionMin
protected static final double apiPositionMax
protected static final double servoPositionMin
protected static final double servoPositionMax
protected LastKnown<java.lang.Double>[] commandedServoPositions
protected LastKnown<java.lang.Boolean> lastKnownPwmEnabled
public ModernRoboticsUsbServoController(Context context,
SerialNumber serialNumber,
OpenRobotUsbDevice openRobotUsbDevice,
SyncdDevice.Manager manager)
throws RobotCoreException,
java.lang.InterruptedException
RobotCoreExceptionjava.lang.InterruptedExceptionprotected java.lang.String getTag()
public void initializeHardware()
initializeHardware in class ModernRoboticsUsbDeviceprotected void doArm()
throws RobotCoreException,
java.lang.InterruptedException
RobotCoreExceptionjava.lang.InterruptedExceptionprotected void doPretend()
throws RobotCoreException,
java.lang.InterruptedException
RobotCoreExceptionjava.lang.InterruptedExceptionprotected void doDisarm()
throws RobotCoreException,
java.lang.InterruptedException
RobotCoreExceptionjava.lang.InterruptedExceptionprotected void doCloseFromArmed()
protected void doCloseFromOther()
public HardwareDevice.Manufacturer getManufacturer()
HardwareDevicegetManufacturer in interface HardwareDevicepublic java.lang.String getDeviceName()
ModernRoboticsUsbDevicegetDeviceName in interface HardwareDevicegetDeviceName in class ModernRoboticsUsbDevicepublic java.lang.String getConnectionInfo()
HardwareDevicegetConnectionInfo in interface HardwareDevicepublic void resetDeviceConfigurationForOpMode()
HardwareDeviceresetDeviceConfigurationForOpMode in interface HardwareDevicepublic void pwmEnable()
ServoControllerpwmEnable in interface ServoControllerpublic void pwmDisable()
ServoControllerpwmDisable in interface ServoControllerpublic ServoController.PwmStatus getPwmStatus()
ServoControllergetPwmStatus in interface ServoControllerpublic void setServoPosition(int servo,
double position)
ServoControllersetServoPosition in interface ServoControllerservo - channel of servoposition - from 0.0 to 1.0public double getServoPosition(int servo)
ServoControllergetServoPosition in interface ServoControllerservo - channel of servoprotected void floatHardware()