<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
\input{common_latex/common_latex_packages}
\input{common_latex/common_latex_definitions}
\input{common_latex/common_latex_help_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Help Topic: Downloading and Building the MOOS-IvP Extend Tree}
\vspace{0.1in}
\labdate{Spring 2020}
\vspace{0.1in}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labline
\end{labcover}

\wikidoc{file=Help.MIPExtend}
\wikidoc{auth=mikerb@mit.edu}

%=========================================================================
\section*{Downloading and Building the \psvarr{moos-ivp-extend} Tree}
%======================================================================

A first step to writing and adding your MOOS-IvP code is to download
the \var{moos-ivp-extend} tree.

\pskip
\noindent
This tree may be regarded as a template for building your own set of
MOOS applications, Helm behaviors, or other utilities. It contains a
single MOOS app and a single Helm behavior, but more importantly a
file structure and CMake C++ build system for build the source
code. Eventually you will want to understand more about Make files and
CMake files. But for now, by starting with a working template, the
addition of new MOOS applications to the build structure is a simple
matter of editing one or two files.

\vspace{0.15in}
\noindent
Your goals in this part are:

\begin{packed_enumerate}[3]

\item From a terminal window download a copy of the
  \var{moos-ivp-extend} tree with the following svn command:

\begin{consoleverb}
 $ svn co https://oceanai.mit.edu/svn/moos-ivp-extend/trunk moos-ivp-extend
\end{consoleverb}

\noindent
Verify that you can build this tree by:

\begin{consoleverb}
 $ cd moos-ivp-extend
 $ ./build.sh
\end{consoleverb}

\noindent
It should add executable, \app{pXRelayTest}, in \var{moos-ivp-extend/bin/}. 

\vspace{0.1in}
\item Add the following directory to your shell path: \var{moos-ivp-extend/bin}

\vspace{0.1in}
\item The \app{pXRelayTest} application built in this tree if very
  close to the \app{pXRelay} app distributed with the \var{moos-ivp}
  tree. Modify your \var{xrelay.moos} mission in
  \var{moos-ivp-extend/missions/xrelay} to use the \app{pXRelayTest}
  application instead. To do this, edit the Antler configuration block,
  in \var{xrelay.moos}, to use \app{pXRelayTest} on one or both of
  \var{"Run"} lines.

\begin{fileverb}
// File: moos-ivp-extend/missions/xrelay/xrelay.moos

o o o 
  Run = MOOSDB       @ NewConsole = false
  Run = pXRelay      @ NewConsole = true ~ pXRelay_APPLES
  Run = pXRelayTest  @ NewConsole = true ~ pXRelay_PEARS      &lt;-- Using pXRelayTest
  Run = uXMS         @ NewConsole = true
o o o
\end{fileverb}

\item Launch the modified mission and verify that {\em both} the \app{pXRelay}
  and \app{pXRelayTest} apps are running

\begin{consoleverb}
  $ cd moos-ivp-extend/missions/xrelay
  $ pAntler xrelay.moos
\end{consoleverb}

You should see three windows pop up as in Figure \ref{fig_xrelay}
below. Note that one of them has the title bar "pXRelay" and
"pXRelayTest".
  
\end{packed_enumerate}

\vspace{0.1in}
\begin{figure}[ht]
  \centering
  \includegraphics[width=0.65\linewidth]{figs_help/xrelay_extend.png}
  \caption{{\bf The XRelay Mission}: Note that an instance of {\em both}
    \vvar{pXRelay} and \vvar{pXRelayTest} are running.}
\label{fig_xrelay}
\end{figure}


\noindent
And, if you're familiar with this app, you know you can initiate the ping-pong
behavior between the two of them by poking one of them with:

\begin{consoleverb}
  $ cd moos-ivp-extend/missions/xrelay
  $ uPokeDB xrelay.moos APPLES=1
\end{consoleverb}

%==================================================================
\subsection*{Troubleshooting}

If you are not seeing the launching of the terminal windows as in Figure
\ref{fig_xrelay}, it may be because you do not have the XTerm utility
installed. This is likely installed by default in Linux systems, but as
of this writing, it is not installed by default in MacOS. You can
confirm using the \cmd{which} command. Hopefully you see something like:

\begin{consoleverb}
  $ which xterm
  $ /usr/X11/bin/xterm   &lt;--- Installed and in your shell path - good!
\end{consoleverb}

\vspace{0.1in}
\noindent
And not something like:

\begin{consoleverb}
  $ which xterm
  $                      &lt;--- Not installed, or not in your shell path - bad!
\end{consoleverb}

\vspace{0.1in}
\noindent
On MacOS, the recommendation is to install XQuartz from \urlx{https://www.xquartz.org}.

\end{document}

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