# mission timer set to 120% of estimated time of mission
behavior missionTimer {
timeOut = 30000;
}

# depth envelope set to commanded + 5 m, abort at commanded + 10
behavior depthEnvelope {
 minDepth = 0;
 maxDepth     = 105;
 abortDepth   = 110;
 minAltitude  = 5;
 abortAltitude  = 3;
}

# Seventh leg of run to waypoint M1
# acquire gps fix
behavior getgps {
duration = 300;
minHits = 30;
abortOnTimeout = False;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to waypoint at Mooring-1 leg 7
behavior waypoint_yoyo {
latitude     = 36.75;
longitude     = -122.01667;
captureRadius = 10;
duration     = 2400;
speed        = 1.5;
minDepth       = 3;
maxDepth       = 100;
minAltitude    = 7;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 318;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 318;
speed        = 1.5;
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.5;
endDepth         = 2;
}

# waypoint behavior to waypoint at Mooring-1 leg 6
behavior waypoint_yoyo {
latitude     = 36.75;
longitude     = -122.01667;
captureRadius = 10;
duration     = 2400;
speed        = 1.5;
minDepth       = 3;
maxDepth       = 100;
minAltitude    = 7;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 318;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 318;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}



# Fifth 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.5;
endDepth         = 2;
}

# waypoint behavior to waypoint at Mooring-1 leg 5
behavior waypoint_yoyo {
latitude     = 36.75;
longitude     = -122.01667;
captureRadius = 10;
duration     = 2400;
speed        = 1.5;
minDepth       = 3;
maxDepth       = 100;
minAltitude    = 7;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 318;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 318;
speed        = 1.5;
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.5;
endDepth         = 2;
}

# waypoint behavior to waypoint at Mooring-1 Leg 4
behavior waypoint_yoyo {
latitude     = 36.75;
longitude     = -122.01667;
captureRadius = 10;
duration     = 2400;
speed        = 1.5;
minDepth       = 3;
maxDepth       = 100;
minAltitude    = 7;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 318;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 318;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# Third leg of run to waypoint M-1
# 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.5;
endDepth         = 2;
}

# waypoint behavior to waypoint at Mooring-1 Leg 3
behavior waypoint_yoyo {
latitude     = 36.75;
longitude     = -122.01667;
captureRadius = 10;
duration     = 2400;
speed        = 1.5;
minDepth       = 3;
maxDepth       = 100;
minAltitude    = 7;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 318;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 318;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}


# Second 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.5;
endDepth         = 2;
}

# waypoint behavior to waypoint at Mooring-1 (aiming for intermediate point)Leg 2
behavior waypoint_yoyo {
latitude     = 36.6875;
longitude     = -121.94583;
captureRadius = 10;
duration     = 2400;
speed        = 1.5;
minDepth       = 3;
maxDepth       = 100;
minAltitude    = 7;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 318;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 318;
speed        = 1.5;
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.5;
endDepth         = 2;
}

# waypoint behavior to waypoint at Mooring-1 (aiming for intermediate point)Leg 1
behavior waypoint_yoyo {
latitude     = 36.6875;
longitude     = -121.94583;
captureRadius = 10;
duration     = 2400;
speed        = 1.5;
minDepth       = 3;
maxDepth       = 100;
minAltitude    = 7;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 318;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 318;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 120;
abortOnTimeout = True;
}

