diff --git a/src/simulation/vizard/vizInterface/vizInterface.rst b/src/simulation/vizard/vizInterface/vizInterface.rst index 1aa43ba274..d4bd8e8835 100644 --- a/src/simulation/vizard/vizInterface/vizInterface.rst +++ b/src/simulation/vizard/vizInterface/vizInterface.rst @@ -59,6 +59,17 @@ The ``VizSpacecraftData`` structure, defined in :ref:`vizStructures`, contains a - (optional) Vector of CSS config log messages +Handshaking Protocol +-------------------- +``vizInterface`` facilitates the port configuration and handshaking process between BSK and Vizard. The current implementation of this protocol is defined here for developers, for use if an alternate visualization destination is desired. + +BSK instantiates the broadcast socket using ``zmq_bind``, and the 2-way socket using ``zmq_connect``. Vizard joins these sockets using reciprocal ``connect`` and ``bind`` structure where appropriate. + +The remaining complexity is with the 2-way socket, which couples BSK and Vizard in lockstep. After instantiation, ``vizInterface`` empties the socket and sends "PING" to start communication. When sending a sim update, ``vizInterface`` first sends the string "SIM_UPDATE", followed by 2 empty messages, followed by the serialized message protobuffer. It then listens for the response "OK". Periodic "PING" messages may be sent to keep the socket alive. To receive user input from Vizard, ``vizInterface`` sends the string "REQUEST_INPUT". It then collects the user input message, followed by a status string. The string "VIZARD_INPUT" signifies a successful send, while "ERROR" signifies an issue during transmission. When using ``opNav``, the string "REQUEST_IMAGE\_" is sent to request for an image from configured onboard cameras. + +For more specifics in message packaging and handling, see the source code for this module. + + User Guide ---------- The ``vizInterface`` module can be directly configured, or setup using the helper methods in :ref:`vizSupport`.