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

You need an output buffer large enough to hold all messages published between calls to spinOnce(). (When you call spinOnce(), all queued, published messages are sent, and incoming messages are retrieved into the input buffer.) If you are publishing several messages before calling spinOnce() you could be running out of buffer space. You might try inserting more calls to spinOnce(), perhaps after every Odometry message. (It's a round-trip handshake to the host, but might make the code work.)

On a Mega you're probably OK memory-wise. I'm working with a 2kb Arduino-compatible, and have abandoned rosserial because of the large memory footprint. I second the suggestion of ros_arduino_bridge as an alternative.

You need an output buffer large enough to hold all messages published between calls to spinOnce(). (When you call spinOnce(), all queued, published messages are sent, and incoming messages are retrieved into the input buffer.) If you are publishing several messages before calling spinOnce() you could be running out of buffer space. You might try inserting more calls to spinOnce(), perhaps after every Odometry message. (It's a round-trip handshake to the host, but might make the code work.)buffer.)

On a Mega you're probably OK memory-wise. I'm working with a 2kb Arduino-compatible, and have abandoned rosserial because of the large memory footprint. I second the suggestion of ros_arduino_bridge as an alternative.