//--------    FILE: alpha.bhv   -------------

initialize   DEPLOY = false
initialize   RETURN = false
initialize   SPDLIMIT = true
//initialize   DRIFT_X = 0.5
//initialize   DRIFT_Y = 0.7
initialize   AVOIDING = idle

	
//----------------------------------------------
//Behavior = BHV_HSLine
{ 
  name = hsline

	time_on_leg = 5
	condition = DEPLOY=true
}

//----------------------------------------------
Behavior = BHV_Waypoint
{ 
  name      = waypt_survey
  pwt       = 100
  condition = RETURN = false
  condition = DEPLOY = true
	endflag   = RETURN = true
	endflag   = EFLAG  = endings=$[CTR2]
	cycleflag = CFLAG  = cyles=$[CTR1]
	wptflag   = WFLAG  = waypoints=$[CTR]
	wptflag   = WPI  = $[PI]
	wptflag   = WNI  = $[NI]

  updates    = WPT_UPDATE
  perpetual  = true

  lead_condition = AVOIDING != active

	//wptflag_on_start = true

      use_alt_speed = true
           speed_alt = 1
                lead = 8
         lead_damper = 1
       lead_to_start = true
               speed = 4.0   // meters per second
        capture_line = true
      capture_radius = 5.0
         slip_radius = 15.0
	efficiency_measure = all

             polygon = 60,-40 : 60,-160 : 150,-160 : 180,-100 : 150,-40

               order = normal
             repeat  = 400

   visual_hints = nextpt_color=light_green
   visual_hints = nextpt_vertex_size=18
   visual_hints = nextpt_lcolor=gray70
   //visual_hints = vertex_color=dodger_blue, edge_color=white
   //visual_hints = vertex_size=6, edge_size=1
   visual_hints = vertex_color=white, edge_color=white
   visual_hints = vertex_size=12, edge_size=2
}

//----------------------------------------------
Behavior=BHV_Waypoint
{
  name       = waypt_return
  pwt        = 100
  condition  = RETURN = true
  condition  = DEPLOY = true
  perpetual  = true
  updates    = RETURN_UPDATE
  endflag    = RETURN = false
  endflag    = DEPLOY = false
  endflag    = MISSION = complete

	endflag   = EFLAG  = r_endings=$[CTR_02]
	cycleflag = CFLAG  = r_cyles=$[CTR_01]
	wptflag   = WFLAG  = r_waypoints=$[CTR]

      lead_condition = AVOIDING != active

                lead = 8
         lead_damper = 1
       lead_to_start = true

           speed = 2.0
  capture_radius = 2.0
     slip_radius = 8.0
          point = 0,-20
 }