<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_memo_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Inter-Vehicle Messaging}
%\vspace{0.17in}
%\labpng{0.65}{figures/convoying.png}
\vspace{0.15in}
\labdate{Nov 2023}
\vspace{0.1in}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labsrc{project-pavlab/memos/memo\_swarm\_messaging}
\labtoc{small}
\end{labcover}

\wikidoc{file=Memo.SwarmMessaging}
\wikidoc{auth=mikerb@mit.edu}


%===================================================== Messaging
\section{Inter-Vehicle Messaging}
%===================================================== Messaging

A common thread of missions involving the Swarm Autonomy Toolbox
involves {\em inter-vehicle messaging}. Even in the cases where
coordination involves purely knowledge of collaborator positions,
i.e., no inter-vehicle auctions, position information messages need to
be exchanged if the vehicles are not sensing each other's position.
The inter-vehicle messaging scheme supporting the Swarm Autonomy
Toolbox is derived partly from tools in the public MOOS-IvP codebase
and partly from tools currently in the Swarm Autonomy Toolbox. They
are described here.

%=====================================================
\subsection{General Messaging}

An inter-vehicle message contains at least four critical parts:

\begin{packed_itemize}
\item Source node
\item Destination node
\item Message name (MOOS variable)
\item Message content
\end{packed_itemize}

\vspace{0.1in}
\noindent
All messages can be serialized into a simple string. For example, if the
vehicle {\em abe} wishes to share a message with vehicle {\em ben} about
a temperature measurement at a particular location, it may look like:

\vspace{0.1in}
\begin{consoleverb}
src=abe, dest=ben, varname=TEMP_MEASUREMENT, value="lat=43.825300, lon=-70.330400, temp=68.4"
\end{consoleverb}
\vspace{0.1in}

\vspace{0.1in}
\noindent
This message, if it is an outgoing message on vehicle {\em abe}, is itself published to
the local MOOS variable \var{NODE\_MESSAGE\_LOCAL}:

\vspace{0.1in}
\begin{consoleverb}
NODE_MESSAGE_LOCAL = src=abe, dest=ben, varname=TEMP_MEASUREMENT, 
                     value="lat=43.825300, lon=-70.330400, temp=68.4"
\end{consoleverb}
\vspace{0.1in}

\vspace{0.1in}
\noindent
This message will be routed ultimately to vehicle {\em ben}, an incoming
message under the MOOS variable name \var{NODE\_MESSAGE}. A MOOS app
on the receiving vehicle receives the \var{NODE\_MESSAGE} and unpacks
the intended message. In the above example, the variable
\var{TEMP\_MEASUREMENT} is published on vehicle {\em ben}. The idea
is shown in Figure \ref{fig_comms_general}.

\vspace{0.1in}
\begin{figure}[H]
  \centering
  \includegraphics[width=0.75\textwidth]{figures/comms_general.png}
  \caption{{\bf General Abstract Flow of Messages}: Messages are
    packed as a single serialized string on the originating vehicle,
    and unpacked on the destination vehicle with intended message
    posted in the destination vehicle's local MOOSDB.}
  \label{fig_comms_general}
\end{figure}

\vspace{0.1in}
\noindent
The above protocol and sequence of events is how inter-vehicle
messaging is implemented at the very front end and back end the set of
steps constituting a message from one vehicle to another. In between
there may be queuing or prioritization, and any number of other
intermediate steps depending on the comms medium, e.g., underwater
acoustic comms, WiFi, marine radio, satellite and so on.

\vspace{0.1in}
\noindent
The above protocol existed prior to the Swarm Autonomy Toolbox, as
part of the uField Toolbox, which is part of the MOOS-IvP public
codebase.

%=====================================================
\subsection{Simulated Messaging}

The inter-vehicle messaging scheme described above is implemented in
simulation by routing all messages through a third-party (shoreside)
MOOS community. The \var{uFldNodeComms} MOOS app is part of the public
MOOS-IvP codebase and handles the routing of inter-vehicle
messages. This app is aware of all vehicle positions and can simulate
lossy and range-limit comms between vehicles. This configuration not
only is used in pure simulation, but also on field deployments to
simulate lossy comms while exercising actual vehicles.

\vspace{0.1in}
\begin{figure}[H]
  \centering
  \includegraphics[width=0.65\textwidth]{figures/ufld_nodecomms.png}
  \caption{{\bf Simulated Messaging}: In simulation, a shoreside
    community routes all inter-vehicle messages through the
    \var{uFldNodeComms}, which considers the range between vessels,
    time since a previous message, and other factors, to simulate
    lossy and range and bandwidth limited comms in the real world.}
  \label{fig_ufld_nodecomms}
\end{figure}

\vspace{0.1in}
\noindent
In the Swarm Autonomy Toolbox, a mediated messaging regime has been
implemented in the \var{pMediator} app described in Section
\ref{sec_pmed}. The uField messaging regime of the public codebase has
been augmented to handled mediated messages in the \var{uFldNodeComms}
application.

%=====================================================
\subsection{Mediated Messaging}
\label{sec_pmed}

The Swarm Autonomy Toolbox contains a new app, \var{pMediator}, for adding
a layer of send-acknowledge protocol on top of the bare inter-vehicle
messaging. This app will address lossy-comms situations, enabling critical
messages to be re-sent essentially until an acknowledgment has been received,
or some fixed but configurable number of repeated tries. This app will also
retain statistics on quality of communications between nodes to alert
mission operators to worsening conditions before things become critical. 

\vspace{0.1in}
\noindent
This app runs on each vehicle handling both outgoing and incoming
messages. As an outgoing handler, it intercepts each outgoing message
and assigns a unique message ID appended to the outgoing message. On
the incoming handler, \var{pMediator} will send a return
acknowledgment for each incoming message. The basic idea is shown in
Figure \ref{fig_comms_mediated}.

\vspace{0.1in}
\begin{figure}[H]
  \centering
  \includegraphics[width=0.8\textwidth]{figures/comms_mediated.png}
  \caption{{\bf Mediated Messaging}: In mediated messaging, (1) the
    originating app published an inter-vehicle message which (2) is
    intercepted by the \var{pMediator} app on the originating vehicle
    where a unique message ID is appended to the message. When (3) it
    is received on the destination vehicle, the message ID is noted,
    and (4) the message is passed on to the \var{uFldMessageHandler}
    app which then publishes the intended message to (5) the application
    that consumes the message. Upon receipt of the message on the
    destination vehicle, an acknowledgment message is sent back to the
    originating vehicle. The originating vehicle may repeat the message
    until an acknowledgment is received. If the destination vehicle
    receives the same message twice (same message ID), the subsequent
    messages are ignore and not posted locally more than once.}
  \label{fig_comms_mediated}
\end{figure}

\vspace{0.1in}
\noindent
The first version of the \var{pMediator} app was completed in the
winter of 2022, tested in simulation, and will be field-tested in the
summer of 2022.




%\small
%\nocite{bnsl11}
%\bibliographystyle{plain}
%\bibliography{biblio}
%\normalsize

\end{document} 



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