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

[Bug] remap node ID with namespace causes introspection issues #149

Open
TomGrimwood opened this issue May 17, 2024 · 0 comments
Open

[Bug] remap node ID with namespace causes introspection issues #149

TomGrimwood opened this issue May 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@TomGrimwood
Copy link

Describe the bug

I am interested in running the zenoh-bridge-ros2dds docker image with the nodeID to be /robot3/cc_router, but without zenoh changing the namespace prefix of actions/services/topics that are sent through the zenoh-bridge, as the namespacing is already preconfigured internally.
e.g.

--ros-args -r __node:=cc_router -r __ns:=/robot3
ROS:/robot3/SearchArea <-> Zenoh:robot3/robot3/SearchArea/*

is undesirable.

I tried changing using the ros2 __node remap, e.g. --ros-args -r __node:=robot3/cc_router , which shows the desired node name when calling ros2 node list, and the zenoh behaviour works without changing the prefixes as desired.
However, issuing ros2 node info /robot3/cc_router no longer works:

root@tom:~# ros2 node list
/foxglove_bridge
/foxglove_bridge_component_manager
/robot3/cc_router

root@tom:~# ros2 node info /robot3/cc_router 
/robot3/cc_router
Traceback (most recent call last):
  File "/opt/ros/humble/bin/ros2", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.18.9', 'console_scripts', 'ros2')())
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py", line 91, in main
    rc = extension.main(parser=parser, args=args)
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2node/command/node.py", line 37, in main
    return extension.main(args=args)
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2node/verb/info.py", line 59, in main
    subscribers = get_subscriber_info(
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2node/api/__init__.py", line 85, in get_subscriber_info
    return get_topics(
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2node/api/__init__.py", line 76, in get_topics
    names_and_types = func(node.name, node.namespace)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1122, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1464, in __request
    response = self.__transport.request(
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1166, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1182, in single_request
    return self.parse_response(resp)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1354, in parse_response
    return u.close()
  File "/usr/lib/python3.10/xmlrpc/client.py", line 668, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'rclpy._rclpy_pybind11.NodeNameNonExistentError'>:cannot get subscriber names and types for nonexistent node: error not set">

To reproduce

services:
  zenoh_namespace:
    image: eclipse/zenoh-bridge-ros2dds:latest
    init: true
    networks:
      - rosnet-1
    environment:
      - ROS_DISTRO=humble
      - ROS_DOMAIN_ID=0
      - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
    command: >
      --mode router
      --id cc_router
      --ros-args -r __node:=robot3/cc_router

  zenoh:
    image: eclipse/zenoh-bridge-ros2dds:latest
    init: true
    networks:
      - rosnet-1
    environment:
      - ROS_DISTRO=humble
      - ROS_DOMAIN_ID=0
      - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
    command: >
      --mode router
      --id cc_router_no_namespace
      --ros-args -r __node:=cc_router_no_namespace

  introspector:
    image: osrf/ros:humble-desktop
    networks:
      - rosnet-1
    restart: always
    tty: true
    command: 
      - bash
      - -c
      - |
        source /opt/ros/humble/setup.bash
        ros2 node list
        sleep 2
        ros2 node info /robot3/cc_router
        ros2 node info /cc_router_no_namespace


networks:
  rosnet-1:

System info

  • Platform: Ubuntu 22.04 AMD64 & Raspberry Pi 5]
  • CPU: AMD Ryzen 5 5600
  • Zenoh Image eclipse/zenoh-bridge-ros2dds:0.11.0-rc.3
@TomGrimwood TomGrimwood added the bug Something isn't working label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant