Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rclcpp::SensorDataQoS not working for sensor_msgs::msg::Images #70

Open
xander-m2k opened this issue Jan 31, 2022 · 1 comment
Open
Assignees

Comments

@xander-m2k
Copy link

System Info

  • OS
    • Ubuntu 20.04
  • ROS version and installation type
    • ROS Foxy binary install
  • RTI Connext DDS version and installation type
    • Newest apt packages Foxy as of today

Bug Description

When publishing sensor_msgs::msg::Image with images larger than h*w (tested with height 1944 width 2592), and using the standard QoS for sensors, messages cannot be read. Messages are published (checked with wireshark).

Expected Behavior

Messages should be readable.

How to Reproduce

Publish an image of a similar size I described (with sensor_msgs::msg::Image and rclcpp::SensorDataQoS), and read on that topic (ros2 topic echo /<image_topic>. Cannot share code, working on code under NDA, I'm sorry.


Workarounds

Just used the standard '10' as QoS with the create_publisher() function in rclcpp

@asorbini
Copy link
Collaborator

asorbini commented Feb 1, 2022

Hi @xander-m2k,

thank you for reporting this issue. I will try to reproduce it soon, but on the top of my head, I suspect the issue might lie in the use of "best effort" Reliability QoS (used by the "sensor data" profile) when trying to send "large data" (i.e. messages which need DDS-level fragmentation like the image you are trying to publish).

I'll quote from this online documentation page:

If you use Best Effort, the application is not going to try to recover any lost fragments. Since in Best Effort communication the lost fragment isn’t resent, the DataReader will discard the entire sample. Depending on its size, the sample could have a lot of fragments, meaning it is more likely to lose a fragment (and therefore, the entire sample). By using Reliable Reliability, if a fragment is lost Connext DDS will try to recover it.

I would suggest switching the publisher to be "reliable" and see if that improves things.

Workarounds

Just used the standard '10' as QoS with the create_publisher() function in rclcpp

I'm not quite sure how modifying the history depth would affect this issue. I suspect that by "standard '10'" you mean you are using the alternative signature of create_publisher() which only takes the history depth value and applies it on top of the standard QoS profile. It would make sense that you see communication happen in this case, because the default QoS is reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants