ROS 2 Eloquent Segmentation fault (core dumped)

asked 2020-08-04 01:43:35 -0500

naaju gravatar image

updated 2020-08-05 01:36:38 -0500

I have a ROS 2 node running on my local network sending image data to another ROS 2 node running on a VM in the cloud. Both nodes run on Ubuntu 18.04 and ROS eloquent.To test the functionality, I use this ROS Node:

https://github.com/julian533/ros2_vid...

   def publish_random_images(self):
    for i in range(200, 800, 25):
        image_np = np.uint8(np.random.randint(0, 255, size=(i, i, 3)))
        # Convert the image to a message
        time_msg = self.get_time_msg()
        img_msg = self.get_image_msg(image_np, time_msg)
        #if self.calib:
        #    camera_info_msg = self.get_camera_info(time_msg)
        #self.camera_info_publisher_.publish(camera_info_msg)
        self.image_publisher_.publish(img_msg)
        self.get_logger().info("Published image of size: " + str(i) + " x " + str(i))
        time.sleep(1)

So I'm sending Random Pictures with Increasing Size. I can receive the image data up to a size of 320x320 pixel on the node in the cloud. All images that exceed this size are no longer received and I get the following error message:

Segmentation fault (core dumped)

I have increased the value of the ipfrag_high_thresh and implemented the Quality of Service settings as seen in the linked file. Without the Qos settings I could transfer a maximum of 270x270 pixels. I have also tried cyclonedds, but could not achieve better performance with.

Does anyone have an idea what I could change to increase the transmittable image size? Or what's causing the core dump.

edit retag flag offensive close merge delete

Comments

I am not 100% sure on this, but I suspect permuting the image size of a topic is not a wise move. I think someone with more knowledge of topic internals would have more to say on this. When I've seen this done it has been through dynamic reconfigure or having a service that adjusts the topic. Why are you doing this? It seems like something that would only be useful for exhaustive testing / fuzzing.

kscottz gravatar image kscottz  ( 2020-08-04 14:57:37 -0500 )edit

It's actually more of a test. I have first tried to transfer pictures with the size 640x480 pixels. The topic of the image data was available in the VM, but no data was transferred on the topic. So I changed the image sizes and looked if this is responsible for the behaviour. I guess I didn't properly phrase the question. I want to increase the maximum transmitted image size and find out what is causing the segmentation fault. In the actual application, fixed image sizes are transferred. The shown application should only show up to which image size data is transferred. I hope this makes it clearer

naaju gravatar image naaju  ( 2020-08-05 01:55:25 -0500 )edit

Those seem like two distinct problems. I am sure there is probably a maximum image size, but it is probably quite large. The QoS requirements might change that but I feel like you should be able to back calculate that from the bandwidth.

The segfault on changing the topic size is a whole different story. Does this occur when there are no QoS settings?

kscottz gravatar image kscottz  ( 2020-08-05 19:09:25 -0500 )edit