

################################################################################
#
# PURPOSE: Test Terrain aided navigation, home to transponder.
#          
# AUTHORS: Debbie, Rob
# DATE:    2010/11/18
# NOTES:   This should take about 23 minutes.
#          Vehicle travels toward homer 50 and returns
#	   back to its starting location, using OPEN loop TRN.
#	   Homing behavior is enabled.	   
#	   This route is a modified version of route #4 flown on the 
#	   07/19/10 BIAUV dive.
# NOTE:    Sequential behavoirs are bottom-up.  Priorities are top-down.
# MODS:
#
################################################################################
# 
behavior missionTimer
{
  timeOut = 2300;
}
#
# Depth Envelope
#
behavior depthEnvelope
{
  minDepth = 0; #Meters
  maxDepth = 310; #Meters
  minAltitude = 2.6; #Meters
  abortAltitude = 2; #Meters
  deltaDepthRestart = 4; #Meters
  abortDepth = 320; #Meters
}
behavior getgps
{
    duration = 300;
    minHits = 10;
    abortOnTimeout = True;
}
#
# Come back up to the surface. 
#
behavior ascend
{
  duration = 300; #Seconds
  horizontalMode = rudder; #Mode
  horizontal = 3; #Degrees; 
  pitch = 30; #Degrees
  speed = 1.5; #Meters/sec
  endDepth = 2; #Meters
}

# Thirteen - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8131800;
    longitude = -121.9741917;
    duration = 290;
    initialDepth = 68;
    finalDepth = 63;
    maxCrossTrackError = 30;
    speed = 1.5;
}

# Twelve - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8144675;
    longitude = -121.9769759;
    duration = 120;
    initialDepth = 106;
    finalDepth = 68;
    maxCrossTrackError = 30;
    speed = 1.5;
}

# Eleven - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8147373;
    longitude = -121.9781594;
    duration = 170;
    initialDepth = 142;
    finalDepth = 106;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# Ten - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8151360;
    longitude = -121.9799084;
    duration = 180;
    initialDepth = 195;
    finalDepth = 142;
    maxCrossTrackError = 30;
    speed = 1.5;
}

# Nine - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8155508;
    longitude = -121.9817282;
    duration = 280;
    initialDepth = 305;
    finalDepth = 195;
    maxCrossTrackError = 30;
    speed = 1.5;
}
behavior stopCamera
{
    duration = 1;
}
#Eight - waypoint 100m past homer
behavior waypoint_depth
{
    latitude = 36.8168193;
    longitude = -121.9842178;
    duration = 350;
    initialDepth = 295;
    finalDepth = 305;
    maxCrossTrackError = 30;
    speed = 1.5;
}

behavior waypoint_homing
{
    latitude = 36.8161143;
    longitude = -121.9835191;
    duration = 320;
    depth = 295;
    speed = 1.5;
    inTrkOffset = -10;
    beaconAddr = V4_5; #50, 298m
    clusterRadius= 10; #meters, nav reset
}

behavior startCamera
{
    duration = 1;
    nSamplePeriods = 8;
}

# Seven
behavior waypoint_depth
{
    latitude = 36.8147044;
    longitude = -121.9821219;
    duration = 80;
    initialDepth = 194;
    finalDepth = 204;
    maxCrossTrackError = 30;
    speed = 1.5;
}


# Six
behavior waypoint_depth
{
    latitude = 36.8140983;
    longitude = -121.9817119;
    duration = 150;
    initialDepth = 170;
    finalDepth = 194;
    maxCrossTrackError = 30;
    speed = 1.5;
}

# Five
behavior waypoint_depth
{
    latitude = 36.8137159;
    longitude = -121.9801160;
    duration = 100;
    initialDepth = 162;
    finalDepth = 170;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# Four
behavior waypoint_depth
{
    latitude = 36.8134593;
    longitude = -121.9790449;
    duration = 110;
    initialDepth = 130;
    finalDepth = 162;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# Three
behavior waypoint_depth
{
    latitude = 36.8131973;
    longitude = -121.9778709;
    duration = 100;
    initialDepth = 90;
    finalDepth = 130;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# Two
behavior waypoint_depth
{
    latitude = 36.8137551;
    longitude = -121.9772159;
    duration = 100;
    initialDepth = 70;
    finalDepth = 90;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# One
behavior waypoint
{
    latitude = 36.8143603;
    longitude = -121.9765059;
    duration = 700;
    depth = 70;
    speed = 1.5;
}
behavior descend
{
  duration = 200; #Seconds
  horizontalMode = heading; #Mode
  horizontal = 300; #Degrees; 
  pitch = -15; #Degrees
  speed = 1.5; #Meters/sec
  maxDepth = 75; #Meters
  minAltitude = 26; #Meters
}

# setpoint on surface to gather momentum
behavior setpoint
{
    duration = 30;
    heading = 300;
    speed = 1.5;
    verticalMode = pitch;
    pitch = 0;
}

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