<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%=======================================================================
\newpage
\section{Appendix A: Checklist for Multi-Vehicle Configuration Files}
%=======================================================================

Below is a checklist for plug files in multi-machine missions. The launch
scripts used in this lab follow a convention that assumes the below plugs have
the macro configurations as shown.

%-----------------------------------------------------------------
\subsection*{Configuration for pHostInfo}

Normally \app{pHostInfo} will auto-discover the machine's publicly
available IP address, or discover the local network IP address if
there is no public one. In our launch scripts we leave nothing to
chance and will set the \var{IP\_ADDR} macro on the command line. If
not specified on the command line, it will have the default value of
\var{"localhost"}. Make sure the lines below are in your
\var{plug\_pHostInfo.moos} file


\vspace{0.1in}
\begin{fileverb}
ProcessConfig = pHostInfo
{
  AppTick 	= 1
  CommsTick 	= 1

#ifdef IP_ADDR
  default_hostip_force = $(IP_ADDR)
#endif
}
\end{fileverb}
\vspace{0.1in}

\noindent
When both the vehicle and shoreside communities are launched, we will provide the
correct public IP address on the command line:

\vspace{0.1in}
\begin{consoleverb}
  $ ./launch_shoreside.sh --ip=128.22.44.22
  $ ./launch_vehicle.sh --ip=128.22.44.22
\end{consoleverb}
\vspace{0.1in}

\noindent
This command line argument will propagate to expand the \var{\$(IP\_ADDR)} macro in
the resuling \var{targ} files.

%-----------------------------------------------------------------
\subsection*{Configuration for uFldNodeBroker}

Each vehicle community will attempt to find the shoreside and initiate a connection,
using the \app{uFldNodeBroker} app. The below \mvar{try\_shore\_host} line needs to be
in your \var{plug\_uFldNodeBroker.moos} file:

\vspace{0.1in}
\begin{fileverb}
ProcessConfig = uFldNodeBroker
{
  ...
  try_shore_host = pshare_route=$(SHORE_IP):$(SHORE_PSHARE)
  ...
}
\end{fileverb}
\vspace{0.1in}

\noindent
Recall the \var{\$(SHORE\_IP)} macro is derived from the \var{--shore=} command
line argument passed to \var{launch\_vehicle.sh}. For example:

\vspace{0.1in}
\begin{consoleverb}
  $ ./launch_vehicle.sh --ip=128.22.44.22 --shore=128.55.66.77
\end{consoleverb}
\vspace{0.1in}



%-----------------------------------------------------------------
\subsection*{Configuration for pShare}

Both the shoreside and vehicle communities need to configure their
\app{pShare} input route. The route is comprised of the (a) IP address, and
(b) \app{pShare} port number.

\vspace{0.1in}
\begin{fileverb}
ProcessConfig = pShare
{
  AppTick    = 2
  CommsTick  = 2

  input = route =  $(IP_ADDR):$(PSHARE_PORT)
}
\end{fileverb}
\vspace{0.1in}

\noindent
Note that we use a convention where the shoreside \app{pShare} port is always 9200,
and each successive vehicle uses 9201, 9202, and so on. This is not to be confused
with the \cmd{MOOSDB} port number, which is always 9000 for the shoreside and
9001, 9002, and so on, for each successive vehicle.

\vspace{0.1in}
\noindent
When launching a vehicle with \var{launch\_vehicle.sh}, the default
\var{\$(PSHARE\_PORT)} will be 9201. So if you are launching only a
single vehicle, the \app{pShare} port does not need to be
provided. But if you are launching two vehicles from the same machine,
a unique \app{pShare} port number must be provided:

\vspace{0.1in}
\begin{consoleverb}
  $ ./launch_vehicle.sh --ip=128.1.2.3 --shore=128.4.5.7                (first vehicle)
  $ ./launch_vehicle.sh --ip=128.1.2.3 --shore=128.4.5.7 --pshare=9202  (second vehicle)
\end{consoleverb}
\vspace{0.1in}





</pre></body></html>