public class LynxServoController extends LynxController implements ServoController, ServoControllerEx
LynxController.PretendLynxModule
ServoController.PwmStatus
HardwareDevice.Manufacturer
HardwareDeviceHealth.HealthStatus
RobotArmingStateNotifier.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, registeredCallbacks
tag
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, unregisterCallback
handleException, handleSpecificException, handleSpecificException, handleSpecificException, handleSpecificException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getConnectionInfo, getManufacturer, getVersion, resetDeviceConfigurationForOpMode
public 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
RobotCoreException
java.lang.InterruptedException
protected java.lang.String getTag()
getTag
in class LynxController
public void initializeHardware()
initializeHardware
in class LynxController
public void floatHardware()
floatHardware
in class LynxController
public void forgetLastKnown()
forgetLastKnown
in class LynxController
public java.lang.String getDeviceName()
HardwareDevice
getDeviceName
in interface HardwareDevice
getDeviceName
in class LynxController
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 setServoPwmEnable(int servo)
ServoControllerEx
setServoPwmEnable
in interface ServoControllerEx
servo
- the servo port number on the controllerPwmControl.setPwmEnable()
public void setServoPwmDisable(int servo)
ServoControllerEx
setServoPwmDisable
in interface ServoControllerEx
servo
- the servo port number on the controllerPwmControl.setPwmDisable()
public boolean isServoPwmEnabled(int servo)
ServoControllerEx
isServoPwmEnabled
in interface ServoControllerEx
servo
- the servo port number on the controllerPwmControl.isPwmEnabled()
public void setServoType(int servo, ServoConfigurationType servoType)
ServoControllerEx
setServoType
in interface ServoControllerEx
servo
- the servo port number on the controllerservoType
- the ServoConfigurationType instance to setpublic 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 servopublic void setServoPwmRange(int servo, PwmControl.PwmRange range)
ServoControllerEx
setServoPwmRange
in interface ServoControllerEx
servo
- 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)
ServoControllerEx
getServoPwmRange
in interface ServoControllerEx
servo
- the servo port number on the controllerServoControllerEx.setServoPwmRange(int, PwmControl.PwmRange)
,
PwmControl.getPwmRange()