ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

My first thought is that you are trying to send too much data over serial. You mention that the messages that you are receiving contain a pose and two floats. That means they are (7*64 + 32 + 32) bits per message. This gives ~512 bits per message, and you are subscribing to two topics containing these messages.

If you are using the default baud rate of 9600, you will likely have issues. If both of your topics were publishing at 20Hz, that would result in 20,480 bits/s (202512). Plus there should be a bit of overhead for communication on top of that.

Also, I believe rosserial_arduino's buffer is about 80 bytes (I read that somewhere, but I cannot recall where). Two of your messages consume 128 bytes, which would be problematic if my memory of an 80 byte buffer is correct.

So, your options then would be:

  • Increase the baud rate, and hope the buffer is not the limiting factor
  • Find a way to reduce your message size (do you need all 6 degrees of freedom in the pose?)
  • Throttle the frequency which your messages are published (can whatever your messages are being used for respond at that rate?)

You can increase the baud rate with the arduino by adding to your arduino script:

nh.getHardware()->setBaud(57600);

Along with the parameter for the rosserial_arduino node:

<param name="baud" value="57600"/>