Skip to content

Commit

Permalink
yeet dab fam maker fair stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan G. Minto authored and Logan G. Minto committed Mar 16, 2018
1 parent ef3daf2 commit 5681ae3
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import chawks.hardware.DrivingDirection;

@TeleOp(name = "Holonomic Tank KBottt", group = "TeleOp")
@Disabled

public class HolonomicTankKBottt extends KBotTheTank {
/**
* The value "K" should never equal or be less than 0 as there will be no clockwise movement
Expand Down
26 changes: 13 additions & 13 deletions FtcRobotController/src/main/java/chawks/teleop/KBotTheTank.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//import chawks.hardware.ShootingController;

@TeleOp(name = "KBOT DA TANK", group = "TeleOp")
@Disabled

public class KBotTheTank extends AbstractTeleOpKBot {


Expand Down Expand Up @@ -56,10 +56,10 @@ public void handleGamePad1(Gamepad gamepad) {
rightPower = -STRAFE_SPEED;
break;
}
robot.LFMotor.setPower(leftPower);
robot.RFMotor.setPower(rightPower);
robot.LBMotor.setPower(-leftPower);
robot.RBMotor.setPower(-rightPower);
robot.LFMotor.setPower(leftPower/4);
robot.RFMotor.setPower(rightPower/4);
robot.LBMotor.setPower(-leftPower/4);
robot.RBMotor.setPower(-rightPower/4);
return;
} else if (isDPADRight) {
float leftPower;
Expand All @@ -76,10 +76,10 @@ public void handleGamePad1(Gamepad gamepad) {
break;
}

robot.LFMotor.setPower(leftPower);
robot.RFMotor.setPower(rightPower);
robot.LBMotor.setPower(-leftPower);
robot.RBMotor.setPower(-rightPower);
robot.LFMotor.setPower(leftPower/4);
robot.RFMotor.setPower(rightPower/4);
robot.LBMotor.setPower(-leftPower/4);
robot.RBMotor.setPower(-rightPower/4);
return;

}
Expand All @@ -102,10 +102,10 @@ public void handleGamePad1(Gamepad gamepad) {
break;
}

robot.LBMotor.setPower(leftPower);
robot.LFMotor.setPower(leftPower);
robot.RFMotor.setPower(rightPower);
robot.RBMotor.setPower(rightPower);
robot.LBMotor.setPower(leftPower/4);
robot.LFMotor.setPower(leftPower/4);
robot.RFMotor.setPower(rightPower/4);
robot.RBMotor.setPower(rightPower/4);


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ else if(isButtonA) {
robot.Elevate.setPower(0);
}
}

//qwertyuiop

/*if (isDpadUp && !MRLimitSwitch.getState()){
robot.Elevate.setPower(.5);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package chawks.teleop;

import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DeviceInterfaceModule;
import com.qualcomm.robotcore.hardware.Gamepad;
//import chawks.hardware.ShootingController;

@TeleOp(name = "NextGenMakerFar", group = "StatesTeleOp")
//@Disabled
public class NextGenMakerFar extends AbstractTeleOpNextGen {
//A Digital Input.
//DigitalChannel MRLimitSwitch;
//CDI. Using this, we can read any digital sensor on this CDI without creating an instance for each sensor.

DeviceInterfaceModule cdi;

public void init() {
//telemetry.addData("Entering Init","YAy");
//telemetry.update();
super.init();
while (robot.LimitSwitch.getState() == true) {
//telemetry.addData("Resetting:","Encoder");
//telemetry.update();
robot.Elevate.setPower(-0.175);
/*if (opModeIsActive() == false) {
robot.Elevate.setPower(0);
return;
}*/
}
while (robot.LimitSwitchTilt.getState() == true) {
robot.Lift_Tilt.setPower(-0.4);
}
telemetry.addData("Switch touched Tilt", "o");
robot.Elevate.setPower(0);
robot.Lift_Tilt.setPower(0);
robot.Lift_Tilt.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
robot.Lift_Tilt.setMode(DcMotor.RunMode.RUN_TO_POSITION);
robot.Elevate.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
robot.Elevate.setMode(DcMotor.RunMode.RUN_TO_POSITION);
}

public float STRAFE_SPEED = 1.0F; //setting to a higher speed


@Override
public void handleGamePad1(Gamepad gamepad) {
double r = Math.hypot(gamepad.left_stick_x, gamepad.left_stick_y);
double robotAngle = Math.atan2(gamepad.left_stick_y, gamepad.left_stick_x) - Math.PI / 4;
double rightX = gamepad.right_stick_x;
final double v1 = r * Math.cos(robotAngle) - rightX;
final double v2 = r * Math.sin(robotAngle) + rightX;
final double v3 = r * Math.sin(robotAngle) - rightX;
final double v4 = r * Math.cos(robotAngle) + rightX;


robot.LFMotor.setPower(v3);
robot.RFMotor.setPower(v4);
robot.LBMotor.setPower(v1);
robot.RBMotor.setPower(v2);
}
public void handleGamePad2(Gamepad gamepad){

}


}

0 comments on commit 5681ae3

Please sign in to comment.