Client
The client connection to the robot is a single synchronous client server connection, that connects over port 4400
.
Writing to the robot
To send a message to the robot data is taken in by the client as a probe id and value tuple, and encoded as a tlv packet, where t = type / probe id, l = length, and v = value. python struct is used to create a packed byte object out of the tlv data. This byte object is appended to any other probe messages that are also being sent and all of there are wrapped in a second TLV packet, where the type is a probe message and the value is all the probe messages. This is then also packed into a byte object, and then sent to the server.
Reading from the robot
Data from the robot can be captured by the Listener which is a Thread child class. And probes that have been enabled will have their data sent by the server to the client on every broadcast interval. The base client class will read that data in and add it to a message queue, unless it is a debug message or a probe message. probe messages are added to a buffer and can be read out at a later stage. In the hv_client the probe messages are pushed to the data storage objects in the corresponding Reader classes that will the publish the data to ROS topics.