# m0_volume
# 4 hour mission running in a cirle around M0 in a clockwise fashion
# taking gulpers at the N and S waypoints every lap (4 laps total)
# firing a total of 9 gulpers
# each lap should be approx. 1 hour



#define YOYO_MIN_ALTITUDE 12
#define MISSION_YOYO_MIN_DEPTH 2
#define MISSION_SPEED 1.6

# mission timer set to 120% of estimated time of mission
behavior missionTimer {
timeOut = 17280;
}

# depth envelope set to commanded + 5 m, abort at commanded + 10
behavior depthEnvelope {
 minDepth = 0;
 maxDepth     = 35;
 abortDepth   = 50;
 abortAltitude  = 10.0;
}


# acquire gps fix
behavior getgps {
duration = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = rudder;
horizontal       = 4;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}


behavior setpoint {
duration     = 2;
heading      = 277;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 08 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 8;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
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 = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume1
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8263;
longitude     = -121.9034;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}



# waypoint behavior to Volume8
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8283;
longitude     = -121.8972;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# waypoint behavior to Volume7
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8333;
longitude     = -121.8946;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# waypoint behavior to Volume6
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8383;
longitude     = -121.8971;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


behavior setpoint {
duration     = 2;
heading      = 120;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 07 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 7;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      =120;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 120;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 70;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume5
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8403;
longitude     = -121.9032;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume4
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8383;
longitude     = -121.9094;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume3
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8333;
longitude     = -121.9121;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume2
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8285;
longitude     = -121.9096;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


behavior setpoint {
duration     = 2;
heading      = 277;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 06 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 6;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
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 = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume1
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8263;
longitude     = -121.9034;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}



# waypoint behavior to Volume8
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8283;
longitude     = -121.8972;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# waypoint behavior to Volume7
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8333;
longitude     = -121.8946;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# waypoint behavior to Volume6
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8383;
longitude     = -121.8971;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


behavior setpoint {
duration     = 2;
heading      = 120;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 05 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 5;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      =120;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 120;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 70;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume5
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8403;
longitude     = -121.9032;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume4
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8383;
longitude     = -121.9094;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume3
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8333;
longitude     = -121.9121;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume2
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8285;
longitude     = -121.9096;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


behavior setpoint {
duration     = 2;
heading      = 277;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 04 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 4;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
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 = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume1
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8263;
longitude     = -121.9034;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}



# waypoint behavior to Volume8
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8283;
longitude     = -121.8972;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# waypoint behavior to Volume7
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8333;
longitude     = -121.8946;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# waypoint behavior to Volume6
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8383;
longitude     = -121.8971;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


behavior setpoint {
duration     = 2;
heading      = 120;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 03 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 3;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      =120;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 120;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 70;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume5
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8403;
longitude     = -121.9032;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume4
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8383;
longitude     = -121.9094;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume3
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8333;
longitude     = -121.9121;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume2
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8285;
longitude     = -121.9096;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


behavior setpoint {
duration     = 2;
heading      = 277;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 02 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 2;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
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 = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume1
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8263;
longitude     = -121.9034;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume8
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8283;
longitude     = -121.8972;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# waypoint behavior to Volume7
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8333;
longitude     = -121.8946;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# waypoint behavior to Volume6
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8383;
longitude     = -121.8971;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


behavior setpoint {
duration     = 2;
heading      = 120;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 01 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 1;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      =120;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 120;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 70;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume5
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8403;
longitude     = -121.9032;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume4
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8383;
longitude     = -121.9094;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume3
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8333;
longitude     = -121.9121;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


# waypoint behavior to Volume2
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8285;
longitude     = -121.9096;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}


behavior setpoint {
duration     = 2;
heading      = 277;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# Fire gulper 00 at 10m depth		##Fire Gulper
behavior FireTheGulper {
	duration = 2;
	gulperToFire = 0;
}

# Descend behavior to 10 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 290;
pitch        = -15;
speed        = 1.5;
maxDepth     = 10;
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 = 300;
minHits = 45;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 600;
horizontalMode   = heading;
horizontal       = 290;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

# waypoint behavior to Volume1
# yo-yo to 25m
behavior waypoint_yoyo {
latitude     = 36.8263;
longitude     = -121.9034;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth      = MISSION_YOYO_MIN_DEPTH;
maxDepth       = 25;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 350;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 350;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 45;
abortOnTimeout = True;
}