#define WPT_SOUTH_LAT 36.8050
#define WPT_SOUTH_LON -121.8952
#define WPT_NORTH_LAT 36.9257
#define WPT_NORTH_LON -121.9210

#define YOYO_MIN_ALTITUDE 6.0
#define MISSION_SPEED 1.5
#define MISSION_DEPTH 50

behavior missionTimer {
timeOut = 86400;
}

# depth envelope set to commanded + 5 m, abort at commanded + 10
behavior depthEnvelope {
 minDepth = 0;
 maxDepth     = 55;
 abortDepth   = 60;
 minAltitude = 5.0;
 abortAltitude  = 3.0;
 abortLockoutDepth = 8.0;
}

# setpoint on surface to gather momentum
behavior setpoint {
duration     = 7200;
heading      = 110.0;
speed        = 0.0;
verticalMode = pitch;
pitch        = 0;
}

# acquire gps fix
behavior getgps {
duration = 1200;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 5;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

behavior waypoint_yoyo {
latitude     = WPT_NORTH_LAT;
longitude     = WPT_NORTH_LON;
captureRadius = 10;
duration     = 1800;
speed        = MISSION_SPEED; 
minDepth       = 2.5;
maxDepth       = MISSION_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 350.0;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

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

# acquire gps fix
behavior getgps {
duration = 1200;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 350;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

behavior waypoint_yoyo {
latitude     = WPT_NORTH_LAT;
longitude     = WPT_NORTH_LON;
captureRadius = 10;
duration     = 1800;
speed        = MISSION_SPEED; 
minDepth       = 2.5;
maxDepth       = MISSION_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 350.0;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

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


# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 350;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

behavior waypoint_yoyo {
latitude     = WPT_NORTH_LAT;
longitude     = WPT_NORTH_LON;
captureRadius = 10;
duration     = 1800;
speed        = MISSION_SPEED; 
minDepth       = 2.5;
maxDepth       = MISSION_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 350.0;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

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

# acquire gps fix
behavior getgps {
duration = 1200;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 350;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

behavior waypoint_yoyo {
latitude     = WPT_NORTH_LAT;
longitude     = WPT_NORTH_LON;
captureRadius = 10;
duration     = 1800;
speed        = MISSION_SPEED; 
minDepth       = 2.5;
maxDepth       = MISSION_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 350.0;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 60;
}

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

# acquire gps fix
behavior getgps {
duration = 1200;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 350;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

behavior waypoint_yoyo {
latitude     = WPT_NORTH_LAT;
longitude     = WPT_NORTH_LON;
captureRadius = 10;
duration     = 1800;
speed        = MISSION_SPEED; 
minDepth       = 2.5;
maxDepth       = MISSION_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 350.0;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 120;
}

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

# acquire gps fix
behavior getgps {
duration = 1200;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = heading;
horizontal       = 350;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

behavior waypoint_yoyo {
latitude     = WPT_NORTH_LAT;
longitude     = WPT_NORTH_LON;
captureRadius = 10;
duration     = 1800;
speed        = MISSION_SPEED; 
minDepth       = 2.5;
maxDepth       = MISSION_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# Descend behavior to 5 meters
behavior descend {
horizontalMode   = heading;
horizontal      = 350.0;
pitch        = -15;
speed        = 1.5;
maxDepth     = 5;
minAltitude  = 9;
duration     = 120;
}

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

# acquire gps fix
behavior getgps {
duration = 1200;
minHits = 30;
abortOnTimeout = True;
}

# ascend behavior
behavior ascend {
duration  = 1200;
horizontalMode   = rudder;
horizontal       = 5;
pitch            = 20;
speed            = 1.5;
endDepth         = 2;
}

behavior waypoint_yoyo {
latitude     = WPT_SOUTH_LAT;
longitude     = WPT_SOUTH_LON;
captureRadius = 10;
duration     = 1200;
speed        = MISSION_SPEED; 
minDepth       = 2.5;
maxDepth       = MISSION_DEPTH;
minAltitude    = YOYO_MIN_ALTITUDE;
maxCycles      = 1000;
}

# 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 = 1200;
minHits = 30;
abortOnTimeout = True;
}

