Communication Protocol: Mission Control to and from Jetson

The "base station" refers to any computer that is running our Mission Control software []. This software runs a standard TCP server which the rover connects to. The rover automatically chooses which IP address to connect to based on the SSH_CLIENT environment variable. That is, it is assumed that whichever computer was used to SSH into the Jetson is also the base station.

Once the TCP socket is connected, the communication protocol is based on JSON. The packet format is a four-byte header followed by a variable-length body. The header is a four-byte little-endian integer specifying the length of the body (in bytes). The body is a JSON object (a string encoded in UTF-8, I think?). The Mission Control side of the implementation is here [] and the rover side is here [].

As of this writing, this protocol is implemented only for the base-station-to-rover direction. We sometimes send JSON packets the other direction (from the rover to the base station) but this doesn't use the length headers, is probably super buggy, and isn't yet used for anything in Mission Control.

The base-station-to-rover JSON objects are formatted as follows.