-
Notifications
You must be signed in to change notification settings - Fork 226
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
Unable to leverage compressed image topics as expected, ROS2 Humble #270
Comments
Hi @BradySheehan , I'm facing the exact same issue with the examples provided by |
I think I found the issue. --ros-args -p image_transport:=compressed correctly changed the transport protocol. Note that Before opening a PR to fix this, it this the correct way? Or should the |
Hi, I wrote in the description that I did this but did not see the messages get compressed. |
I don't see in the description any mention to manually defining the parameter. For example, this is the modified and working main of https://github.com/ros-perception/image_transport_tutorials/blob/main/src/my_subscriber.cpp int main(int argc, char ** argv)
{
rclcpp::init(argc, argv);
rclcpp::NodeOptions options;
rclcpp::Node::SharedPtr node = rclcpp::Node::make_shared("image_listener", options);
node->declare_parameter("image_transport","raw");
cv::namedWindow("view");
cv::startWindowThread();
image_transport::ImageTransport it(node);
image_transport::Subscriber sub = it.subscribe("camera/image", 1, imageCallback);
rclcpp::spin(node);
cv::destroyWindow("view");
return 0;
} the diff is diff --git a/src/my_subscriber.cpp b/src/my_subscriber.cpp
index fc5fccd..c32cbc5 100644
--- a/src/my_subscriber.cpp
+++ b/src/my_subscriber.cpp
@@ -35,6 +35,7 @@ int main(int argc, char ** argv)
rclcpp::init(argc, argv);
rclcpp::NodeOptions options;
rclcpp::Node::SharedPtr node = rclcpp::Node::make_shared("image_listener", options);
+ node->declare_parameter("image_transport","raw");
cv::namedWindow("view");
cv::startWindowThread();
image_transport::ImageTransport it(node); |
I was having the same issue and this solved it for me, thanks! |
Compressed image topics do not appear to be working in ROS2 Humble. I have a node
panel_detector
and a Sterelabs Zed 2i sensor. I am trying to get that node to subscribe to compressed image topics from the Zed 2i.Setup:
Stereolabs Zed2i Camera
ROS2 Humble
Installed compressed image transport plugin dependencies - https://github.com/ros-perception/image_transport_plugins/blob/rolling/image_transport_plugins/package.xml
Verified that compressed topics are viewable on the system with
ros2 topic list
.Steps to Reproduce:
_image_transport:=compressed
as seen in this document https://github.com/ros-perception/image_transport_tutorials#changing-the-transport-used.Result:
The node is not subscribing to the compressed topics, e.g.,
It is only subscribing to the uncompressed topics.
Expected Result:
I expected
ros2 node info panel_detector
to list that it was subscribed to the compressed image topics.Debugging
I confirmed that the
image_transport/compressed
is an available transport.I also tried explicitly changing the topics which were subscribed to be the actual compressed topics, but the camera image callback was never fired.
The text was updated successfully, but these errors were encountered: