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

Arduino to Rasspberry Pi3 rosserial communication issue

asked 2017-04-20 00:58:15 -0500

mtROS gravatar image

updated 2017-04-20 00:59:18 -0500

Hy @ all,

i’m having big troubles using rosserial and an Arduino UNO that publishes data with a baudrate of 57600. The communication is very unstable and following all types of messages appear:

[INFO] [1492667619.104258]: Protocol version of client is unrecognized, expected Rev 1 (rosserial 0.5+)
[INFO] [1492667619.139384]: wrong checksum for topic id and msg
[INFO] [1492667621.822400]: wrong checksum for topic id and msg
[INFO] [1492667621.834504]: wrong checksum for topic id and msg
[INFO] [1492667624.639665]: wrong checksum for topic id and msg
[ERROR] [1492667638.922764]: Lost sync with device, restarting...
[INFO] [1492667638.949403]: Setup publisher on Acceleration [std_msgs/UInt16]
[INFO] [1492667641.931132]: wrong checksum for msg length, length 2
[INFO] [1492667641.938244]: chk is 125
[INFO] [1492667644.763389]: wrong checksum for topic id and msg
[INFO] [1492667647.562569]: wrong checksum for topic id and msg
[INFO] [1492667647.602618]: wrong checksum for topic id and msg
[INFO] [1492667650.391716]: wrong checksum for topic id and msg
[ERROR] [1492667664.819193]: Lost sync with device, restarting...
[INFO] [1492667664.842178]: Setup publisher on Acceleration [std_msgs/UInt16]
[INFO] [1492667667.752884]: wrong checksum for msg length, length 2
[INFO] [1492667667.755096]: chk is 125
[INFO] [1492667670.646117]: wrong checksum for msg length, length 2
[INFO] [1492667670.647877]: chk is 0
[INFO] [1492667670.652876]: wrong checksum for msg length, length 32253
[INFO] [1492667670.655812]: chk is 0
[INFO] [1492667673.536994]: wrong checksum for topic id and msg
[ERROR] [1492667673.540280]: Mismatched protocol version in packet: lost sync or rosserial_python is from different ros release than the rosserial client
[INFO] [1492667673.541983]: Protocol version of client is unrecognized, expected Rev 1 (rosserial 0.5+)
[INFO] [1492667673.586425]: wrong checksum for topic id and msg
[ERROR] [1492667691.379182]: Lost sync with device, restarting...
[INFO] [1492667691.403129]: Setup publisher on Acceleration [std_msgs/UInt16]
[INFO] [1492667694.464336]: wrong checksum for msg length, length 2
[INFO] [1492667694.466331]: chk is 0
[INFO] [1492667694.488039]: wrong checksum for msg length, length 32253
[INFO] [1492667694.490161]: chk is 0
[INFO] [1492667696.366441]: Send tx stop request

Do you have an idea how to fix this problem?

Thanks for your help!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-04-20 13:18:53 -0500

Mark Rose gravatar image

updated 2017-04-20 13:20:14 -0500

Be sure that you have enough free memory on the Arduino side. I have abandoned trying to use rosserial_arduino on small-memory MCUs (2kb) because it was too unstable. The Arduino IDE will show you how much free memory you have after compiling. I found the system to be unstable with less than about 700 bytes free. rosserial uses quite a bit of static memory for buffers and message type names. You might try reducing the number of publishers and subscribers, or reduce the size of the input and output buffers. You can control all the sizes by using the internal NodeHandle_ type instead of NodeHandle:

 ros::NodeHandle_<ArduinoHardware, 3, 2, 200, 150> nh;

Here, the node handle is set up to have up to 3 subscribers, up to 2 publishers, an input buffer size of 200, and an output buffer size of 150. (The defaults are 25, 25, 512, and 512, respectively, which uses up a lot of the RAM on a 2kb Arduino.)

If you're running out of memory, you might try ros_arduino_bridge. A different approach, less ROS-like on the Arduino side, but much less memory usage.

edit flag offensive delete link more

Comments

Thank you very much Mark for your answer! I switched in the meantime to sensor_msgs/imu in order to publish my data. Maybe I come back to your solution in a couple of days!

mtROS gravatar image mtROS  ( 2017-04-20 13:38:54 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-04-20 00:58:15 -0500

Seen: 1,296 times

Last updated: Apr 20 '17