#26Jun_1to4.cfg
# ***** verify WAYPOINTS vs Winfrog *****
#define YOYO_MIN_ALTITUDE 6.5
#define MISSION_SPEED 1.55

#should be 2 hour mission, set timer to 3 hours
#set timeout in seconds
behavior missionTimer {
timeOut = 10800;
}

behavior depthEnvelope {
  minDepth = 0;
  maxDepth = 15;
  abortDepth = 22;
  abortAltitude = 5;
  abortLockoutDepth = 10.0;
}

# Mission End



# acquire gps fix
behavior getgps {
duration = 5000;
minHits = 3600;
abortOnTimeout = True;
}


# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 300;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#THIRD and FINAL leg to waypoint4
#N36 54.4200  W121 54.000
#water depth 20 meters
behavior waypoint_yoyo {
latitude     = 36.9310;
longitude     = -121.9500;
captureRadius = 10;
duration     = 1500;
speed        = MISSION_SPEED;
minDepth       = 2.0;
maxDepth       = 15;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 300;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      =300;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}



# acquire gps fix
behavior getgps {
duration = 600;
minHits = 60;
abortOnTimeout = True;
}


# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 300;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#SECOND leg to waypoint4
#N36 54.4200  W121 54.000
#water depth 20 meters
behavior waypoint_yoyo {
latitude     = 36.9310;
longitude     = -121.9500;
captureRadius = 10;
duration     = 1500;
speed        = MISSION_SPEED;
minDepth       = 2.0;
maxDepth       = 15;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 300;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 300;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}


# acquire gps fix
behavior getgps {
duration = 600;
minHits = 60;
abortOnTimeout = True;
}


# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 300;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#FIRST leg to waypoint4
#N36 54.4200  W121 54.000
#water depth 20 meters
behavior waypoint_yoyo {
latitude     = 36.9310;
longitude     = -121.9500;
captureRadius = 10;
duration     = 1500;
speed        = MISSION_SPEED;
minDepth       = 2.0;
maxDepth       = 15;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 300;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 300;
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       = xxx;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Initial leg to waypoint1 - start of line
#Nxx xx.xxxx  Wxxx xx.xxxx
#water depth 20 meters
behavior waypoint_yoyo {
latitude     = 36.9070;
longitude     = -121.9000;
captureRadius = 10;
duration     = 500;
speed        = MISSION_SPEED;
minDepth       = 2.0;
maxDepth       = 15;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 270;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 270;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 15;
abortOnTimeout = False;
}
