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

Regression in compressed_depth_image_transport with old bagfiles (Unsupported image format: 16UC1; compressedDepth) #63

Closed
tlind opened this issue Aug 5, 2020 · 3 comments

Comments

@tlind
Copy link

tlind commented Aug 5, 2020

I'm experiencing problems with existing rosbags, when trying to republish compressed depth image messages. The regression is caused by commit a710d4a in 1.14.0 (ROS Noetic) which introduced the new RVL depth compression.

The error message is:

Unsupported image format: "16UC1; compressedDepth"

and occurs in:

compressed_depth_image_transport::decodeCompressedDepthImage()

The check for the old format introduced in that commit is not able to match the above format string:

// Assign image encoding
const size_t split_pos = message.format.find(';');
const std::string image_encoding = message.format.substr(0, split_pos);
std::string compression_format;
// Older version of compressed_depth_image_transport supports only png.
if (split_pos == std::string::npos) {
compression_format = "png";
} else {
std::string format = message.format.substr(split_pos);
if (format.find("compressedDepth png") != std::string::npos) {
compression_format = "png";
} else if (format.find("compressedDepth rvl") != std::string::npos) {
compression_format = "rvl";
} else {
ROS_ERROR("Unsupported image format: %s", message.format.c_str());
return sensor_msgs::Image::Ptr();
}
}

This bug might have been introduced due to the badly maintained documentation of the format field (#56).

tlind added a commit to tlind/image_transport_plugins that referenced this issue Aug 22, 2020
… with old bagfiles

Fixes error "Unsupported image format: 16UC1; compressedDepth" when playing old bagfiles. Regression had been introduced in commit a710d4a by not correctly checking for old format strings.
tlind added a commit to tlind/image_transport_plugins that referenced this issue Aug 22, 2020
… with old bags

Fixes error "Unsupported image format: 16UC1; compressedDepth" when playing old bagfiles. Regression had been introduced in commit a710d4a by not correctly checking for old format strings.
tlind added a commit to tlind/image_transport_plugins that referenced this issue Aug 22, 2020
@tlind
Copy link
Author

tlind commented Aug 24, 2020

I have added a tiny pull request (#64) that should address this issue.

@matemat13
Copy link

Just hit this bug today when replaying some old rosbag. Can we pls merge the related PR? In any case - thanks a lot for the fix :)

@Sanic
Copy link

Sanic commented Jan 10, 2022

Thanks for the fix @tlind ! We also had the same problem.

@mjcarroll I was just wondering if there is already a deb package build scheduled for a new version (v1.x) which contains this fix?

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

3 participants