-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinishdrive.txt
91 lines (81 loc) · 3.81 KB
/
finishdrive.txt
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
///////////////
// FinishDrive
// -----------
// prints some lovely stats
///////////////////////////
set driveTime to floor(time:seconds - driveTimeBegin).
set days to 0.
set hours to 0.
set minutes to 0.
if driveTime >= 86400 {
set days to floor(driveTime / 86400).
set driveTime to driveTime - (days * 86400).
}.
if driveTime >= 3600 {
set hours to floor(driveTime / 3600).
set driveTime to driveTime - (hours * 3600).
}.
if driveTime >= 60 {
set minutes to floor(driveTime / 60).
set driveTime to driveTime - (minutes * 60).
}.
set seconds to driveTime.
set avgSpeedResult to 0.
for speed in avgSpeed {
set avgSpeedResult to avgSpeedResult + speed.
}.
set avgSpeedResult to avgSpeedResult / avgSpeed:length.
clearscreen.
print "=================================================".
print "|---------------Rover Variables-----------------|".
print "| |".
print "| currentBrakeTime: 00.0 currentSpeed: 00.00 |".
print "| currentOverspeed: 00.0 currentSlopeType: 0 |".
print "| currentWaypoint: 0/0 brakeUseCount: 0 |".
print "| currentSlopeAngle: -00.00 abortDrive: False |".
print "| |".
print "|------------Environment Information------------|".
print "| |".
print "| Height over ground: 0.00m |".
print "| Surface speed: 0.00m/s |".
print "| Distance remaining to target: 0.00m |".
print "| ETA: 0h 0m |".
print "| |".
print "|--------------Recent Log Entries---------------|".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "| |".
print "|===============================================|".
print "Rover Driver v1.0 (c)Drew Kerman".
if abortDrive = true {
print "|---------------Drive Aborted!------------------|" at (0,15).
} else {
print "|--------------Drive Completed!-----------------|" at (0,15).
}.
print "Distance driven: " + round(driveDistance, 2) + "m" at (2,17).
print "Time to destination: " + days + "d, " + hours + "h:" + minutes + "m:" + seconds + "s" at (2,18).
print "Average speed: " + round(avgSpeedResult,2) + "m/s" at (2,19).
print "Highest speed: " + round(highSpeed, 2) + "m/s" at (2,20).
print "Greatest upslope angle: " + round(maxUpslope, 2) + "°" at (2,21).
print "Greatest downslope angle: " + round(maxDownslope, 2) + "°" at (2,22).
print "Brakes were applied " + brakeUseCount + " times" at (2,23).
print "Wheels left the ground " + numAirtime + " times" at (2,24).
print "Total air time: " + round(amountAirTime, 2) + "s" at (2,25).
print "Highest air: " + round(maxAirHeight, 2) + "m" at (2,26).
print "Highest altitude: " + round(maxAltitude, 2) + "m" at (2,27).
print "Lowest altitude: " + round(minAltitude, 2) + "m" at (2,28).
print "Total change altitude: " + (round(maxAltitude, 2) - round(minAltitude, 2)) + "m" at (2,29).
abort on.