Class CRServoDevice
java.lang.Object
com.cdarobotics.cdalib.devices.Device
com.cdarobotics.cdalib.devices.actuators.CRServoDevice
-
Constructor Summary
ConstructorsConstructorDescriptionCRServoDevice(com.qualcomm.robotcore.hardware.CRServo servo) Wraps an already-resolved CR servo.CRServoDevice(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String name) Resolves the CR servo from the hardware map by configured name. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetPower()com.qualcomm.robotcore.hardware.CRServogetServo()setDirection(com.qualcomm.robotcore.hardware.DcMotorSimple.Direction direction) Sets the CR servo's direction.setPower(double power) Sets the power to command on the nextupdate().voidupdate()Flush pending writes to, or refresh cached reads from, the underlying hardware.
-
Constructor Details
-
CRServoDevice
public CRServoDevice(com.qualcomm.robotcore.hardware.CRServo servo) Wraps an already-resolved CR servo. -
CRServoDevice
Resolves the CR servo from the hardware map by configured name.
-
-
Method Details
-
setPower
Sets the power to command on the nextupdate(). Range [-1.0, 1.0]. -
getPower
public double getPower()- Returns:
- the last commanded power (not necessarily yet flushed to hardware).
-
setDirection
public CRServoDevice setDirection(com.qualcomm.robotcore.hardware.DcMotorSimple.Direction direction) Sets the CR servo's direction. -
getServo
public com.qualcomm.robotcore.hardware.CRServo getServo()- Returns:
- the wrapped SDK CR servo, for operations not exposed here.
-
update
public void update()Description copied from class:DeviceFlush pending writes to, or refresh cached reads from, the underlying hardware.
-