#  17Dec09_INbound.cfg
# 
# DEPLOYMENT WAYPOINT        In the water already, near waypoint West
# MISSION STARTING WAYPOINT  West   N36 46.80000 W122 02.40000 = N36.78 W122.04
# INTERMEDIATE WAYPOINTS     Timed, should cover distance in approx 3.5 legs of 40 min each
# MISSION END WAYPOINT       East   N36 46.80000 W121 54.00000 = N36.78 W121.9
#
# TOTAL MISSION LENGTH IN METERS 12500
# Mission speed 1.75 m/s
#  at 1.52 SOG ( 30 degree yoyo's ) 
#  mission should take approx 2 h 30 min
#
# Arm UNFIRED gulpers at start of mission for adaptive firing
#
#
#define YOYO_MIN_ALTITUDE 6.5
#define YOYO_MAX_ALTITUDE 250
#define MISSION_SPEED 1.75
#define MISSION_SPEED_SLOW 1.75
#
#should be 8224 second mission, set timer to 120%
#set timeout in seconds
behavior missionTimer {
timeOut = 10000;
}

behavior depthEnvelope {
  minDepth = 0;
  maxDepth = 275;
  abortDepth = 300;
  abortAltitude = 2.5;
  abortLockoutDepth = 10.0;
}

# Mission End

# acquire gps fix
behavior getgps {
duration = 7200;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 90;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Final leg to waypoint East
# N36 46.80000 W121 54.00000
# WATER DEPTH 365 METERS
# LEG DISTANCE 500 METERS
behavior waypoint_yoyo {
latitude     = 36.78;
longitude     = -121.9;
captureRadius = 10;
duration     = 2400;
speed        = MISSION_SPEED;
minDepth       = 50;
maxDepth       = 250;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 90;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 90;
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       = 90;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Third leg to waypoint East
# N36 46.80000 W121 54.00000
# WATER DEPTH 365 METERS
# LEG DISTANCE 500 METERS
behavior waypoint_yoyo {
latitude     = 36.78;
longitude     = -121.9;
captureRadius = 10;
duration     = 2400;
speed        = MISSION_SPEED;
minDepth       = 50;
maxDepth       = 250;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 90;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 90;
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       = 90;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Second leg to waypoint East
# N36 46.80000 W121 54.00000
# WATER DEPTH 365 METERS
# LEG DISTANCE 500 METERS
behavior waypoint_yoyo {
latitude     = 36.78;
longitude     = -121.9;
captureRadius = 10;
duration     = 2400;
speed        = MISSION_SPEED;
minDepth       = 50;
maxDepth       = 250;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 90;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 90;
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       = 90;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#First leg to waypoint East
# N36 46.80000 W121 54.00000
# WATER DEPTH 365 METERS
# LEG DISTANCE 500 METERS
behavior waypoint_yoyo {
latitude     = 36.78;
longitude     = -121.9;
captureRadius = 10;
duration     = 2400;
speed        = MISSION_SPEED;
minDepth       = 50;
maxDepth       = 250;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 90;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 90;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 15;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 90;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Initial leg to waypoint West
# N36 46.8 W122 02,4
# WATER DEPTH 365 METERS
# LEG DISTANCE 500 METERS
# shallow yoyo's to initial waypoint
behavior waypoint_yoyo {
latitude     = 36.78;
longitude     = -122.04;
captureRadius = 10;
duration     = 600;
speed        = MISSION_SPEED;
minDepth       = 2.0;
maxDepth       = 20;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 90;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 90;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 15;
abortOnTimeout = True;
}

#Arm UNFIRED 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;
}

# AUV already in the water, near waypoint West
# N36 46.80000 W122 02.40000 = N36.78 W122.04