Robustify RTPS bridge stream parsing.

This commit is contained in:
Thomas Schneider
2022-07-20 01:13:47 -04:00
committed by Daniel Agar
parent 089fbdccc9
commit cd66a262ee
4 changed files with 136 additions and 82 deletions
+6 -2
View File
@@ -364,10 +364,14 @@ int main(int argc, char **argv)
if (!receiving) { start = std::chrono::steady_clock::now(); }
// Publish messages received from UART
if (0 < (length = transport_node->read(&topic_ID, data_buffer, BUFFER_SIZE))) {
length = transport_node->read();
if (length > 0) {
total_read += length;
}
while (transport_node->parse(&topic_ID, data_buffer, BUFFER_SIZE)) {
topics->publish(topic_ID, data_buffer, sizeof(data_buffer));
++received;
total_read += length;
receiving = true;
end = std::chrono::steady_clock::now();
}