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

image_transport republish broken on Foxy? #171

Open
KenYN opened this issue Sep 24, 2020 · 5 comments
Open

image_transport republish broken on Foxy? #171

KenYN opened this issue Sep 24, 2020 · 5 comments

Comments

@KenYN
Copy link

KenYN commented Sep 24, 2020

I have the latest version installed, and I do the following:

$ ros2 topic list
/bar
/foo
/parameter_events
/rosout

OK, a couple of left-over topics (how do I flush everything out?) but otherwise OK

$ ros2 run image_transport republish compressed --ros-args --remap in:=/woo -- --ros-args --remap out:=/bazzle -- &
[1] 1661358
$ ros2 topic list
/bar
/bazzle
/foo
/in/compressed
/out/compressed
/parameter_events
/rosout

Oops, I expect to see:

$ ros2 run image_transport republish compressed --ros-args --remap in:=/woo -- --ros-args --remap out:=/bazzle -- &
[1] 1661358
$ ros2 topic list
/bar
/bazzle
/bazzle/compressed
/foo
/woo
/woo/compressed
/parameter_events
/rosout

It looks to me like the remapping has not been applied. I see the same problem with image_transport::create_subscription() and using ComposableNode(..., remappings=[]). remappings works fine, however, when using rclcpp::Node::create_subscription().

@KenYN
Copy link
Author

KenYN commented Sep 24, 2020

It would seem to be related to this issue:

ros2/rclcpp#985

@GertVen
Copy link

GertVen commented Jan 11, 2022

Sorry to bring up an old question, but does anybody have a solution for the remapping, or is the "out/" the correct way ? When creating an image transport I also get a bunch of "out/*" topics, for example:

ros2 run image_transport republish raw --ros-args --remap in:=/a/image_raw --remap out:=/a/image_comp
ros2 run image_transport republish raw --ros-args --remap in:=/b/image_raw --remap out:=/b/image_comp

Passes out:
/a/image_raw /a/image_comp /b/image_raw /b/image_comp /out/compressed /out/compressed_depth /out/theora

I am using ROS2 Galactic

If the data above is correct, what would be the best way to differentiate between two different input streams, for example a front and a rear camera.

Thanks!

@Purg
Copy link

Purg commented Mar 2, 2022

I think I have an "answer", or at least some sort of working usage. When you only pass the ros2 run image_transport republish raw, you are saying to "read in raw, republish all plugins" (thus all of compressed/depth/theora). It seems like the republish tool wants a --remap for every applicable out, e.g. --remap out/compressed:=target/compressed --remap out/compressedDepth:=target/compressedDepth [etc.]. If the original intention is to not have to be this verbose, it doesn't seem to work that way anymore.

In my particular use-case, I just want the compressed republish, so I've landed on:

ros2 run image_transport republish raw compressed --ros-args --remap in:=/target --remap out/compressed:=/target/compressed`

And wind up with the topics:

/target
/target/compressed

@dcconner
Copy link

dcconner commented Apr 4, 2022

This issue also breaks image_transport camera_pub/sub with std::string info_topic = getCameraInfoTopic(image_topic);

I was hoping that #188 would fix, but testing with that change does not address the issue

@abourbou
Copy link

abourbou commented May 17, 2023

I think I have an "answer", or at least some sort of working usage. When you only pass the ros2 run image_transport republish raw, you are saying to "read in raw, republish all plugins" (thus all of compressed/depth/theora). It seems like the republish tool wants a --remap for every applicable out, e.g. --remap out/compressed:=target/compressed --remap out/compressedDepth:=target/compressedDepth [etc.]. If the original intention is to not have to be this verbose, it doesn't seem to work that way anymore.

In my particular use-case, I just want the compressed republish, so I've landed on:

ros2 run image_transport republish raw compressed --ros-args --remap in:=/target --remap out/compressed:=/target/compressed`

And wind up with the topics:

/target
/target/compressed

Thank you the problem of topic is indeed resolved if you put the exact name_space you want to change depending on compression. If using raw input in:=target and if you are using compressed input : in/compressed:=target/compressed.
This is also true for out.

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

5 participants