<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%============================================
\section{Mission Files}
%============================================
\begin{packed_itemize}                      
\item \var{launch.sh}                       
\item \var{alpha.moos}                       
\item \var{alpha.bhv}                       
\end{packed_itemize}                        
%============================================
\subsection{launch.sh}
%============================================
\scriptsize
\begin{verbatim}
#!/bin/bash
#----------------------------------------------------------
#  Script: launch.sh
#  Author: Michael Benjamin
#----------------------------------------------------------
#  Part 1: Set Exit actions and declare global var defaults
#----------------------------------------------------------
COMMUNITY="alpha"
TIME_WARP=1

#-------------------------------------------------------
#  Part 2: Check for and handle command-line arguments
#-------------------------------------------------------
for ARGI; do
    if [ "${ARGI}" = "--help" -o "${ARGI}" = "-h" ]; then
	echo "launch.sh [SWITCHES] [time_warp]    " 
	echo "  --help, -h                        " 
	exit 0;
    elif [ "${ARGI//[^0-9]/}" = "$ARGI" -a "$TIME_WARP" = 1 ]; then 
        TIME_WARP=$ARGI
    else 
        echo "launch.sh Bad arg:" $ARGI " Exit code: 1"
        exit 1
    fi
done


#-------------------------------------------------------
#  Part 2: Launch the processes
#-------------------------------------------------------
echo "Launching the $COMMUNITY MOOS Community with WARP:" $TIME_WARP
pAntler $COMMUNITY.moos --MOOSTimeWarp=$TIME_WARP &gt;&amp; /dev/null &amp;

uMAC $COMMUNITY.moos

kill -- -$$


\end{verbatim}
\normalsize
%============================================
\subsection{alpha.moos}
%============================================
\scriptsize
\begin{verbatim}
//------------------------------------------
// NAME: M. Benjamin, MIT
// FILE: alpha.moos
//------------------------------------------
ServerHost = localhost		
ServerPort = 9000
Community  = alpha
MOOSTimeWarp = 1
// MIT Sailing Pavilion
LatOrigin  = 42.358456 
LongOrigin = -71.087589

//------------------------------------------
// Antler configuration  block
ProcessConfig = ANTLER
{
  MSBetweenLaunches = 200

  Run = MOOSDB        @ NewConsole = false
  Run = pLogger       @ NewConsole = false
  Run = pMarinePIDV22 @ NewConsole = false
  Run = pHelmIvP      @ NewConsole = false
  Run = pMarineViewer @ NewConsole = false
  Run = uProcessWatch @ NewConsole = false
  Run = pNodeReporter @ NewConsole = false
  Run = pObstacleMgr  @ NewConsole = false
  Run = uSimMarineV22 @ NewConsole = false
}

//------------------------------------------
// uProcessWatch config block
ProcessConfig = uProcessWatch
{
  AppTick   = 4
  CommsTick = 4

  summary_wait = 5

  nowatch   = uXMS*
  nowatch   = uMAC*
  nowatch   = uPokeDB*
  nowatch   = uTermCommand*
  watch_all = true
}

//------------------------------------------
// pLogger config block

ProcessConfig = pLogger
{
  AppTick   = 8
  CommsTick = 8

  AsyncLog = true

  // For variables that are published in a bundle on their first post,
  // explicitly declare their logging request

  Log = IVPHELM_LIFE_EVENT @ 0 NOSYNC
  Log = BHV_WARNING @ 0 NOSYNC

  LogAuxSrc = true
  WildCardLogging = true
  WildCardOmitPattern = *_STATUS
  WildCardOmitPattern = DB_VARSUMMARY
  WildCardOmitPattern = DB_RWSUMMARY
  WildCardExclusionLog = true
}

//------------------------------------------
// uSimMarineV22 config block

ProcessConfig = uSimMarineV22
{
  AppTick	= 4
  CommsTick	= 4

	app_logging = true
	
  start_x       = 180
  start_y       = -110
  start_heading = 270
  start_speed   = 0
  max_deceleration = 0.1
  prefix        = NAV

	//max_rudder_degs_per_sec = 1

  //turn_rate   = 15
  turn_rate     = 70
  thrust_map    = 0:0, 20:1, 40:2, 60:3, 80:4, 100:5
  thrust_reflect = true
}

//------------------------------------------
// pHelmIvP config block

ProcessConfig = pHelmIvP
{
  AppTick    = 2
  CommsTick  = 2

	app_logging = true
	
  term_report_interval = 0
  bhv_dir_not_found_ok = true

  behaviors  = alpha.bhv
  domain     = course:0:359:360
  domain     = speed:0:4:21
}

//------------------------------------------
// pMarinePIDV22 config block

