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

[ros2] image_view only subscribe to raw #824

Closed
ahcorde opened this issue Jun 29, 2023 · 11 comments
Closed

[ros2] image_view only subscribe to raw #824

ahcorde opened this issue Jun 29, 2023 · 11 comments

Comments

@ahcorde
Copy link
Contributor

ahcorde commented Jun 29, 2023

I'm testing this repository in particular image_view and I found several issues:

I'm publishing images using this command

ros2 run image_transport_tutorials my_publisher img.jpeg

then I try to subscribe to "raw" image using:

ros2 run image_view image_view image:=/camera/image

Up to this point all work fine, but the issues start when I try to use a different image transport plugin

ros2 run image_view image_view compressed image:=/camera/image compressed
[INFO] [1688051408.660552694] [image_view_node]: Using transport "raw"

But I always see this trace : Using transport "raw". This is happening because the NodeOptions is resetting the parameters no matter what you define in the cmd.

I tried

ros2 run image_view image_view image:=/camera/image image_transport:=compresse
ros2 run image_view image_view image:=/camera/image _image_transport:=compresse

But I'm getting the same result, the solution should be something like this. Parse the arguments.

Remapping

Then the second problem that I'm facing is the remapping, when I use the "raw" plugin I'm able to remap the topic from "image" to the one that I want, But If I hardcoded the code to use "compressed" images, the topic is not remapped. I checked this addiing some traces.

are these know issues? or am I doing something wrong ?

Happy to open PRs and find a solution.

@ahcorde
Copy link
Contributor Author

ahcorde commented Jun 29, 2023

FYI @JWhitleyWork

@ahcorde
Copy link
Contributor Author

ahcorde commented Jun 29, 2023

Probably I know why the second remapping is not happening, when the code susbcribes to the topic it uses getTopicToSubscribe(base_topic), which in this case should be image/compressed and the cmd uses image:= the topics are different. should we use a parameter to define the topic name ? but for this we should fix the first issue.

@ahcorde
Copy link
Contributor Author

ahcorde commented Jun 29, 2023

Thinking a little bit more about the second issue, using this remapping is fixed, maybe we should document this better:

ros2 run image_view image_view compressed "/image/compressed:=/camera/image/compressed"

@ahcorde
Copy link
Contributor Author

ahcorde commented Jun 30, 2023

I created this PR #825

@vidalperezbohoyo
Copy link

I have the same problem:
ros2 run image_view image_view compressed --ros-args --remap image:=/image_compressed

Only using transport raw...

In Ros2 Humble.

@mikeferguson
Copy link
Member

So is it possible you're just using the wrong command line? If I do the following:

ros2 run image_view image_view --ros-args --remap image:=/camera/image -p image_transport:=compressed

Which is what is shown in the image_transport_tutorials README, then things work (even using what is in rolling debs right now):

ros2 run image_view image_view --ros-args --remap image:=/camera/image -p image_transport:=compressed
[INFO] [1705521253.837407238] [image_view_node]: Using transport "compressed"

I think this is because without the "-p" newer ROS 2 versions are interpreting this as a remap rather than a parameter

@mikeferguson
Copy link
Member

mikeferguson commented Jan 17, 2024

Ok - I might have spoken too soon - I get the "compressed" message (so parameter is going through) but the remap doesn't actually work.. so then:

  • "only subscribes to raw" is not actually bug - it works if you use the -p in --ros-args
  • "subscribes to the wrong topic" is still an issue - but appears to be an issue with image_transport - there's nothing we can do here from what i see - the workaround is to fully specify the remapped topics (see my next post)

Also, if I update the image_transport_tutorials my_subscriber to use transport hints and switch to compressed, it also does the remappings incorrectly - further confirming the bug is in image_transport

@mikeferguson
Copy link
Member

There is definitely something funky going on with the remapping - this fully works against current rolling debs:

ros2 run image_view image_view --ros-args --remap image/compressed:=/camera/image/compressed -p image_transport:=compressed

@mikeferguson
Copy link
Member

Based on these comments - I opened #850 to at least correct the help string for image_view to the proper format

@mikeferguson
Copy link
Member

I believe that #851 is the correct approach to fix the remap issues - still need to apply that to this particular node

@mikeferguson mikeferguson mentioned this issue Jan 18, 2024
23 tasks
@mikeferguson
Copy link
Member

#851 fixes the remapping (in rolling, which means jazzy and beyond - as noted in the PR, this would break anyone who has been manually fixing the remapping issue, so I don't think we should release it into Iron or earlier)

For the image_transport selection - it appears our real issue is lack of documentation - I've specifically called out this image_transport part in my documentation ticket: #848

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants