image_common icon indicating copy to clipboard operation
image_common copied to clipboard

ROS2 ImageTransport subscribes with default QOS settings

Open mkhansenbot opened this issue 4 years ago • 12 comments

https://github.com/ros-perception/image_common/blob/e3f482846435eb65e299e9e5955788dc5bcf73c6/image_transport/src/image_transport.cpp#L159

It's fine this is the default but there should be an optional parameter to override it to something else, specifically the Sensor Default QOS (best effort, etc). Sensor Default is typically used with camera image data.

mkhansenbot avatar Mar 31 '20 18:03 mkhansenbot

I can submit a small PR to add the ability to override this default if needed, please reply either way.

(cc:@emersonknapp was the one who first found this issue)

mkhansenbot avatar Mar 31 '20 20:03 mkhansenbot

My 2c - the internal default should be sensordata as a start. Then optional override is also useful

emersonknapp avatar Mar 31 '20 20:03 emersonknapp

Hoping to get a reply on this before Foxy release

mkhansenbot avatar Apr 06 '20 23:04 mkhansenbot

I think this could be solved by updating the underlying message_filters package to leverage the newer options API pattern directly: https://github.com/ros2/message_filters/issues/45

I didn't have the the chance to to try this, but you may want to take a look, @mkhansenbot .

ruffsl avatar Apr 17 '20 00:04 ruffsl

@mjcarroll @wjwwood - can either of you comment on this? I realize it's probably too late to fix for Foxy, but this seems like an important issue to fix

mkhansenbot avatar May 14 '20 22:05 mkhansenbot

@ruffsl - sorry I didn't reply earlier, but I don't quite understand how message_filters helps here

mkhansenbot avatar May 14 '20 22:05 mkhansenbot

It's used in the image_transport package, and would need to be updated so that a filter's subscribers also use the user selected QoS and message memory strategy when creating the image_transport:

https://github.com/ros-perception/image_common/blob/bd2a7f9c570f7ac7f24f1c284e53e87338482c58/image_transport/src/camera_subscriber.cpp#L51-L53

https://github.com/ros-perception/image_common/blob/bd2a7f9c570f7ac7f24f1c284e53e87338482c58/image_transport/src/camera_subscriber.cpp#L125-L128

ruffsl avatar May 14 '20 22:05 ruffsl

If it can be added in a non-API breaking way then it could still be put in foxy. If it can be done in a non-ABI breaking way it could be added to foxy after the release too.

I don't have time to pick it up, but if someone makes pull requests we'll try to get to them. @ me or @mjcarroll and we'll try to prioritize them if a non-API breaking, but ABI breaking change is required, as that's the most time sensitive version.

wjwwood avatar May 14 '20 23:05 wjwwood

Is there any plan to resolve this?

mkhansenbot avatar Jul 14 '20 15:07 mkhansenbot

This issue caused me some pain and time until I figured out why no images are received. Would love to see a fix in foxy!

agutenkunst avatar Feb 07 '21 19:02 agutenkunst

@agutenkunst @tnajjar @jehontan

I worked around this by doing similar to the following:

using std::placeholders::_1; rmw_qos_profile_t image_qos = rmw_qos_profile_sensor_data; auto sub_ = image_transport::create_subscription(this, "/camera/image_raw", std::bind(&MySuperCoolImageNode::imageCallback, this, _1), "raw", image_qos);

The create_subscription method exposes the image QoS profile and you can manually change individual constituents of that profile if needed.

uxsapien avatar Jan 15 '22 03:01 uxsapien

This should be resolved as of https://github.com/ros-perception/image_common/pull/246 for rolling. @mkhansenbot if this addresses the problem feel free to close this issue.

ihasdapie avatar Jun 15 '22 06:06 ihasdapie