###############################################################################
#
# PURPOSE: Box mission 300 m offshore of MISO
# AUTHORS: (1) Rob McEwen 03/10/2006
#          (2)
# NOTE:    Sequential behavoirs are bottom-up.  Priorities are top-down.
# MODS:
#
###############################################################################





#
# Precomputed Miso box corners, assuming channel axis is at 334.
#
#iboxSW  = [36.606819 -121.874569]
#iboxNW  = [36.609244 -121.876043]
#iboxNWa = [36.608435 -121.875552]
#iboxSE  = [36.607016 -121.874066]
#iboxNE  = [36.609441 -121.875539]
#oboxNW  = [36.611669 -121.877516]
#oboxNWa = [36.610860 -121.877025]
#oboxNE  = [36.611866 -121.877013]
#
behavior missionTimer
{
  timeOut = 1300;
}
#
# Depth Envelope
#
behavior depthEnvelope
{
  minDepth = 0; #Meters
  maxDepth = 12; #Meters
  minAltitude = 6;#Meters
  abortDepth = 13; #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
}
#
# iboxNE = [36.609441 -121.875539]
behavior waypoint
{
latitude = 36.609441;
longitude = -121.875539;
duration = 300;
depth = 8;
speed = 1.5;
}
#
# iboxSE = [36.607016 -121.874066]
#
behavior waypoint
{
latitude = 36.607016;
longitude = -121.874066;
duration = 60;
depth = 8;
speed = 1.5;
}
#
# Transponder location is at iboxSW.  But let's send the vehicle to
# iboxSE, so it will be obvious that it is homing.
# iboxSW = [36.606819 -121.874569]
# iboxSE = [36.607016 -121.874066]
#
# 5 Jul 06 - Send the vehicle to the dock location to avoid jogging.
#
# latitude          =   36.606685;
# longitude         = -121.874230;
#
behavior waypoint_homing
{
latitude = 36.606685;
longitude = -121.874230;
duration = 220;
depth = 8;
speed = 1.5;
dockBearing = 154.;
}
#
# 225 m at 334 Deg from MISO; iboxNWa
# 36.608435 -121.875552
#
behavior waypoint
{
latitude = 36.608435;
longitude = -121.875552;
duration = 100;
depth = 8;
speed = 1.5;
}

#
# 325 m at 334 Deg from MISO; iboxNW
# 36.609244 -121.876043
behavior waypoint
{
latitude = 36.609244;
longitude = -121.876043;
duration = 400;
depth = 8;
speed = 1.5;
}
#
# descend behavior for launch.  Head towards the NW corner
# of the box.
#
behavior descend
{
duration = 90;
horizontalMode = heading;
horizontal = 244;
pitch = -10;
speed = 1.5;
maxDepth = 6;
minAltitude = 6;
}

# setpoint on surface to accelerate to speed.

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

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