Can't remap topic name and set hint at the same time;
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the reported command-line case with image_transport and compare it with image_saver and the TransportHints approach. Start by tracing how the remapped image name and transport parameter are resolved, then verify that both the requested topic and transport hint are applied together. Done means a node can use -r image:=/my_image_topic/image_raw and -p transport:=compressed in the same invocation.
Written by the indexing model from the issue text.
Description
OS: Ubuntu 20.04
ROS: Galactic
Verions: 2.3.0-3 installed from Debian
I am trying to create a generic ROS2 node that subscribes to an image topic of a user's choice (through remapping of a topic name) and a user can in addition set the transport hint. Pretty straight forward, this is how image_saver from the image_view package used to work on ROS1
node->declare_parameter("transport", "raw");
std::string transport = node->get_parameter("transport").get_value<std::string>();
image_sub_ = image_transport::create_subscription(
&(*node), "image", std::bind(&MyClass::imageCallback, this, std::placeholders::_1), transport);
I run my node with ros2 run my_package my_node --ros-args -r image:=/my_image_topic/image_raw -p transport:=compressed but the output of ros2 node info my_node shows:
/my_node
Subscribers:
/image/compressed: sensor_msgs/msg/CompressedImage
If I don't set the parameter from the command line the remapping of the topic name works and I get:
/my_node
Subscribers:
/my_image_topic/image_raw: sensor_msgs/msg/Image
I have also tried doing this using TransportHints and creating the subscriber with it_.subscribe("image", 10, &MyClass::imageCallback, this, &hints); , and the overwriting the image_transport parameter; The first problem here is that this parameter from TransportHints is never declared, so I had to declare it from my node in order to overwrite it; But then the behavior is still the same; We can either remap the topic name or change the hint but not both at the same time;
I also tried this out with the image_saver node from image_view package on ROS2 and could not get that one to run either;
I suspect that this might be a bug somewhere in the code when resolving names of topics and parameters; My current workaround is to set both the topic name and the hint from parameters;
- Dominant language
- C++
- Stars
- 153
- Forks
- 256
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ros-perception/image_common
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ros-perception/image_common#346 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
ros-perception/image_common#286 · 1 comment ·
-
[ROS2] CameraInfoManager set_camera_info service callback returns without updating saved cal dataOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ros-perception/image_common#131 ·
-
Topic remaps are recursed multiple times in image_transportPossibly taken @paneendrakumar0 claimed this 4 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ros-perception/image_common#435 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ros-perception/image_common#434 · 3 comments · 3 reactions ·
All issues in ros-perception/image_common
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
NVIDIA-RTX/NRI#307 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100