#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;
}













