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

[Solved] Issue with checksums when using custom message and rosserial

asked 2022-07-11 09:19:31 -0600

Schteve-earl gravatar image

updated 2022-07-11 13:00:52 -0600

I'm attempting to create a custom message and transmit it to an Arduino, as per the rosserial_client tutorials. I've generated my message headers by running the "make libraries" command in the rosserial_client, and I am able to compile/upload a sketch in the Arduino IDE using my custom message. However, the serial_node crashes with this error:

rosout: Creation of subscriber failed: Checksum does not match: 583de20b25dc989387bf70bf9589bcbe,583de20b25dc989387bf70bf9589bcbecustom_message_package_msgs/CustomMessage

It would appear that the message type is getting appended to the checksum. I'm running Ros Noetic, this error occurs when using the rosserial binaries and when building from source. Has anybody seen this issue before, and is there a solution for this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-07-11 12:59:59 -0600

Schteve-earl gravatar image

I switched from using an Arduino Uno to an Arduino Mega, and the situation resolved itself. I encountered the same error when using std_msgs::Float32MultiArray and the Arduino compiler gave me a warning stating that I was using 85% of the Uno's dynamic memory. So, as of now, the working solution is to get a board with more horsepower if you receive this error.

edit flag offensive delete link more


In my experience, using any variable-size arrays for arduino messages can lead to problems. It seems that when generated, these headers contain realloc() calls and do not check them for failure. For example, std_msgs::Float32MultiArray has

this->data = (float*)realloc(this->data, data_lengthT * sizeof(float));

which could, theoretically, return a null pointer if there is not enough memory left to realloc successfully. 85% of arduino memory is usually cutting it close to when some dynamic allocation calls can break the limit. When I changed std_msgs::Float32MultiArray to a custom message with fixed-size variables, weird problems went away.

Also, it is probably possible for a bunch of such allocations from different callbacks to eventually fragment the available memory into unusable small chunks, so the memory failures can appear after some time or when a lot of messages were passed via the topic.

Maxim Rovbo gravatar image Maxim Rovbo  ( 2022-11-09 05:11:45 -0600 )edit

Question Tools


Asked: 2022-07-11 09:19:31 -0600

Seen: 90 times

Last updated: Jul 11 '22