luxonis / depthai-ros

Official ROS Driver for DepthAI Sensors.
MIT License
239 stars 173 forks source link

[Question] Is there a way to stop publishing the compressed image topics? #476

Closed vladmosoiu98 closed 5 months ago

vladmosoiu98 commented 5 months ago

Hello,

I would like to know if there is a way (ideally through the parameter configuration file) to stop publishing the compressed topics for each component. I know that depthai is using the image_transport package for the publishing of the imaging, but I could not figure out how to disable the compression.

/oak/nn/passthrough/image_raw/compressed
/oak/nn/passthrough/image_raw/compressedDepth
/oak/nn/passthrough/image_raw/theora
/oak/rgb/image_raw/compressed
/oak/rgb/image_raw/compressedDepth
/oak/rgb/image_raw/theora

I need this information because every time I subscribe to one of those topics (for example when opening Foxglove where I can not bypass some of the topics), my terminal is flooded with errors, such as:

[ERROR] [1704743237.583933472] [compressed_depth_image_transport]: Compressed Depth Image Transport - Compression requires single-channel 32bit-floating point or 16bit raw depth images (input format is: bgr8).
[ERROR] [1704743343.808687872] [CompressedPublisher]: [16UC1] is not a color format. but [mono8] is. The conversion does not make sense
[ERROR] [1704743421.184808416] [TheoraPublisher]: cv_bridge exception: '[16UC1] is not a color format. but [bgr8] is. The conversion does not make sense'

My initial approach was like this:

/oak:
  ros__parameters:
    rgb:
      image_raw:
        disable_pub_plugins: 'image_transport/compressed'

but from what I understand the "disable_pub_plugins" is not yet available in ROS2 Humble.

If you have any suggestions or approaches for such a problem, please let me know! Thank you!

Serafadam commented 5 months ago

Hi, AFAIK this functionality is not yet available in Humble (see link ), one way to mitigate this would be to run the node in intra-process mode as in that case "bare" publishers are initialized in place of image_transport ones.

vladmosoiu98 commented 5 months ago

Hi Adam, Thanks for the answer, I will try the intra-process mode for now.