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

Discrepancy between sensor_msgs/CompressedImage docs and format field values published by compressed_image_transport #56

Open
5tan opened this issue Apr 20, 2020 · 6 comments · May be fixed by ros/common_msgs#184

Comments

@5tan
Copy link

5tan commented Apr 20, 2020

sensor_msgs/CompressedImage docs says that acceptable format field values are: jpeg and png.

compressed_publisher.cpp produces more verbose format field. E.g.:

$ rostopic echo -n 1 /image_publisher_1587388842212983963/image_raw/compressed | grep format:
format: "bgr8; jpeg compressed bgr8"

Is this a bug in code, or bug in docs?

@bmegli
Copy link
Contributor

bmegli commented Jul 19, 2022

Determined in code by those lines (for jpeg):

@bmegli
Copy link
Contributor

bmegli commented Jul 19, 2022

And those are the commits where format field changed:

First added new form (original color format + ";jpeg compressed").
Second added also internal (intermediate) color format (original color format + ";jpeg compressed " + intermediate color format

@bmegli
Copy link
Contributor

bmegli commented Jul 19, 2022

The changes date back to 2012 so it is probably documentation that is not up to date.

@bmegli
Copy link
Contributor

bmegli commented Jul 19, 2022

The documentation should probably say something like:

ORIGINAL_FORMAT + "; " + CODEC + " compressed " + COMPRESSED_FORMAT
Valid codecs are: jpeg, png
example:
"bgr8; jpeg compressed bgr8"

But it gets more complex due to depth encoding...

@bmegli
Copy link
Contributor

bmegli commented Jul 19, 2022

.. depth encoding reuses the same message

compressed->format += "; compressedDepth " + compression_format;

and here compression_format is like png, rvl

So for depth it is like:

ORIGINAL_FORMAT + "; compressedDepth " + CODEC
Valid codecs are: png, rvl
example:
"16UC1; compressedDepth png"

Looking into the code empty CODEC is interpreted as png for backwards compatibility

@peci1
Copy link

peci1 commented Jan 3, 2023

Fix provided in ros/common_msgs#184 . Feel free to leave some comments there. And thanks for the research you did!

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

Successfully merging a pull request may close this issue.

3 participants