public class Forklift extends Object
Modifier and Type | Field and Description |
---|---|
private EV3MediumRegulatedMotor |
clawMotor |
private EV3LargeRegulatedMotor |
forkliftMotor |
private boolean |
gripped |
Constructor and Description |
---|
Forklift(EV3LargeRegulatedMotor forkliftMotor,
EV3MediumRegulatedMotor clawMotor)
Forklift constructor
|
Modifier and Type | Method and Description |
---|---|
double |
getGrip()
Get the gripping position of the claw
|
void |
grip()
Move the claw to grip an object
|
void |
liftDown()
Move the lift all the way down (to the ground)
|
void |
liftToTower(int towerHeight)
Move lift to a height based on the current tower's height
|
void |
liftUp()
Move the lift all the way up
|
void |
toggleGrip()
Grip with the claw if not gripping, otherwise ungrip.
|
void |
ungrip()
Move the claw to release an object
|
private EV3LargeRegulatedMotor forkliftMotor
private EV3MediumRegulatedMotor clawMotor
private boolean gripped
public Forklift(EV3LargeRegulatedMotor forkliftMotor, EV3MediumRegulatedMotor clawMotor)
forkliftMotor
- motor object for forklift heightclawMotor
- motor object for clawpublic void liftUp()
public void liftDown()
public void liftToTower(int towerHeight)
towerHeight
- current number of blocks in the towerpublic void toggleGrip()
public void grip()
public void ungrip()
public double getGrip()