

################################################################################
#
# PURPOSE: Test Terrain aided navigation, home to transponder.
#          
# AUTHORS: Debbie, Rob
# DATE:    2010/11/18
# NOTES:   This should take about 25 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 #3 planned for the 
#	   07/19/10 BIAUV dive.
# NOTE:    Sequential behavoirs are bottom-up.  Priorities are top-down.
# MODS:
#
################################################################################
# 
behavior missionTimer
{
  timeOut = 2400;
}
#
# Depth Envelope
#
behavior depthEnvelope
{
  minDepth = 0; #Meters
  maxDepth = 300; #Meters
  minAltitude = 26; #Meters
  abortAltitude = 13; #Meters
  deltaDepthRestart = 4; #Meters
  abortDepth = 310; #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 = 180;
    initialDepth = 66;
    finalDepth = 63;
    maxCrossTrackError = 30;
    speed = 1.5;
}

# Twelve - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8141073;
    longitude = -121.9757959;
    duration = 120;
    initialDepth = 72;
    finalDepth = 66;
    maxCrossTrackError = 30;
    speed = 1.5;
}

# Eleven - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8143493;
    longitude = -121.9770940;
    duration = 130;
    initialDepth = 118;
    finalDepth = 72;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# Ten - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8145910;
    longitude = -121.9783808;
    duration = 220;
    initialDepth = 160;
    finalDepth = 118;
    maxCrossTrackError = 30;
    speed = 1.5;
}

# Nine - waypoint post-homing
behavior waypoint_depth
{
    latitude = 36.8150324;
    longitude = -121.9806828;
    duration = 350;
    initialDepth = 280;
    finalDepth = 160;
    maxCrossTrackError = 30;
    speed = 1.5;
}
behavior stopCamera
{
    duration = 1;
}
#Eight - waypoint 100m past homer
behavior waypoint_depth
{
    latitude = 36.8154300;
    longitude = -121.9842488;
    duration = 350;
    initialDepth = 263;
    finalDepth = 280;
    maxCrossTrackError = 30;
    speed = 1.5;
}

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

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

# Seven
behavior waypoint_depth
{
    latitude = 36.8174829;
    longitude = -121.9820597;
    duration = 100;
    initialDepth = 221;
    finalDepth = 240;
    maxCrossTrackError = 30;
    speed = 1.5;
}


# Six
behavior waypoint_depth
{
    latitude = 36.8181672;
    longitude = -121.9813299;
    duration = 315;
    initialDepth = 144;
    finalDepth = 221;
    maxCrossTrackError = 30;
    speed = 1.5;
}

# Five
behavior waypoint_depth
{
    latitude = 36.8157133;
    longitude = -121.9797959;
    duration = 110;
    initialDepth = 138;
    finalDepth = 144;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# Four
behavior waypoint_depth
{
    latitude = 36.8147923;
    longitude = -121.9794186;
    duration = 120;
    initialDepth = 155;
    finalDepth = 138;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# Three
behavior waypoint_depth
{
    latitude = 36.8137852;
    longitude = -121.9790060;
    duration = 200;
    initialDepth = 81;
    finalDepth = 155;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# Two
behavior waypoint_depth
{
    latitude = 36.8139875;
    longitude = -121.9769902;
    duration = 110;
    initialDepth = 67;
    finalDepth = 81;
    maxCrossTrackError = 30;
    speed = 1.5;
}
# One
behavior waypoint
{
    latitude = 36.8141073;
    longitude = -121.9757959;
    duration = 500;
    depth = 67;
    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;
}
