NiryoRobotics / niryo_one_ros

Niryo One ROS stack
GNU General Public License v3.0
234 stars 160 forks source link

Quotes around the error reason in the tcp_server protocol are missing #37

Open rickardraysearch opened 4 years ago

rickardraysearch commented 4 years ago

In the documentation for the tcp_server, the format for error messages are given as follows:

In the implementation, there are no quotes around the error message. This makes it impossible to detect the end of the response. That also exposes a larger problem with the protocol, which is that it is difficult to resynchronize after reading a partial message, since there are no delimiters between responses. Adding a line break after the response would greatly simplify resynchronization.

The python client assumes incorrectly that reads from a tcp socket will return full messages, and will thus break if a partial read is returned. See https://docs.python.org/3/howto/sockets.html , specifically the last 3 paragraphs of the "Using a Socket" section.