Error when publishing odom message

Hello
I had a working Core2 program (connected with RPi), which subscribed two topics (cmd_vel and EmptyMessage) and publishes five topics (2 Int32, Range, BatteryState, and PoseStamped). When I try to add an additional Odometry message I get the following error:

wrong checksum for topic id and msg

which was repeated very often.
I tried to incease the input and output buffers for messages but that does not help. The error occurs also when the odom message is empty (just filled with IDs and time stamp).
Any ideas?

Michael

Hello Michael,

The nav_msgs/Odometry message is quite a big one as for sending it through serial port. To get rid of this error you could reduce the rate on which the message is published.

None of the messages is sent ‘empty’, if you do do not fill it with your values, it will get all fields filled with zeros by default.

Increasing the buffer size will not solve the problem, if more messages are sent than can be processed, the buffer will get filled regardless of its size.

Regards,
Łukasz

Hi Łukasz
I understand that it makes not much sense to send expensive messages from the Core2.
But what is the recommended architecture for topics/messages?
If the embedded System only send low level messages such as Int32 (for encoder ticks), ranges, IMU data and data from other sensors and the high level messages (tf, odom, pose, …) are send from e.g. RPi the RPi must have knowledge about the hardware of the robot (ticks per revolution, wheel diameter, …).
What is the ROS way of doing this?

Michael

It is possible to send high level messages, but you need to consider their sizes:
geometry_msgs/Pose takes 56 bytes
nav_msgs/Odometry takes 692 bytes plus size of the frame_id length
It is recommended to choose messages with small size or lower the publishing rate.

Regards,
Łukasz

Thanks for your fast answer,
I will try to lower the publishing rate.
But what is the recommended way to manage such things from your experience?

Michael

For most of my use cases only the geometry_msgs/Pose published at 10Hz is enough. It could get to 50Hz without problems.
If your system need exactly the nav_msgs/Odometry at high rate, you could implement your own node that subscribes pose, convert it to odom and publish at new topic.

Regards,
Łukasz

The own node is what I am thinking about, but for converting the odom data some infomation for calculating the velocity is necessary which is dependent from the robot (delay, ticks, diameter, …) so I think it is difficult to separate the levels of messages (or at least I have not found the right way yet).

Michael

Instead of Pose, you could use PoseStamped - it contains time stamp and still requires small amount of data. All other values (encoder resolution, diameters) are constant. You can have them hard-coded in your node or defined with parameters through .launch file.

Regards,
Łukasz

Thanks, I will try that.

Michael