//------------------------------------------------
// File: zeta.bhv
// Name: N. Rypkema
// Date: Mar 8th, 2017
//------------------------------------------------

initialize   DEPLOY=false,  RETURN  = false
initialize   SURVEY=true,   STATION_KEEP = false

set MODE = ACTIVE {
  DEPLOY = true
} INACTIVE

set MODE = SURVEYING {
  MODE = ACTIVE
  (SURVEY = true) and (RETURN != true)
  STATION_KEEP != true
}

set MODE = RETURNING {
  MODE = ACTIVE
  RETURN = true
  STATION_KEEP != true
} STATION-KEEPING


//----------------------------------------------
Behavior = BHV_Waypoint
{
  name      = survey
  priority  = 100
  condition = MODE==SURVEYING

         speed = 2.0
        radius = 3.0
     nm_radius = 15.0
          lead = 10.0
   lead_damper = 4.0
       points = -200,-130:-90,-420:-57,-402:-170,-120:-129,-104:-22,-388:20,-370:-84,-85:-42,-69:59,-354:100,-339:-2,-53:39,-34:140,-322:175,-311:80,-23:121,-7:216,-290:256,-275:167,3:203,14:296,-260:330,-244:244,6

        repeat = 1
  visual_hints = nextpt_color=red, nextpt_lcolor=green
  visual_hints = vertex_color=yellow, line_color=white
  visual_hints = vertex_size=2, edge_size=1
}

//----------------------------------------------
Behavior = BHV_Waypoint
{
  name      = waypt_return
  priority  = 100
  perpetual = true
  updates   = RETURN_UPDATES
  condition = MODE==RETURNING
  endflag   = STATION_KEEP = true

      speed = 1.3
     radius = 3.0
  nm_radius = 15.0
      point = x=15, y=0
}

//----------------------------------------------
Behavior = BHV_StationKeep
{
  name      = station-keep
  priority  = 100
  condition = MODE==STATION-KEEPING

  center_activate = true 
     inner_radius = 5 
     outer_radius = 10  
      outer_speed = 1.0
       swing_time = 10
}