Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To my knowledge, you can't use the Arduino Serial library while sending/receiving ROS topics.

Since your data will be sent in the chatter.publish call, the rosserial_python node will see this data, as well as data sent with the Serial.println call, which is probably whats causing it to lose sync.

Try commenting out that Serial.println line in loop() and see if it can connect stably.

Also, I noticed that in your python solution you're using a baud rate of 115200, whereas the rosserial node is attempting to connect at 57600. Are you setting the serial rate to 115200 in your void setup() on the Arduino? You'll probably want to remove that as well as it will conflict with the rosserial configuration.

Best of luck!