ROS message sizes in Simulink - AD-EYE/AD-EYE_Core GitHub Wiki

The issue

Simulink (more precisely the Robotic systems toolbox) requires to know the size of the messages it sends to ROS.

The simple fix

The simple fix to setting the message size is through Tool, Robot Operating System and Manage Array size.

Images/Message_length_2.png

This allows to set the size for a certain attribute of a specific message message.

Images/Message_length_3.png

The issue is that the size might not always for different occurrences of the same message type. An example is the frame_id field: "/base_link" and "/camera1" do not have the same length.

The elaborate fix

The solution to having different sizes for the same message field can be seen on the following picture (note that only the frameId was kept to make the illustration clearer).

Images/Message_length_4.png