Skip to content

Commit

Permalink
Adjust lift code
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinencounter committed Mar 8, 2024
1 parent e48fb7c commit 9c70934
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,27 @@ void unRightLeft() {
private void scoreYellowPixel(MultitaskScheduler scheduler, RobotConfiguration robot, ApproachObject2 xButton, KOdometryDrive drive) {
scheduler.task(e -> {
e.onStart(() -> {
robot.liftLeft().setTargetPosition(Var.AutoPositions.LiftScoringLow);
robot.liftLeft().setTargetPosition(yellowLiftTarget);
robot.dumperLatch().setPosition(Var.Box.latched);
robot.dumperRotate().setPosition(Var.Box.dumpRotate);
return kvoid;
});
e.isCompleted(() -> robot.liftLeft().getCurrentPosition() >= yellowLiftTarget - 20);
e.isCompleted(() -> {
int now = robot.liftLeft().getCurrentPosition();
Log.i("TwentyAuto",
String.format(
Locale.getDefault(),
"at %d, %.2f%% of %d",
now,
now / (double) yellowLiftTarget * 100.0,
yellowLiftTarget));
return now >= yellowLiftTarget - 20;
});
TimingKt.minDuration(e, 100);
TimingKt.maxDuration(e, 3000);
return kvoid;
})
.then(xButton.approach(new InchUnit(3.0)))
.then(xButton.approach(new InchUnit(2.0)))
.then(e -> {
TimingKt.delay(e, 200);
return kvoid;
Expand Down

0 comments on commit 9c70934

Please sign in to comment.