#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;
}


# acquire gps fix
behavior getgps {
duration = 300;
minHits = 60;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

#Leg 5 to waypoint LOCO A
#N36 56.4480 W121 56.3580
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.9408;
longitude     = -121.9393;
captureRadius = 10;
duration     = 1900;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 20;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 313;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 313;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 60;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

#Leg 4 to waypoint LOCO #3
#N36 55.8438 W121 55.5611
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.93073;
longitude     = -121.92602;
captureRadius = 10;
duration     = 1900;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 20;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 313;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 313;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 60;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

#Leg 3 to waypoint LOCO #2
#N36 54.7932 W121 54.1733
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.91322;
longitude     = -121.90289;
captureRadius = 10;
duration     = 1900;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 20;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 313;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 313;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 60;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

#Leg 2 to waypoint LOCO #1
#N36 53.7690 W121 52.8205
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.89615;
longitude     = -121.88034;
captureRadius = 10;
duration     = 1900;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 20;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 313;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 313;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 60;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.6;
endDepth         = 2;
}

#Leg 1 to waypoint LOCO C
#N36 52.8360 W121 51.5880
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.8806;
longitude     = -121.8598;
captureRadius = 10;
duration     = 600;
speed        = MISSION_SPEED;
minDepth       = 2.5;
maxDepth       = 15;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 270;
pitch        = -15;
speed        = 1.6;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 270;
speed        = 1.6;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 120;
abortOnTimeout = True;
}













