public class LynxServoController extends LynxController implements ServoController, ServoControllerEx
LynxController.PretendLynxModuleServoController.PwmStatusHardwareDevice.ManufacturerHardwareDeviceHealth.HealthStatusRobotArmingStateNotifier.ARMINGSTATE, RobotArmingStateNotifier.Callback| Modifier and Type | Field and Description |
|---|---|
static double |
apiPositionFirst |
static double |
apiPositionLast |
static int |
apiServoFirst |
static int |
apiServoLast |
protected PwmControl.PwmRange[] |
defaultPwmRanges |
protected LastKnown<java.lang.Double>[] |
lastKnownCommandedPosition |
protected LastKnown<java.lang.Boolean>[] |
lastKnownEnabled |
protected PwmControl.PwmRange[] |
pwmRanges |
static java.lang.String |
TAG |
context, hardwareDeviceHealth, isEngaged, isHardwareInitialized, isHooked, registeredCallbackstag| Constructor and Description |
|---|
LynxServoController(Context context,
LynxModule module) |
| Modifier and Type | Method and Description |
|---|---|
void |
floatHardware() |
void |
forgetLastKnown() |
java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of 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
|
PwmControl.PwmRange |
getServoPwmRange(int servo)
Returns the PWM range of the indicated servo on this controller.
|
protected java.lang.String |
getTag() |
void |
initializeHardware() |
boolean |
isServoPwmEnabled(int servo)
Returns whether the PWM is energized for this particular servo
|
void |
pwmDisable()
Disables all of the servos connected to this controller
|
void |
pwmEnable()
Enables all of the servos connected to this controller
|
void |
setServoPosition(int servo,
double position)
Set the position of a servo at the given channel
|
void |
setServoPwmDisable(int servo)
Individually de-energizes the PWM for a particular servo
|
void |
setServoPwmEnable(int servo)
Individually energizes the PWM for a particular servo
|
void |
setServoPwmRange(int servo,
PwmControl.PwmRange range)
Sets the PWM range of the indicated servo.
|
void |
setServoType(int servo,
ServoConfigurationType servoType)
Sets the servo type for a particular servo
|
adjustHookingToMatchEngagement, close, disengage, doHook, doUnhook, engage, finishConstruction, getArmingState, getConnectionInfo, getHealthStatus, getHealthStatusOverride, getManufacturer, getModule, getSerialNumber, getVersion, hook, isArmed, isEngaged, moduleNowArmedOrPretending, moduleNowDisarmed, onModuleStateChange, registerCallback, resetDeviceConfigurationForOpMode, setHealthStatus, setHealthyIfArmed, unhook, unregisterCallbackhandleException, handleSpecificException, handleSpecificException, handleSpecificException, handleSpecificExceptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getConnectionInfo, getManufacturer, getVersion, resetDeviceConfigurationForOpModepublic static final java.lang.String TAG
public static final int apiServoFirst
public static final int apiServoLast
public static final double apiPositionFirst
public static final double apiPositionLast
protected final LastKnown<java.lang.Double>[] lastKnownCommandedPosition
protected final LastKnown<java.lang.Boolean>[] lastKnownEnabled
protected PwmControl.PwmRange[] pwmRanges
protected PwmControl.PwmRange[] defaultPwmRanges
public LynxServoController(Context context,
LynxModule module)
throws RobotCoreException,
java.lang.InterruptedException
RobotCoreExceptionjava.lang.InterruptedExceptionprotected java.lang.String getTag()
getTag in class LynxControllerpublic void initializeHardware()
initializeHardware in class LynxControllerpublic void floatHardware()
floatHardware in class LynxControllerpublic void forgetLastKnown()
forgetLastKnown in class LynxControllerpublic java.lang.String getDeviceName()
HardwareDevicegetDeviceName in interface HardwareDevicegetDeviceName in class LynxControllerpublic void pwmEnable()
ServoControllerpwmEnable in interface ServoControllerpublic void pwmDisable()
ServoControllerpwmDisable in interface ServoControllerpublic ServoController.PwmStatus getPwmStatus()
ServoControllergetPwmStatus in interface ServoControllerpublic void setServoPwmEnable(int servo)
ServoControllerExsetServoPwmEnable in interface ServoControllerExservo - the servo port number on the controllerPwmControl.setPwmEnable()public void setServoPwmDisable(int servo)
ServoControllerExsetServoPwmDisable in interface ServoControllerExservo - the servo port number on the controllerPwmControl.setPwmDisable()public boolean isServoPwmEnabled(int servo)
ServoControllerExisServoPwmEnabled in interface ServoControllerExservo - the servo port number on the controllerPwmControl.isPwmEnabled()public void setServoType(int servo,
ServoConfigurationType servoType)
ServoControllerExsetServoType in interface ServoControllerExservo - the servo port number on the controllerservoType - the ServoConfigurationType instance to setpublic 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 servopublic void setServoPwmRange(int servo,
PwmControl.PwmRange range)
ServoControllerExsetServoPwmRange in interface ServoControllerExservo - the servo port number on the controllerrange - the new range for the servoServoControllerEx.getServoPwmRange(int),
PwmControl.setPwmRange(PwmControl.PwmRange)public PwmControl.PwmRange getServoPwmRange(int servo)
ServoControllerExgetServoPwmRange in interface ServoControllerExservo - the servo port number on the controllerServoControllerEx.setServoPwmRange(int, PwmControl.PwmRange),
PwmControl.getPwmRange()