-
Notifications
You must be signed in to change notification settings - Fork 1
/
mission1_elevated_places.ts
54 lines (40 loc) · 1.27 KB
/
mission1_elevated_places.ts
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
53
54
// Add your code here
function mission1_elevated_places() {
mission1_setup();
mission1_aligntoramp();
mission1_prepareforlaunch();
mission1_climbramp();
}
function mission1_prepareforlaunch() {
motors.largeBC.stop();
motors.largeBC.reset();
motors.largeBC.tank(-10, -10, 1.5, MoveUnit.Rotations);
}
function mission1_aligntoramp() {
// Approach line
motors.largeBC.tank(30, 30, 1.5, MoveUnit.Rotations);
//linefollow(10, 160);
linefollow_test(10, 160, 0, 0, -.2, .02, .66);
motors.largeBC.stop();
// move forward
motors.largeBC.tank(20, 21, 1.2, MoveUnit.Rotations);
// turn to ramp
motors.largeBC.tank(-20, 20, .45, MoveUnit.Rotations);
// Forward half second
motors.largeBC.tank(10, 10, .5, MoveUnit.Seconds);
// Approach ramp
//linefollow(10, 0, 0, 15);
linefollow_test(10, 0, 0, 15, -.2, .02, .66);
// // Use lip of ramp to align
// motors.largeBC.tank(30, 30, 1.5, MoveUnit.Seconds);
// motors.largeBC.tank(-10, -10, 1, MoveUnit.Seconds);
pause(500);
}
function mission1_setup() {
motors.largeBC.reset();
}
function mission1_climbramp() {
motors.largeBC.tank(100, 100, 2, MoveUnit.Rotations);
motors.largeBC.stop();
motors.largeBC.tank(23, 20, 3, MoveUnit.Rotations);
}