<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: Launching the MOOSDB}
\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.MIPLaunchMOOS}
\wikidoc{auth=mikerb@mit.edu}

%====================================================================
\section*{Launching the MOOSDB}
%====================================================================

Here we describe how to launch the \app{MOOSDB} from the perspective
of the first-time user. The \app{MOOSDB} application is a server that
runs on the robot or unmanned vehicle computer, or simply on your
laptop during simulation. It may be launched from the command line,
assuming it is in your path.  Two minimalist methods are described
here, starting with the most bare-bones.

%====================================================================
\subsection*{A Bare-Bones Launching of the MOOSDB}

In a bare-bones manner, the \app{MOOSDB} may be launched from the
command line without any arguments. Normally the \app{MOOSDB} needs to
know at least two pieces of configuration information, (a) the machine
IP address on which to run, and (b) the port number on which to
serve clients.

\vspace{0.1in}
\noindent
(Recall an IP address is comprised of four numbers in the range of
[0,255] separated by a period. IP addresses are used for finding a
particular machine on the Internet. For example, the oceanai class
server resides at 18.18.38.22. The term "localhost" acts as a stand-in
IP address when refering to one's own machine. The port number refers
to a channel of sorts on a computer. It's fair to think of the IP
address like the street address of an apartment building, and the port
number as the unit number within the building where a particular
resident resides.) 

\vspace{0.1in}
\noindent
When launching the \app{MOOSDB} with no command line arguments, it
will default to running on the localhost and port 9000:

\vspace{0.1in}
\begin{consoleverb}
 $ MOOSDB
 ------------------- MOOSDB V10 -------------------
 Hosting  community                "#1"
 Name look up is                   off
 Asynchronous support is           on
 Connect to this server on port    9000
 --------------------------------------------------
 network performance data published on localhost:9020
 listen with "nc -u -lk 9020"
\end{consoleverb}
\vspace{0.15in}

\noindent
At this point the \app{MOOSDB} is running on the local machine,
serving clients on port 9000. A few variables are already being
published, by the \app{MOOSDB} itself. You can open a scope
with \app{uXMS} in another terminal window:

\vspace{0.15in}
\begin{consoleverb}
  $ uXMS DB_CLIENTS DB_TIME DB_UPTIME --serverhost=localhost --serverport=9000 

  ==============================================================
  uXMS_581                                              0/0(154)
  ==============================================================
  VarName     (S)ource   (T)ime  (C)  VarValue (SCOPING:EVENTS)
  ----------  ---------  ------  ---  -------------------------
  DB_CLIENTS  MOOSDB_#1  38.14        "uXMS_581,"
  DB_TIME     MOOSDB_#1  38.14        1387380731.414707
  DB_UPTIME   MOOSDB_#1  38.14        39.00859
\end{consoleverb}
\vspace{0.1in}

\noindent
The Source and Time columns may be expanded by hitting the \var{"s"} and 
\var{"t"} keys respectively after it launches, or you can add 
\var{--show=source,time} as a command line argument to \app{uXMS}, to 
launch with these two columns expanded.

\pskip

\noindent
Alternatively you can scope with the \app{umm} tool:

\begin{consoleverb}
 $ umm --spy
\end{consoleverb}

\vspace{0.1in}
\noindent
The \app{umm} tool is part of the MOOS project at Oxford, while \app{uXMS}
tool is part of the MOOS-IvP project at MIT. Overlap between toolset
functions can often be found.

%====================================================================
\subsection*{A More Civilized Launching of the MOOSDB}

Virtually all MOOS applications are launched with a "mission
configuration" file, a.k.a. a "dot-moos" file. The below mission file,
\var{moosdb\_alpha.moos}, provides the minimal configuration parameters the
\app{MOOSDB} likes to see upon starting. 


\vspace{0.1in}
\begin{fileverb}
 // (wget http://oceanai.mit.edu/2.680/examples/moosdb_alpha.moos)
 ServerHost = localhost
 ServerPort = 9000
 Community  = alpha
\end{fileverb}
\vspace{0.1in}

\noindent
Passing the \var{moosdb\_alpha.moos} file as a command line argument produces
the below output.

\vspace{0.1in}
\begin{consoleverb}
 $ MOOSDB moosdb_alpha.moos
 ------------------- MOOSDB V10 -------------------
   Hosting  community                "alpha"
   Name look up is                   off
   Asynchronous support is           on
   Connect to this server on port    9000
 --------------------------------------------------
 network performance data published on localhost:9020
 listen with "nc -u -lk 9020"
\end{consoleverb}
\vspace{0.1in}

\noindent
Try this. Either copy and paste the above \var{.moos} file, or use \app{wget}
as shown on the first line above in the example file. If you haven't installed
\app{wget} or similar (e.g., \app{curl}), you should pause here and do that. 

\vspace{0.1in}
\begin{consoleverb}
 $ sudo apt install wget             (On Linux)
 $ brew install wget                 (On MacOS using Homebrew)
 $ sudo port install wget            (On MacOS using MacPorts)
\end{consoleverb}


\end{document}


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