#define YOYO_MIN_ALTITUDE 10
#define MISSION_YOYO_MIN_DEPTH 2
#define MISSION_YOYO_MAX_DEPTH 35
#define MISSION_YOYO_MAX_DEPTH_SHALLOW 20
#define MISSION_SPEED 1.5
#define MISSION_SPEED_SLOW 1.5


#should be 18 hour mission, set timer to 24 hours
#set timeout in seconds
behavior missionTimer {
timeOut = 86400;
}

behavior depthEnvelope {
  minDepth = 0;
  maxDepth = 35;
  abortDepth = 45;
  abortAltitude = 2.5;
  abortLockoutDepth = 10.0;
}


# acquire gps fix
behavior getgps {
duration = 5000;
minHits = 3600;
abortOnTimeout = True;
}


#end of third lap
# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#fourth & final leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth 75 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#third leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~60 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#second leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~40 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#first leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~30 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Third & final leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3000 meters
#water depth 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#second leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3000 meters
#water depth 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 22;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#first leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3080 meters
#water depth 20 meters to 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 22;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior - do a rudder ascend at waypoint ESPBruce
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Third & final leg from waypoint ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 1600 meters
#water depth 30 meters to 20 meters
behavior waypoint_yoyo {
latitude     = 36.900;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25.0;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}


# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 11;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Second leg from waypoint ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 2900 meters
#water depth 50 meters to 30 meters
behavior waypoint_yoyo {
latitude     = 36.900;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 11;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#First leg from ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 2900 meters
#water depth 73 meters to 50 meters
behavior waypoint_yoyo {
latitude     = 36.9000;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}
#beginning of third lap

#end of second lap
# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#fourth & final leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth 75 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#third leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~60 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#second leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~40 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#first leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~30 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Third & final leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3000 meters
#water depth 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#second leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3000 meters
#water depth 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 22;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#first leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3080 meters
#water depth 20 meters to 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 22;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior - do a rudder ascend at waypoint ESPBruce
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Third & final leg from waypoint ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 1600 meters
#water depth 30 meters to 20 meters
behavior waypoint_yoyo {
latitude     = 36.900;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25.0;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}


# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 11;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Second leg from waypoint ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 2900 meters
#water depth 50 meters to 30 meters
behavior waypoint_yoyo {
latitude     = 36.900;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 11;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#First leg from ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 2900 meters
#water depth 73 meters to 50 meters
behavior waypoint_yoyo {
latitude     = 36.9000;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}
#beginning of second lap

#end of first lap
# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#fourth & final leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth 75 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#third leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~60 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#second leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~40 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 147;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#first leg from waypoint ESPmoe back to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 3000 meters
#water depth ~30 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 147;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 147;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Third & final leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3000 meters
#water depth 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#second leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3000 meters
#water depth 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 22;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#first leg from waypoint ESPbruce to waypoint ESPmoe
#N36.9272 W121.9734
#leg distance 3080 meters
#water depth 20 meters to 25 meters
behavior waypoint_yoyo {
latitude     = 36.9272;
longitude     = -121.9734;
captureRadius = 10;
duration     = 2300;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 22;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 290;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior - do a rudder ascend at waypoint ESPBruce
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 3;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Third & final leg from waypoint ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 1600 meters
#water depth 30 meters to 20 meters
behavior waypoint_yoyo {
latitude     = 36.900;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25.0;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}


# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 11;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Second leg from waypoint ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 2900 meters
#water depth 50 meters to 30 meters
behavior waypoint_yoyo {
latitude     = 36.900;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 11;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#First leg from ESPmack to waypoint ESPbruce
#N36.9000 W121.8820
#leg distance 2900 meters
#water depth 73 meters to 50 meters
behavior waypoint_yoyo {
latitude     = 36.9000;
longitude     = -121.8820;
captureRadius = 10;
duration     = 2100;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

#arm all gulpers for adaptive firing
behavior ArmTheGulper
{
    duration = 1;
    gulper0 = 1;
    gulper1 = 1;
    gulper2 = 1;
    gulper3 = 1;
    gulper4 = 1;
    gulper5 = 1;
    gulper6 = 1;
    gulper7 = 1;
    gulper8 = 1;
    gulper9 = 1;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 11;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 11;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior - use a rudder ascend to minimize overshoot
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 5;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Initial leg to waypoint ESPmack
#N36.8339 W121.8983
#leg distance 300 meters
#water depth 73 meters
behavior waypoint_yoyo {
latitude     = 36.8339;
longitude     = -121.8983;
captureRadius = 10;
duration     = 500;
speed        = MISSION_SPEED;
minDepth       = MISSION_YOYO_MIN_DEPTH;
maxDepth       = MISSION_YOYO_MAX_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 270;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 270;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 600;
minHits = 15;
abortOnTimeout = True;
}


#
# Launch AUV at waypoint ESP_Survey_Fall_2009_Launch
#  N36 50.03918 W121.53.67100
#  300 meters east of first mission waypoint
#  AUV will swim due west from launch point
#  Should surface approx 7 minutes after initial dive
#

