#define YOYO_MIN_ALTITUDE 6.5
#define MISSION_SPEED 1.6

#should be 1 hour mission, set timer to 1 hours
behavior missionTimer {
timeOut = 3600;
}

behavior depthEnvelope {
  minDepth = 0;
  maxDepth = 23;
  abortDepth = 30;
  abortAltitude = 2.5;
  abortLockoutDepth = 10.0;
}
behavior getgps {
duration = 600;
minHits = 15;
abortOnTimeout = False;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 318;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Initial leg to waypoint LOCO2 - first waypoint
#N36 50.1100 W121 49.8200
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.8352;
longitude     = -121.8303;
captureRadius = 10;
duration     = 1600;
speed        = MISSION_SPEED;
minDepth       = 2.0;
maxDepth       = 20;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 321;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}


# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 321;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

behavior getgps {
duration = 300;
minHits = 15;
abortOnTimeout = False;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 10;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

#Initial leg to waypoint LOCO1 - start of line
#N36 49.5181 W121 49.2562
#maximum depth 20m
behavior waypoint_yoyo {
latitude     = 36.8253;
longitude     = -121.82094;
captureRadius = 10;
duration     = 900;
speed        = MISSION_SPEED;
minDepth       = 2.0;
maxDepth       = 20;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 2000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 280;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 30;
heading      = 280;
speed        = 1.5;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 300;
minHits = 15;
abortOnTimeout = False;
}
