Skip to content

Commit

Permalink
Document vizInterface port handshaking
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfox25 committed Dec 25, 2024
1 parent 0bae4ce commit aa248c1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/simulation/vizard/vizInterface/vizInterface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit aa248c1

Please sign in to comment.