###############################################################################
#
# PURPOSE: 100m out and back, starting north of the ML harbor
# AUTHORS: (1) Rob McEwen 08/15/2006
#          (2)
# NOTE:    Sequential behavoirs are bottom-up.  Priorities are top-down.
# MODS:
#
###############################################################################
#
# 5+7=12 meters.  
#
# Precomputed 500 m box corners, assuming channel axis is at 245.
#
#Anchor     = [36.812570 -121.799358]
#ibox4 (SW) = [36.812570 -121.799358]
#ibox2 (NW) = [36.810705 -121.804469]
#ibox3      = [36.811078 -121.803447]
#ibox5 (SE) = [36.816662 -121.801687]
#ibox1 (NE) = [36.814797 -121.806798]
#obox7 (NW) = [36.808841 -121.809580]
#obox8      = [36.809214 -121.808558]
#obox6 (NE) = [36.812932 -121.811909]
#esc1       = [36.812570 -121.799358]
#esc2 (100) = [36.812197 -121.800381]
#esc3 (200) = [36.811824 -121.801403]
#esc4 (400) = [36.811078 -121.803447]
#
behavior missionTimer
{
  timeOut = 800;
}
#
# Depth Envelope
#
behavior depthEnvelope
{
  minDepth = 0; #Meters
  maxDepth = 8; #Meters
  minAltitude = 7;#Meters
  abortDepth = 10; #Meters
}

behavior getgps
{
  minHits = 10;
  duration = 60;
}

behavior ascend
{
  duration = 120; #Seconds
  horizontalMode = rudder; #Mode
  horizontal = -10; #Degrees; 
  pitch = 15; #Degrees
  speed = 1.5; #Meters/sec
  endDepth = 2; #Meters
}
#
# ibox4 = [36.812570 -121.799358]
behavior waypoint
{
latitude = 36.812570;
longitude = -121.799358;
duration = 120;
depth = 5;
speed = 1.5;
}
behavior descend
{
duration = 90;
horizontalMode = heading;
horizontal = 180;
pitch = -10;
speed = 1.5;
maxDepth = 6;
minAltitude = 7;
}

behavior getgps
{
  minHits = 10;
  duration = 60;
}

behavior ascend
{
  duration = 120; #Seconds
  horizontalMode = rudder; #Mode
  horizontal = -10; #Degrees; 
  pitch = 15; #Degrees
  speed = 1.5; #Meters/sec
  endDepth = 2; #Meters
}
#
# hand-computed; ibox4 long - .001 degree
# ibox4 = [36.812570 -121.799358]
# 
behavior waypoint
{
latitude = 36.812570;
longitude = -121.80000;
duration = 300;
depth = 5;
speed = 1.5;
}
#
# descend behavior for launch.  Head towards the NW corner
# of the box.
#
behavior descend
{
duration = 90;
horizontalMode = heading;
horizontal = 270;
pitch = -10;
speed = 1.5;
maxDepth = 6;
minAltitude = 7;
}

# setpoint on surface to accelerate to speed.
# Start at the western inshore corner.

behavior setpoint
{
duration = 30;
heading = 270;
speed = 1.5;
verticalMode = pitch;
pitch = 0;
}

behavior getgps
{
  minHits = 10;
  duration = 60;
  abortOnTimeout = True;
}
