public class Arm
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Arm.Mode
Grabber mode
|
static class |
Arm.Position
Joint position
|
Modifier and Type | Field and Description |
---|---|
com.qualcomm.robotcore.hardware.Servo |
grabber |
Arm.Mode |
grabberMode |
com.qualcomm.robotcore.hardware.DcMotorEx |
joint |
Arm.Position |
jointPosition |
static double |
TICKS_PER_REVOLUTION |
Constructor and Description |
---|
Arm(DeviceManager deviceManager)
Constructs an
Arm object
given the robot's device manager |
Modifier and Type | Method and Description |
---|---|
void |
carry()
Puts the joint in the carry position
|
void |
close()
Closes the grabber
|
static int |
degreesToTicks(int degrees)
Returns the number of encoder ticks for this motor
for the given number of degrees
|
void |
down()
Puts the joint in the down position
|
void |
open()
Opens the grabber
|
void |
over_wall()
Puts the joint in the over wall position
|
void |
setGrabberMode(Arm.Mode mode)
Sets the grabber mode
|
void |
setJointPosition(Arm.Position position)
Sets the joint position
|
void |
stow()
Puts the joint in the stowed position
|
public com.qualcomm.robotcore.hardware.DcMotorEx joint
public com.qualcomm.robotcore.hardware.Servo grabber
public Arm.Mode grabberMode
public Arm.Position jointPosition
public static final double TICKS_PER_REVOLUTION
public Arm(DeviceManager deviceManager)
Arm
object
given the robot's device managerdeviceManager
- the robot's device managerpublic static int degreesToTicks(int degrees)
This could result in some error because the method
casts the calculation to an int
(encoder values are integers),
but the ticks per revolution of this motor is a double
.
degrees
- angle of rotation (counter-clockwise is positive)public void setJointPosition(Arm.Position position)
position
- arm positionpublic void stow()
public void carry()
public void down()
public void over_wall()
public void setGrabberMode(Arm.Mode mode)
mode
- grabber modepublic void open()
public void close()