ProcessConfig = pMarinePIDV22
{
  AppTick    = 20
  CommsTick  = 20

  verbose       = true
  depth_control = false

  // SIM_INSTABILITY = 20

  // Yaw PID controller
  yaw_pid_kp		 = 1.2
  yaw_pid_kd		 = 0.0
  yaw_pid_ki		 = 0.3
  yaw_pid_integral_limit = 0.07

  // Speed PID controller
  speed_pid_kp		 = 1.0
  speed_pid_kd		 = 0.0
  speed_pid_ki		 = 0.0
  speed_pid_integral_limit = 0.07

  //MAXIMUMS
  maxrudder    = 100
  maxthrust    = 100

  // A non-zero SPEED_FACTOR overrides use of SPEED_PID
  // Will set DESIRED_THRUST = DESIRED_SPEED * SPEED_FACTOR
  speed_factor = 20
}

//------------------------------------------
// pMarineViewer config block

ProcessConfig = pMarineViewer
{
  AppTick    = 4
  CommsTick  = 4

  //tiff_file            = forrest19.tif
  tiff_file            = MIT_SP.tif

  set_pan_x            = -130
  set_pan_y            = -140
  zoom                 = 0.9

  vehicle_shape_scale  = 1.5
  hash_delta           = 50
  hash_shade           = 0.4
  hash_viewable        = false

  trails_point_size    = 1

  // Appcast configuration
  appcast_height       = 75
  appcast_width        = 30
  appcast_viewable     = true
  appcast_color_scheme = indigo
  nodes_font_size      = medium
  procs_font_size      = medium
  appcast_font_size    = small
  
  scope  = VIEW_POINT
  scope  = RETURN
  scope  = WPT_STAT
  scope  = VIEW_SEGLIST

  button_one = DEPLOY # DEPLOY=true
  button_one = MOOS_MANUAL_OVERRIDE=false # RETURN=false
  button_two = RETURN # RETURN=true
}

//------------------------------------------
// pNodeReporter config block

ProcessConfig = pNodeReporter
{
  AppTick    = 2
  CommsTick	 = 2

  platform_type   = kayak
  platform_length = 4
}

//------------------------------------------
// pObstacleMgr Config Block

ProcessConfig = pObstacleMgr
{
  AppTick   = 4 
  CommsTick = 4 

  given_obstacle = format=radial, x=65, y=-110, pts=7, radius=10, snap=1, label=one, label_color=off

  obstacles_color = yellow
  post_view_polys = false
  given_max_duration = 1000
} 
\end{verbatim}
\normalsize
%============================================
\subsection{alpha.bhv}
%============================================
\scriptsize
\begin{verbatim}
//------------------------------------------
// NAME: M. Benjamin, MIT
// FILE: alpha.bhv
//------------------------------------------
initialize   DEPLOY = false
initialize   RETURN = false
initialize   OBSTACLE_HIT = 0

set MODE = ACTIVE {
  DEPLOY = true
  OBSTACLE_HIT = 0
} INACTIVE

set MODE = LEGRUN {
  MODE = ACTIVE
  RETURN != true
} RETURNING

//------------------------------------------------o
Behavior = BHV_LegRunZ
{
  name      = legs
  pwt       = 100
  condition = MODE == LEGRUN
  updates   = LEG_UPDATE
  perpetual = true

           speed = 1.4
  capture_radius = 5
     slip_radius = 15
        patience = 20
   offboard_tgap = 20

         leg = x=65,y=-110,len=200,ang=90
  turn1_bias = 100
  turn2_bias = 100
   turn1_dir = star
   turn2_dir = port
    turn_ext = 10

        repeat = 3
     turn1_rad = 15
     turn2_rad = 15
       mid_pct = 20
   adjust_turn = false
       legflag = PCT_TO_NEXT=$[PCT_NP]
       wptflag = LEG_RESULT="id=$[LEG_ID],dist=$[LEG_ODO],wraps=$[WRAPS]"

  visual_hints = nextpt_color=yellow
  visual_hints = nextpt_vertex_size=8
  visual_hints = nextpt_lcolor=gray70
  visual_hints = vertex_color=dodger_blue, edge_color=white
  visual_hints = vertex_size=6, edge_size=1
  visual_hints = turn_edge_color=gray80
  visual_hints = turn_vertex_color=green
}

	
//------------------------------------------------o
Behavior = BHV_Waypoint
{
  name       = waypt_return
  pwt        = 100
  condition  = MODE == RETURNING
  perpetual  = true
  endflag    = RETURN = false
  endflag    = DEPLOY = false
  endflag    = MISSION = complete

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

//------------------------------------------------o
Behavior = BHV_AvoidObstacleV24
{
  name       = avd_obs
  pwt        = 110
  condition  = MODE == ACTIVE
  templating = spawn
  updates    = OBSTACLE_ALERT

   use_refinery = true

      allowable_ttc = 100
     pwt_outer_dist = 50
     pwt_inner_dist = 25
  max_util_cpa_dist = 20
  min_util_cpa_dist = 10
     completed_dist = 55

	visual_hints = obstacle_edge_color = white
	visual_hints = obstacle_vertex_color = green
	visual_hints = obstacle_vertex_size = 3
	visual_hints = obstacle_label_color = off
	visual_hints = all_label_color = off
	}
	


\end{verbatim}
\normalsize
</pre></body></html>