#define YOYO_MIN_ALTITUDE 7.5
#define MISSION_SPEED 1.75

# mission timer set to 120% of estimated time of mission
behavior missionTimer {
timeOut = 44000;
}

# depth envelope set to commanded + 5 m, abort at commanded + 10
behavior depthEnvelope {
 minDepth = 0;
 maxDepth     = 105;
 abortDepth   = 120;
 abortAltitude  = 2.5;
}

# Eighth leg of run to waypoint E5
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# FINAL waypoint behavior to waypoint D1 40.5km down line, at 60m isobath
#N36 37.500 W121 52.500
#maximum depth 50m?
#maximum water depth 500m
behavior waypoint_yoyo {
latitude     = 36.625;
longitude     = -121.875;
captureRadius = 10;
duration     = 700;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 40;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 138;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 138;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# Eighth leg of run to waypoint E5
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# waypoint behavior to waypoint 40.5km down line, at 60m isobath
#waypoint E1M1D1_12
#N36 37.9265 W121 52.9748
#maximum depth 50m?
#maximum water depth 500m
behavior waypoint_yoyo {
latitude     = 36.6321;
longitude     = -121.8829;
captureRadius = 10;
duration     = 700;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 60;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 138;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 138;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# Eighth leg of run to waypoint E5
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# waypoint behavior to waypoint 39500 down line E1M1D1_11
#N36 38.2707 W121 53.3560
#maximum depth 50m?
#maximum water depth 500m
behavior waypoint_yoyo {
latitude     = 36.6378;
longitude     = -121.8893;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 70;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 138;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 138;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# Eighth leg of run to waypoint E5
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# waypoint behavior to waypoint 36000 down line to E1M1D1_10
#N36 39.6758 W121 54.9244
#maximum depth 50m?
#maximum water depth 500m
behavior waypoint_yoyo {
latitude     = 36.6613;
longitude     = -121.9154;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 138;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 138;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# Eighth leg of run to waypoint E5
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# waypoint behavior to waypoint 32500 down line E1M1D1_9
#N36 41.0647 W121 56.480
#maximum depth 50m?
#maximum water depth 500m
behavior waypoint_yoyo {
latitude     = 36.6844;
longitude     = -121.9413;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 138;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 138;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# Eighth leg of run to waypoint E5
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# waypoint behavior to waypoint 29000 down line E1M1D1_8
#N36 42.4850 W121 58.0701
#maximum water depth 500m
behavior waypoint_yoyo {
latitude     = 36.7081;
longitude     = -121.9678;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 138;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 138;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# Eighth leg of run to waypoint E5
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# waypoint behavior to waypoint 25500 down line to E1M1D1_7
#N36 43.8558 W121 59.6039
#maximum water depth 500m
behavior waypoint_yoyo {
latitude     = 36.73093;
longitude     = -121.9934;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 138;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 138;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# Seventh leg of run to waypoint M1
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# finally, waypoint behavior DIRECTLY to waypoint M1 - 1300m run
# N36 45.2 W122 1.112
behavior waypoint_yoyo {
latitude     = 36.7533;
longitude     = -122.0185;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 208;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 208;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# Sixth leg of run to waypoint M1
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# leg 6 - waypoint behavior to 20800m point down line to E1M1D1_6
# N36 45.827 W 122 00.687
#maximum depth 800m
behavior waypoint_yoyo {
latitude     = 36.7638;
longitude     = -122.0115;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 208;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 208;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# Leg 5 waypoint behavior to waypoint 17500m down line to E1M1D1_5
# N36 47.487 W121 59.581
#maxumum depth 500m
behavior waypoint_yoyo {
latitude     = 36.7915;
longitude     = -121.9930;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 208;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 208;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}


# Fourth leg of run to waypoint M1
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# Leg 4 waypoint behavior to waypoint 14000m down line E1M1D1_4
#N36 49.155 W121 58.460
#max depth 200m
behavior waypoint_yoyo {
latitude     = 36.8193;
longitude     = -121.9743;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 208;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 208;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# Leg 4 waypoint behavior to waypoint 10500m down range E1M1D1_3
#N36 50.844 W121 57.330
#max depth 26m
behavior waypoint_yoyo {
latitude     = 36.8474;
longitude     = -121.9555;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 100;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 208;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 208;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}


# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# Leg 3 waypoint behavior to waypoint 7000m down line to E1M1D1_2
#N36 52.491 W121 56.225
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.8749;
longitude     = -121.9371;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 50;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 207;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 207;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}


# First leg of run to waypoint Mooring-1 (aiming for intermediate point)
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

# Leg 2 waypoint behavior to waypoint 3500m down line E1M1D1_1
#N36 54.174 W121 55.093
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.9029;
longitude     = -121.9182;
captureRadius = 10;
duration     = 2600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 28;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 208;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 208;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 60;
abortOnTimeout = True;
}














