-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAutonomousBlue.kt
More file actions
52 lines (44 loc) · 1.58 KB
/
AutonomousBlue.kt
File metadata and controls
52 lines (44 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package org.firstinspires.ftc.teamcode
import com.qualcomm.ftccommon.SoundPlayer
import com.qualcomm.robotcore.eventloop.opmode.Autonomous
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
import org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit
import kotlin.concurrent.thread
@Autonomous(name = "Autonomous Blue", group = "Linear Opmode")
class AutonomousBlue : LinearOpMode() {
var robot = Hardware(hardwareMap)
var auto = AutoMovement(robot, this)
override fun runOpMode() {
/*
robot.init(hardwareMap)
auto.armGrab()
waitForStart()
Thread.sleep(10000)
auto.armRaise(AutoMovement.Position.TOP)
auto.moveToDistance(40.0, 0.2)
auto.armRelease()
auto.moveToDistance(5.0, 0.2)
*/
/*
auto.armGrab()
*/
waitForStart()
/*auto.ducksStart(-1.0)
auto.robotTranslate(0.4, AutoMovement.Direction.RIGHT)
telemetry.addData("right:", robot.distanceSensorRight!!.getDistance(DistanceUnit.CM))
telemetry.update()
while (robot.distanceSensorRight!!.getDistance(DistanceUnit.CM) > 7 && !isStopRequested) {
}
// auto.robotStop()*/
/*
auto.robotTranslate(0.6, AutoMovement.Direction.LEFT)
while (!isStopRequested) {
telemetry.addData("left:", robot.distanceSensorRight!!.getDistance(DistanceUnit.CM))
telemetry.update()
} */
auto.armRaise(AutoMovement.Position.TOP)
auto.robotTranslate(0.6, AutoMovement.Direction.LEFT)
while (!isStopRequested) {
}
}
}