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_STATUS
ModernRoboticsUsbDevice.CreateReadWriteRunnable
ServoController.PwmStatus
HardwareDevice.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, writeStatus
createReadWriteRunnable, 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, writeComplete
armDevice, disarmDevice, getCreateReadWriteRunnable, getOpenRobotUsbDevice, getPretendDevice, getReadWriteRunnable, getVersion, read8, readFromWriteCache, readFromWriteCache, write8, write8, write8
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getVersion
public 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
RobotCoreException
java.lang.InterruptedException
protected java.lang.String getTag()
public void initializeHardware()
initializeHardware
in class ModernRoboticsUsbDevice
protected void doArm() throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
protected void doPretend() throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
protected void doDisarm() throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
protected void doCloseFromArmed()
protected void doCloseFromOther()
public HardwareDevice.Manufacturer getManufacturer()
HardwareDevice
getManufacturer
in interface HardwareDevice
public java.lang.String getDeviceName()
ModernRoboticsUsbDevice
getDeviceName
in interface HardwareDevice
getDeviceName
in class ModernRoboticsUsbDevice
public java.lang.String getConnectionInfo()
HardwareDevice
getConnectionInfo
in interface HardwareDevice
public void resetDeviceConfigurationForOpMode()
HardwareDevice
resetDeviceConfigurationForOpMode
in interface HardwareDevice
public void pwmEnable()
ServoController
pwmEnable
in interface ServoController
public void pwmDisable()
ServoController
pwmDisable
in interface ServoController
public ServoController.PwmStatus getPwmStatus()
ServoController
getPwmStatus
in interface ServoController
public void setServoPosition(int servo, double position)
ServoController
setServoPosition
in interface ServoController
servo
- channel of servoposition
- from 0.0 to 1.0public double getServoPosition(int servo)
ServoController
getServoPosition
in interface ServoController
servo
- channel of servoprotected void floatHardware()