What data does rosserial_python send to the client?

asked 2017-02-03 14:19:23 -0600

Steven_Daniluk gravatar image

Generally, beyond topics and parameter requests, what other data would rosserial_python send to the client (e.g. rosserial_arduino)? I’d appreciate if someone could provide some insights, particularly related to the situation I describe.

I’ve experienced some odd behaviour that appears to be due to the client getting overloaded with data from sources other than the topics being subscribed to. This may be the wrong conclusion, in which case I’d appreciate being corrected. Everything I describe is with ROS Indigo.

The setup:

  • Board: Arduino Nano
  • Sketch Size: ~80% of dynamic memory
  • Baud rate: 57600
  • Node X on laptop publishes topic A with two uint8 values at 50Hz
  • Node Y on arduino subscribes to topic A, checks for interrupts on pins, then publishes interrupt data on topic B with two uint8 values at 50Hz, and topic C with one uint32 value at 50Hz
  • Node Z on laptop subscribes to topics B and C

All of the above works properly when running alone. However, if I do any of the following I will receive erratic data from the interrupts, along with serial port read failure warnings:

  • Run Ruiz
  • Run rqt_plot
  • Write log outputs from a node on the laptop at a high frequency (e.g. 50Hz)

Adjusting the baud rate, both up and down did not resolve the issue. I also experimented with with limiting the number of publishers, subscribers, and buffer lengths for the nodehandle on the arduino. The default for the board is 25 publishers and subscribers, with buffer lengths of 280 bytes. I’ve reduced the subscribers to 2, and publishers to 3, and tried increasing/decreasing the buffer lengths independently to find the min/max workable values for the send and receive buffers. No combination resolves the problem completely.

Interestingly, if I lower the send buffer to 100 bytes, and increase the receive buffer to 512 bytes, the erratic behaviour is not present when only rqt_plot is running, but is present if rqt_plot and Rviz (or some combination of the above) are running.

Everything I’ve described I’ve been able to consistently recreate.

I’ve since switched to using rosserial_server instead of rosserial_python, and everything works properly without any warnings (although rosserial_server may not print the same packet warnings). Due to this, I don’t believe there is any faults with my arduino sketch or my use of interrupts. However, I’m still curious as to what would have caused this behaviour.

When using rosserial_python I believe the client is getting overloaded with data, possibly in the form of topic advertisements or outputs from rosconsole. Would this conclusion be correct? If so, would there be any ways to mitigate this problem?

edit retag flag offensive close merge delete