Sub-node name is ignored in service name resolving

Open
#2,734 6 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
api

Research direction

Start by reproducing the Jazzy behavior through Node::create_sub_node() and resolve_topic_or_service_name() with the provided private name. Trace how the sub-node namespace is handled, then verify that the resolved name includes /left/ as expected and that the original resolution behavior remains correct.

Written by the indexing model from the issue text.

Description

bug help wanted

When I create sub-nodes using Node::create_sub_node() and then resolve a private name on this sub-node, the sub-namespace is ignored.

    auto nh_left = this->create_sub_node( "left" );
    std::string resolved_service_name = nh_left->get_node_base_interface()->resolve_topic_or_service_name( 
                                                                                                                                                   "~/set_camera_info", true, false );

Resolves to: /test_cam_info_manager/set_camera_info
But I would expect it to resolve to: /test_cam_info_manager/**left**/set_camera_info

Background:
In order to create two CameraInfoManager's for a stereo setup, I need some way to push the CameraInfoManagers into a sub-namespace. I thought this is exactly what sub-nodes are for, but it's not working. Original issue: https://github.com/ros-perception/image_common/issues/341

Note: In rolling release, I believe this can be circumvented because CameraInfoManager has a new namespace parameter, but this is not the case in jazzy.

Required Info:

  • Operating System:
    • Ubuntu 24.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • jazzy
  • Client library (if applicable):
    • rclcpp
Dominant language
C++
Stars
829
Forks
587
Avg merge
4d 6h
Merged PRs (30d)
30

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros2/rclcpp

All issues in ros2/rclcpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.