Skip to content

Commit

Permalink
AUTO: Final code for Iasi demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergiu Marton committed Jan 5, 2019
1 parent 3a48dc0 commit c2f08a4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ class AutoCrater : LinearOpMode() {
telemetry.addData("INIT", "over!")
telemetry.update()

waitForStart()
// waitForStart()
while (!opModeIsActive() && !isStopRequested) {
telemetry.addData("Status", "Waiting in Init")
telemetry.update()
}

imu.startAccelerationIntegration(Position(), Velocity(), 1000)

Expand Down Expand Up @@ -185,7 +189,7 @@ class AutoCrater : LinearOpMode() {
waitForSeconds(0.75)
goForwardOnAngle(time = 0.7, power=-0.45, angle=-135.0)
rotate(degrees = -(180.0 - 55.0), power = 0.34)
goForwardOnAngle(time = 1.2, power = -0.45, angle = 90.0)
goForwardOnAngle(time = 1.65, power = -0.35, angle = 90.0)

// ============================
waitForSeconds(0.2)
Expand All @@ -194,6 +198,7 @@ class AutoCrater : LinearOpMode() {
goForwardOnAngle(time = 1.35, power = -0.45, angle = 145.0)
dropTeamMarker()
waitForSeconds(0.5)
goForwardOnAngle(time = 0.1, power = 0.7, angle = 142.0)
goForwardOnAngle(time = 1.15, power = 0.5, angle = 142.0)
goForwardOnAngle(time = 1.2, power = 0.5, angle = 145.0)
letDownArm()
Expand All @@ -203,7 +208,7 @@ class AutoCrater : LinearOpMode() {
waitForSeconds(0.7)
goForwardOnAngle(time = 0.7, power = -0.45, angle = 180.0)
rotate(degrees = -90.0, power = 0.34)
goForwardOnAngle(time = 1.35, power = -0.45, angle = 90.0)
goForwardOnAngle(time = 1.6, power = -0.45, angle = 90.0)

// ============================
waitForSeconds(0.2)
Expand All @@ -212,16 +217,17 @@ class AutoCrater : LinearOpMode() {
goForwardOnAngle(time = 1.35, power = -0.45, angle = 143.0)
dropTeamMarker()
waitForSeconds(0.5)
goForwardOnAngle(time = 1.25, power = 0.5, angle = 142.0)
goForwardOnAngle(time = 1.35, power = 0.5, angle = 147.0)
goForwardOnAngle(time = 0.2, power = 0.8, angle = 142.0)
goForwardOnAngle(time = 1.1, power = 0.5, angle = 142.0)
goForwardOnAngle(time = 1.0, power = 0.5, angle = 147.0)
letDownArm()
}
3 -> {
goForwardOnAngle(time = 0.7, power = 0.45, angle = 145.0)
waitForSeconds(0.75)
goForwardOnAngle(time = 0.7, power = -0.45, angle = 147.0)
rotate(degrees = -55.0, power = 0.34)
goForwardOnAngle(time = 1.4, power = -0.45, angle = 90.0)
goForwardOnAngle(time = 1.8, power = -0.35, angle = 90.0)

// ============================
waitForSeconds(0.2)
Expand All @@ -230,8 +236,9 @@ class AutoCrater : LinearOpMode() {
goForwardOnAngle(time = 1.35, power = -0.45, angle = 145.0)
dropTeamMarker()
waitForSeconds(0.5)
goForwardOnAngle(time = 1.23, power = 0.5, angle = 142.0)
goForwardOnAngle(time = 1.2, power = 0.5, angle = 145.0)
goForwardOnAngle(time = 0.1, power = 0.7, angle = 142.0)
goForwardOnAngle(time = 1.13, power = 0.5, angle = 142.0)
goForwardOnAngle(time = 1.2, power = 0.5, angle = 149.0)
letDownArm()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ class AutoDepot : LinearOpMode() {
telemetry.addData("INIT", "over!")
telemetry.update()

waitForStart()


// waitForStart()
while (!opModeIsActive() && !isStopRequested) {
telemetry.addData("Status", "Waiting in Init")
telemetry.update()
}


imu.startAccelerationIntegration(Position(), Velocity(), 1000)

Expand Down Expand Up @@ -213,31 +220,31 @@ class AutoDepot : LinearOpMode() {
when (goldPos) {
3 -> {
rotate(degrees = -80.0, power = 0.34)
goForwardOnAngle(time = 1.4, power = -0.45, angle = 45.0)
goForwardOnAngle(time = 1.27, power = -0.45, angle = 45.0)
rotate(-80.0, power = 0.34)
dropTeamMarker()
letDownArm()
goForwardOnAngle(time = 0.6, power = 0.50, angle = -40.0)
liftIntake()
goForwardOnAngle(time = 0.75, power = 0.50, angle = -37.0)
goForwardOnAngle(time = 0.75, power = 0.50, angle = -40.0)
goForwardOnAngle(time = 0.65, power = 0.50, angle = -40.0)
}
2 -> {
rotate(degrees = 70.0, power = 0.34)
dropTeamMarker()
letDownArm()
goForwardOnAngle(time = 0.6, power = 0.6, angle = -45.0)
liftIntake()
goForwardOnAngle(time = 1.269, power = 0.55, angle = -40.0)
goForwardOnAngle(time = 1.35, power = 0.55, angle = -40.0)
}
1-> {
rotate(degrees = 85.0, power = 0.34)
goForwardOnAngle(time = 1.0, power = -0.45, angle = -42.0)
dropTeamMarker()
letDownArm()
goForwardOnAngle(time = 0.6, power = 0.55, angle = -40.0)
liftIntake()
goForwardOnAngle(time = 0.9, power = 0.55, angle = -40.0)
goForwardOnAngle(time = 1.1, power = 0.55, angle = -43.0)
letDownArm()
}
}

Expand Down

0 comments on commit c2f08a4

Please sign in to comment.