Skip to content

Science/altitudeServo_approach_backseat_poweronly_blockisland.tl

   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
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
#   Copyright (c) 2024 MBARI
#   MBARI Proprietary Information. Confidential. All Rights Reserved
#   Unauthorized copying or distribution of this file via any medium is strictly
#   prohibited.
#
#   WARNING - This file contains information whose export is restricted by the
#   Export Administration Act of 1979 (Title 50, U.S.C., App. 2401 et seq.), as
#   amended. Violations of these export laws are subject to severe civil and/or
#   criminal penalties.

mission altitudeServo_approach_backseat_poweronly_blockisland {
  """
  The vehicle will transit to an initial waypoint, then navigate to
  waypoints while maintaining altitude. During the altitude following
  phase of the mission, the vehicle descends from the surface to a
  commanded depth using a spiral dive (e.g., after NeedComms).
  """

  arguments {
    MissionTimeout = 12 hour
      """
      Maximum duration of mission
      """

    NeedCommsTime = 180 minute
      """
      How often to surface for commumications
      """

    TransitLat = NaN degree
      """
      Latitude of tranist waypoint. Transit is skipped if set to NaN.
      """

    TransitLon = NaN degree
      """
      Longitude of tranist waypoint. Transit is skipped if set to NaN.
      """

    TransitDepth = 10 meter
      """
      Depth of flat and level flight during the transit part of the mission.
      """

    ApproachDepthRate = 0.025 meter_per_second
      """
      Descent depth rate (Positive depth rate means going down).
      """

    Repeat = 1 count
      """
      Number of times the vehicle should try to cycle through waypoints.
      """

    Lon1 = -71.40734 degree
      """
      Longitude of waypoint 1. If nan, waypoint is skipped.
      """

    Lat1 = 40.99866 degree
      """
      Latitude of waypoint 1. If nan, waypoint is skipped.
      """

    Lon2 = -71.41768 degree
      """
      Longitude of waypoint 2. If nan, waypoint is skipped.
      """

    Lat2 = 40.95438 degree
      """
      Latitude of waypoint 2. If nan, waypoint is skipped.
      """

    Lon3 = -71.42003 degree
      """
      Longitude of waypoint 3. If nan, waypoint is skipped.
      """

    Lat3 = 40.95469 degree
      """
      Latitude of waypoint 3. If nan, waypoint is skipped.
      """

    Lon4 = -71.40968 degree
      """
      Longitude of waypoint 4. If nan, waypoint is skipped.
      """

    Lat4 = 40.99897 degree
      """
      Latitude of waypoint 4. If nan, waypoint is skipped.
      """

    Lon5 = -71.41203 degree
      """
      Longitude of waypoint 5. If nan, waypoint is skipped.
      """

    Lat5 = 40.99928 degree
      """
      Latitude of waypoint 5. If nan, waypoint is skipped.
      """

    Lon6 = -71.42237 degree
      """
      Longitude of waypoint 6. If nan, waypoint is skipped.
      """

    Lat6 = 40.955 degree
      """
      Latitude of waypoint 6. If nan, waypoint is skipped.
      """

    Lon7 = -71.42472 degree
      """
      Longitude of waypoint 7. If nan, waypoint is skipped.
      """

    Lat7 = 40.95531 degree
      """
      Latitude of waypoint 7. If nan, waypoint is skipped.
      """

    Lon8 = -71.41437 degree
      """
      Longitude of waypoint 8. If nan, waypoint is skipped.
      """

    Lat8 = 40.99959 degree
      """
      Latitude of waypoint 8. If nan, waypoint is skipped.
      """

    Lon9 = -71.41672 degree
      """
      Longitude of waypoint 9. If nan, waypoint is skipped.
      """

    Lat9 = 40.9999 degree
      """
      Latitude of waypoint 9. If nan, waypoint is skipped.
      """

    Lon10 = -71.42706 degree
      """
      Longitude of waypoint 10. If nan, waypoint is skipped.
      """

    Lat10 = 40.95562 degree
      """
      Latitude of waypoint 10. If nan, waypoint is skipped.
      """

    Lon11 = -71.42941 degree
      """
      Longitude of waypoint 11. If nan, waypoint is skipped.
      """

    Lat11 = 40.95593 degree
      """
      Latitude of waypoint 11. If nan, waypoint is skipped.
      """

    Lon12 = -71.41906 degree
      """
      Longitude of waypoint 12. If nan, waypoint is skipped.
      """

    Lat12 = 41.00021 degree
      """
      Latitude of waypoint 12. If nan, waypoint is skipped.
      """

    Lon13 = -71.42141 degree
      """
      Longitude of waypoint 13. If nan, waypoint is skipped.
      """

    Lat13 = 41.00052 degree
      """
      Latitude of waypoint 13. If nan, waypoint is skipped.
      """

    Lon14 = -71.43175 degree
      """
      Longitude of waypoint 14. If nan, waypoint is skipped.
      """

    Lat14 = 40.95624 degree
      """
      Latitude of waypoint 14. If nan, waypoint is skipped.
      """

    Lon15 = -71.4341 degree
      """
      Longitude of waypoint 15. If nan, waypoint is skipped.
      """

    Lat15 = 40.95655 degree
      """
      Latitude of waypoint 15. If nan, waypoint is skipped.
      """

    Lon16 = -71.42375 degree
      """
      Longitude of waypoint 16. If nan, waypoint is skipped.
      """

    Lat16 = 41.00083 degree
      """
      Latitude of waypoint 16. If nan, waypoint is skipped.
      """

    Lon17 = -71.4261 degree
      """
      Longitude of waypoint 17. If nan, waypoint is skipped.
      """

    Lat17 = 41.00114 degree
      """
      Latitude of waypoint 17. If nan, waypoint is skipped.
      """

    Lon18 = -71.43644 degree
      """
      Longitude of waypoint 18. If nan, waypoint is skipped.
      """

    Lat18 = 40.95686 degree
      """
      Latitude of waypoint 18. If nan, waypoint is skipped.
      """

    Lon19 = -71.43879 degree
      """
      Longitude of waypoint 19. If nan, waypoint is skipped.
      """

    Lat19 = 40.95717 degree
      """
      Latitude of waypoint 19. If nan, waypoint is skipped.
      """

    Lon20 = -71.42844 degree
      """
      Longitude of waypoint 20. If nan, waypoint is skipped.
      """

    Lat20 = 41.00145 degree
      """
      Latitude of waypoint 20. If nan, waypoint is skipped.
      """

    Lon21 = -71.43079 degree
      """
      Longitude of waypoint 21. If nan, waypoint is skipped.
      """

    Lat21 = 41.00176 degree
      """
      Latitude of waypoint 21. If nan, waypoint is skipped.
      """

    Lon22 = -71.44113 degree
      """
      Longitude of waypoint 22. If nan, waypoint is skipped.
      """

    Lat22 = 40.95748 degree
      """
      Latitude of waypoint 22. If nan, waypoint is skipped.
      """

    Lon23 = -71.44348 degree
      """
      Longitude of waypoint 23. If nan, waypoint is skipped.
      """

    Lat23 = 40.95779 degree
      """
      Latitude of waypoint 23. If nan, waypoint is skipped.
      """

    Lon24 = -71.43313 degree
      """
      Longitude of waypoint 24. If nan, waypoint is skipped.
      """

    Lat24 = 41.00207 degree
      """
      Latitude of waypoint 24. If nan, waypoint is skipped.
      """

    Lon25 = -71.43548 degree
      """
      Longitude of waypoint 25. If nan, waypoint is skipped.
      """

    Lat25 = 41.00238 degree
      """
      Latitude of waypoint 25. If nan, waypoint is skipped.
      """

    Lon26 = -71.44582 degree
      """
      Longitude of waypoint 26. If nan, waypoint is skipped.
      """

    Lat26 = 40.9581 degree
      """
      Latitude of waypoint 26. If nan, waypoint is skipped.
      """

    Lon27 = -71.44817 degree
      """
      Longitude of waypoint 27. If nan, waypoint is skipped.
      """

    Lat27 = 40.95841 degree
      """
      Latitude of waypoint 27. If nan, waypoint is skipped.
      """

    Lon28 = -71.43782 degree
      """
      Longitude of waypoint 28. If nan, waypoint is skipped.
      """

    Lat28 = 41.00269 degree
      """
      Latitude of waypoint 28. If nan, waypoint is skipped.
      """

    Lon29 = -71.44017 degree
      """
      Longitude of waypoint 29. If nan, waypoint is skipped.
      """

    Lat29 = 41.003 degree
      """
      Latitude of waypoint 29. If nan, waypoint is skipped.
      """

    Lon30 = -71.45051 degree
      """
      Longitude of waypoint 30. If nan, waypoint is skipped.
      """

    Lat30 = 40.95872 degree
      """
      Latitude of waypoint 30. If nan, waypoint is skipped.
      """

    Lon31 = -71.45286 degree
      """
      Longitude of waypoint 31. If nan, waypoint is skipped.
      """

    Lat31 = 40.95903 degree
      """
      Latitude of waypoint 31. If nan, waypoint is skipped.
      """

    Lon32 = -71.44251 degree
      """
      Longitude of waypoint 32. If nan, waypoint is skipped.
      """

    Lat32 = 41.00331 degree
      """
      Latitude of waypoint 32. If nan, waypoint is skipped.
      """

    Lon33 = -71.44486 degree
      """
      Longitude of waypoint 33. If nan, waypoint is skipped.
      """

    Lat33 = 41.00362 degree
      """
      Latitude of waypoint 33. If nan, waypoint is skipped.
      """

    Lon34 = -71.4552 degree
      """
      Longitude of waypoint 34. If nan, waypoint is skipped.
      """

    Lat34 = 40.95934 degree
      """
      Latitude of waypoint 34. If nan, waypoint is skipped.
      """

    Lon35 = -71.45755 degree
      """
      Longitude of waypoint 35. If nan, waypoint is skipped.
      """

    Lat35 = 40.95965 degree
      """
      Latitude of waypoint 35. If nan, waypoint is skipped.
      """

    Lon36 = -71.4472 degree
      """
      Longitude of waypoint 36. If nan, waypoint is skipped.
      """

    Lat36 = 41.00393 degree
      """
      Latitude of waypoint 36. If nan, waypoint is skipped.
      """

    Lon37 = -71.44955 degree
      """
      Longitude of waypoint 37. If nan, waypoint is skipped.
      """

    Lat37 = 41.00424 degree
      """
      Latitude of waypoint 37. If nan, waypoint is skipped.
      """

    Lon38 = -71.45989 degree
      """
      Longitude of waypoint 38. If nan, waypoint is skipped.
      """

    Lat38 = 40.95996 degree
      """
      Latitude of waypoint 38. If nan, waypoint is skipped.
      """

    Lon39 = -71.46224 degree
      """
      Longitude of waypoint 39. If nan, waypoint is skipped.
      """

    Lat39 = 40.96027 degree
      """
      Latitude of waypoint 39. If nan, waypoint is skipped.
      """

    Lon40 = -71.45189 degree
      """
      Longitude of waypoint 40. If nan, waypoint is skipped.
      """

    Lat40 = 41.00455 degree
      """
      Latitude of waypoint 40. If nan, waypoint is skipped.
      """

    Lon41 = -71.45424 degree
      """
      Longitude of waypoint 41. If nan, waypoint is skipped.
      """

    Lat41 = 41.00486 degree
      """
      Latitude of waypoint 41. If nan, waypoint is skipped.
      """

    Lon42 = -71.46458 degree
      """
      Longitude of waypoint 42. If nan, waypoint is skipped.
      """

    Lat42 = 40.96058 degree
      """
      Latitude of waypoint 42. If nan, waypoint is skipped.
      """

    Lon43 = -71.46693 degree
      """
      Longitude of waypoint 43. If nan, waypoint is skipped.
      """

    Lat43 = 40.96089 degree
      """
      Latitude of waypoint 43. If nan, waypoint is skipped.
      """

    Lon44 = -71.45658 degree
      """
      Longitude of waypoint 44. If nan, waypoint is skipped.
      """

    Lat44 = 41.00517 degree
      """
      Latitude of waypoint 44. If nan, waypoint is skipped.
      """

    Lon45 = -71.45893 degree
      """
      Longitude of waypoint 45. If nan, waypoint is skipped.
      """

    Lat45 = 41.00548 degree
      """
      Latitude of waypoint 45. If nan, waypoint is skipped.
      """

    Lon46 = -71.46927 degree
      """
      Longitude of waypoint 46. If nan, waypoint is skipped.
      """

    Lat46 = 40.9612 degree
      """
      Latitude of waypoint 46. If nan, waypoint is skipped.
      """

    Lon47 = -71.47162 degree
      """
      Longitude of waypoint 47. If nan, waypoint is skipped.
      """

    Lat47 = 40.96151 degree
      """
      Latitude of waypoint 47. If nan, waypoint is skipped.
      """

    Lon48 = -71.46127 degree
      """
      Longitude of waypoint 48. If nan, waypoint is skipped.
      """

    Lat48 = 41.00579 degree
      """
      Latitude of waypoint 48. If nan, waypoint is skipped.
      """

    Lon49 = -71.46362 degree
      """
      Longitude of waypoint 49. If nan, waypoint is skipped.
      """

    Lat49 = 41.0061 degree
      """
      Latitude of waypoint 49. If nan, waypoint is skipped.
      """

    Lon50 = -71.47396 degree
      """
      Longitude of waypoint 50. If nan, waypoint is skipped.
      """

    Lat50 = 40.96182 degree
      """
      Latitude of waypoint 50. If nan, waypoint is skipped.
      """

    HoldAltitude = 2.2 meter
      """
      Desired vehicle altitude to maintain.
      """

    InvalidAltitudeTimeout = NaN minute
      """
      The mission will abort if no valid altitude readings are received within
      this specified time duration. Set this variable to NaN to disable this
      timeout functionality.
      """

    AltitudeIIRFilterDecay = 0.2 none
      """
      AltitudeServo single-pole IIR filter decay value.
      Low-pass filters the AltitudeServo depth command.
      The Decay value should be btween 0 to 1, set to 0 disable filtering.
      """

    InitDepth = 50 meter
      """
      Initial depth. The vehicle will spiral dive to this depth when leaving
      the surface. Necessary if no altitude reading is available form the
      surface (e.g., when the bottom is out of DVL range).
      """

    InitDepthTimeout = 45 minute
      """
      Maximum time duration for the vehicle to reach the initial depth. The
      vehicle will switch over to altitude following after the timeout is
      expired.
      """

    Speed = 1 meter_per_second
      """
      Thruster speed for the entier mission.
      """

    DepthDeadband = 0.0 meter

    MinAltitude = 1.2 meter
      """
      Minimum height above the sea floor for the entire mission.
      """

    MaxDepth = 205 meter
      """
      Maximum depth for the entire mission.
      """

    MinOffshore = 1 kilometer
      """
      Minimum offshore distance for the entire mission.
      """

    PowerBackseat = 1 bool
      """
      Enable the backseat for this mission
      """
  }

  output {
    DoingComms = false
      """
      Mission variable (don't change). The mission sets this to true *before*
      the vehicle surfaces for comms.
      """

    StartFromSurface = true
      """
      Mission variable (don't change). The mission sets this to true *after*
      the vehicle surfaces for comms.
      """
  }

  # Mission timeout

  timeout duration=MissionTimeout

  # Safety nets and surfacing behaviors

  insert Insert/StandardEnvelopes.tl

  assign in sequence StandardEnvelopes:MinAltitude = MinAltitude
  assign in sequence StandardEnvelopes:MaxDepth = MaxDepth
  assign in sequence StandardEnvelopes:MinOffshore = MinOffshore
  insert id="NeedComms" Insert/NeedComms.tl

  assign in sequence NeedComms:DiveInterval = MissionTimeout
  assign in sequence NeedComms:WaitForPitchUp = 0 minute

  aggregate SurfaceComms {
    run when (
      called
      or elapsed ( Universal:time_fix ) > NeedCommsTime
    )

    assign in sequence DoingComms = true
    call refId="NeedComms"
    assign in sequence DoingComms = false
    assign in sequence StartFromSurface = true
  }

  # Set default mass and VBS positions

  behavior Guidance:Mass {
    run in parallel

    set position = Control:VerticalControl.massDefault
  }

  behavior Guidance:Buoyancy {
    run in parallel

    set position = Control:VerticalControl.buoyancyNeutral
  }

  # Callable aggregates (priority matters, so these are done below important safety directives like StandardEnvelopes).

  aggregate DiveCmd {
    run when ( called )

    aggregate SpiralDive {
      """
      Spiral down from the surface to initial depth. Necessary when no
      altitude reading is available form the surface.
      """

      run while (
        StartFromSurface
        and not ( DoingComms )
      )

      break if (
        Universal:height_above_sea_floor <= HoldAltitude
      )

      aggregate dive {
        run in sequence

        behavior Guidance:SetSpeed {
          run in parallel

          set speed = Speed
        }

        behavior Guidance:Point {
          run in parallel

          set rudderAngle = 13 degree
        }

        behavior Guidance:Pitch {
          run in sequence

          timeout duration=InitDepthTimeout {
            syslog important "Timed out at current depth of " + Universal:depth~meter
                 + ". Switching to altitude servo."

            assign in sequence StartFromSurface = false
          }

          set depth = InitDepth

          set depthRate = ApproachDepthRate
        }

        assign in sequence StartFromSurface = false
      }
    }

    aggregate BreakOnAltitude {
      run when (
        Universal:height_above_sea_floor <= HoldAltitude
        and ( StartFromSurface )
      )

      syslog important "Ending dive at current depth of " + Universal:depth~meter
           + " based on altitude " + Universal:height_above_sea_floor~meter + " and HoldAltitude "
           + HoldAltitude~meter + ". Switching to altitude servo."
      assign in sequence StartFromSurface = false
    }

    aggregate AltitudeServo {
      """
      Follow commanded altitude.
      """

      run while (
        not ( StartFromSurface )
        and not ( DoingComms )
      )

      aggregate dive {
        run in parallel

        assign in parallel Control:VerticalControl.depthDeadband = DepthDeadband

        behavior Guidance:SetSpeed {
          run in parallel

          set speed = Speed
        }

        behavior Guidance:AltitudeServo {
          run in parallel

          set targetAltitude = HoldAltitude

          set invalidAltitudeTimeout = InvalidAltitudeTimeout

          set iirFilterDecay = AltitudeIIRFilterDecay
        }
      }
    }
  }

  # Mission

  call id="StartingMission" refId="SurfaceComms"
  # Fire up science sensors

  insert Insert/Science.tl

  # Power up backseat
  insert Insert/BackseatDriver.tl
  assign in sequence BackseatDriver:EnableBackseat = PowerBackseat

  insert Insert/PowerOnly.tl
  assign in sequence PowerOnly:SampleLoad1 = true
  assign in sequence PowerOnly:SampleLoad2 = true
  syslog important "Powering Strobes, Cameras, and Altimeter"

  # Run

  aggregate Transit {
    """
    Transit flat and level to the starting waypoint at a fixed depth
    (skipped when transit Lat/Lon are set to NaN).
    """

    run in sequence

    break if (
      isNaN ( TransitLat )
      or isNaN ( TransitLon )
    )

    behavior Guidance:SetSpeed {
      run in parallel

      set speed = Speed
    }

    behavior Guidance:Pitch {
      run in parallel

      set depth = TransitDepth
    }

    behavior Guidance:Waypoint id="TransitWpt" {
      run in sequence

      set latitude = TransitLat

      set longitude = TransitLon
    }

    call refId="SurfaceComms"
  }

  aggregate Lap {
    run in sequence repeat=Repeat

    aggregate Dive {
      run while ( not ( DoingComms ) )

      call refId="DiveCmd"
    }

    aggregate Wpt1 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat1

        set longitude = Lon1
      }
    }

    aggregate Wpt2 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat2

        set longitude = Lon2
      }
    }

    aggregate Wpt3 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat3

        set longitude = Lon3
      }
    }

    aggregate Wpt4 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat4

        set longitude = Lon4
      }
    }

    aggregate Wpt5 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat5

        set longitude = Lon5
      }
    }

    aggregate Wpt6 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat6

        set longitude = Lon6
      }
    }

    aggregate Wpt7 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat7

        set longitude = Lon7
      }
    }

    aggregate Wpt8 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat8

        set longitude = Lon8
      }
    }

    aggregate Wpt9 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat9

        set longitude = Lon9
      }
    }

    aggregate Wpt10 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat10

        set longitude = Lon10
      }
    }

    aggregate Wpt11 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat11

        set longitude = Lon11
      }
    }

    aggregate Wpt12 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat12

        set longitude = Lon12
      }
    }

    aggregate Wpt13 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat13

        set longitude = Lon13
      }
    }

    aggregate Wpt14 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat14

        set longitude = Lon14
      }
    }

    aggregate Wpt15 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat15

        set longitude = Lon15
      }
    }

    aggregate Wpt16 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat16

        set longitude = Lon16
      }
    }

    aggregate Wpt17 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat17

        set longitude = Lon17
      }
    }

    aggregate Wpt18 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat18

        set longitude = Lon18
      }
    }

    aggregate Wpt19 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat19

        set longitude = Lon19
      }
    }

    aggregate Wpt20 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat20

        set longitude = Lon20
      }
    }

    aggregate Wpt21 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat21

        set longitude = Lon21
      }
    }

    aggregate Wpt22 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat22

        set longitude = Lon22
      }
    }

    aggregate Wpt23 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat23

        set longitude = Lon23
      }
    }

    aggregate Wpt24 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat24

        set longitude = Lon24
      }
    }

    aggregate Wpt25 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat25

        set longitude = Lon25
      }
    }

    aggregate Wpt26 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat26

        set longitude = Lon26
      }
    }

    aggregate Wpt27 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat27

        set longitude = Lon27
      }
    }

    aggregate Wpt28 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat28

        set longitude = Lon28
      }
    }

    aggregate Wpt29 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat29

        set longitude = Lon29
      }
    }

    aggregate Wpt30 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat30

        set longitude = Lon30
      }
    }

    aggregate Wpt31 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat31

        set longitude = Lon31
      }
    }

    aggregate Wpt32 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat32

        set longitude = Lon32
      }
    }

    aggregate Wpt33 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat33

        set longitude = Lon33
      }
    }

    aggregate Wpt34 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat34

        set longitude = Lon34
      }
    }

    aggregate Wpt35 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat35

        set longitude = Lon35
      }
    }

    aggregate Wpt36 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat36

        set longitude = Lon36
      }
    }

    aggregate Wpt37 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat37

        set longitude = Lon37
      }
    }

    aggregate Wpt38 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat38

        set longitude = Lon38
      }
    }

    aggregate Wpt39 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat39

        set longitude = Lon39
      }
    }

    aggregate Wpt40 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat40

        set longitude = Lon40
      }
    }

    aggregate Wpt41 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat41

        set longitude = Lon41
      }
    }

    aggregate Wpt42 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat42

        set longitude = Lon42
      }
    }

    aggregate Wpt43 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat43

        set longitude = Lon43
      }
    }

    aggregate Wpt44 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat44

        set longitude = Lon44
      }
    }

    aggregate Wpt45 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat45

        set longitude = Lon45
      }
    }

    aggregate Wpt46 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat46

        set longitude = Lon46
      }
    }

    aggregate Wpt47 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat47

        set longitude = Lon47
      }
    }

    aggregate Wpt48 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat48

        set longitude = Lon48
      }
    }

    aggregate Wpt49 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat49

        set longitude = Lon49
      }
    }

    aggregate Wpt50 {
      run in sequence

      behavior Guidance:Waypoint {
        run in sequence

        set latitude = Lat50

        set longitude = Lon50
      }
    }

    call id="PhoneHome" refId="SurfaceComms"
  }
}