Skip to content

Commit

Permalink
Heartland Day 1
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniCIM committed Mar 10, 2018
2 parents 1c61844 + d34f8d2 commit 625f729
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,25 @@ protected void execute() {
double rotate = Robot.oi.right.getX();
double climberValue = 0;

<<<<<<< HEAD
boolean slowDown = Robot.oi.left.getRawButton(1) || Robot.oi.right.getRawButton(1);
=======
boolean turbo = (Robot.oi.left.getRawButton(1) || Robot.oi.right.getRawButton(1)) && Robot.elevator.getHeight() < 30;
boolean slowDown = Robot.oi.right.getRawButton(3);
boolean isCenter = Robot.oi.left.getRawButton(4);
>>>>>>> origin/master

if (Math.abs(move) < DEAD_BAND) {
move = 0;
} else {
<<<<<<< HEAD
if (slowDown) {
=======

if (turbo) {
move = map(move, 0, 1.0);
} else {
>>>>>>> origin/master
move = map(move, 0, 0.5);
} else {
move = map(move, 0, 1.0);
Expand All @@ -50,13 +63,23 @@ protected void execute() {
if (Robot.oi.left.getRawButton(10)) {
climberValue = -0.5;
}
<<<<<<< HEAD

if (Robot.oi.left.getRawButton(6) || Robot.oi.left.getRawButton(7)) {
climberValue = 0;
}

Robot.drivetrain.drive(move, rotate);
Robot.climber.set(climberValue);
=======
if (isCenter) {
Robot.vision.center();
}else {
Robot.drivetrain.drive(move, rotate);
Robot.climber.set(climber);
}

>>>>>>> origin/master
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ protected void execute() {
// SmartDashboard.putNumber("Vision X", Robot.vision.getX());

SmartDashboard.putBoolean("Have Cube", Robot.cubeManipulator.haveCube());

SmartDashboard.putNumber("Vision X", Robot.vision.getX());

SmartDashboard.putBoolean("Is Raising", Robot.elevator.isRaising());
SmartDashboard.putBoolean("Is Lowering", Robot.elevator.isLowering());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public int getX() {

public void center() {
double error = this.center - this.getX();
while (error != 0) {
while (error <-2 && error >2) {
double move = Robot.oi.left.getY();
if (move <= 0.1) {
move = 0;
Expand Down

0 comments on commit 625f729

Please sign in to comment.