PlotJuggler / plotjuggler-ros-plugins

Many PlotJuggler plugins for ROS and ROS2.
GNU Affero General Public License v3.0
109 stars 44 forks source link

ROS2 plugin fails to parse messages containing arrays longer than 100 items #57

Closed esteve closed 11 months ago

esteve commented 1 year ago

When loading a rosbag2 serialized as CDR that contains messages that have arrays as fields with over 100 items, the data load ROS2 plugin fails with the message "Not enough memory in the buffer stream", as seen in the following screenshot:

image

I've created a repo with rosbags of messages with arrays of different sizes (https://github.com/esteve/capacity_messages_plotjuggler), any rosbag with over 100 messages (i.e. test_capacity_msgs101.bag, test_capacity_msgs1000.bag, test_capacity_msgs10000.bag) will cause this error.

I've looked into the code of the ROS2 plugins, and it seems that https://github.com/PlotJuggler/plotjuggler-ros-plugins/blob/rolling/plugins/ros2_introspection/src/ros2_introspection.cpp#L114 is somehow not honoring https://github.com/PlotJuggler/plotjuggler-ros-plugins/blob/rolling/plugins/ros2_introspection/include/ros2_introspection/ros2_introspection.hpp#L90, but I'm not entirely sure if that's the cause. The other lead I have is https://github.com/PlotJuggler/plotjuggler-ros-plugins/blob/rolling/plugins/parser_configuration.cpp#L63, but increasing the default value to anything above 100 doesn't do anything.

esteve commented 1 year ago

I've re-recorded new rosbags and the issue no longer appears, even the 1000 items array in https://github.com/esteve/capacity_messages_plotjuggler/tree/main/test_capacity_msgs1000_new.bag loads fine. I don't know what the issue in the old rosbags is.