FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add namespace override by pablogs9 · Pull Request #145 · micro-ROS/micro-ROS-Agent · GitHub

Add namespace override - #145

Draft
pablogs9 wants to merge 1 commit into
humblefrom
feature/namespace_override
Draft

pablogs9 wants to merge 1 commit into
humblefrom
feature/namespace_override

Conversation

Copy link
Copy Markdown
Member

Signed-off-by: Pablo Garrido pablogs9@gmail.com

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

cmraaron commented Jul 6, 2022

Copy link
Copy Markdown
Contributor

Hey, I have this a go. Looks like it prefixes the dds topic, eg rt/imu_data and becomes remapped_ns/rt/imu_data, but should be rt/remapped_ns/imu_data.
Also add_datareader needs to be remapped for Subscriber support I believe

pablogs9 commented Jul 6, 2022 •
edited
Loading

Copy link
Copy Markdown
Member Author

In which version of ROS 2 did you test?

cmraaron commented Jul 6, 2022

Copy link
Copy Markdown
Contributor

ah, yes, I should have said, sorry. I applied your commit to galactic branch

pablogs9 commented Jul 6, 2022

Copy link
Copy Markdown
Member Author

Can you test it on humble? I remember that when I tested it it was working properly... But probably it needs a rework.

cmraaron commented Jul 6, 2022 •
edited
Loading

Copy link
Copy Markdown
Contributor

Can you test it on humble? I remember that when I tested it it was working properly... But probably it needs a rework.

ok, I just built on humble. same behaviour. It places nodes nicely in namespaces, but not the topics. Publishers, seemingly because of the rt/ prefix, and Subscribers remain un-namespaced

bjsowa commented Jul 25, 2022 •
edited
Loading

Copy link
Copy Markdown

I just tested it on humble. The node name is properly prefixed, but all the topics and services remain without a namespace.
When I try to do ros2 node info /ns/firmware, it crashes:

Traceback (most recent call last):
  File "/opt/ros/humble/bin/ros2", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.18.3', 'console_scripts', 'ros2')())
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py", line 89, 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">

Copy link
Copy Markdown
Contributor

hmm, even with the /rt/ prefix the topic still appears as original. Looks like this is coming from the running xrce_dds_agent_instance_ as even with all callbacks turned off ros2 topic list still shows this topic.
Probably I dont understand enough about the the dds to ros mapping and the roles of each component in the agent.

I'm happy to look further into it if someone wants to point me in the right direction.
The code I was using is here https://github.com/cmraaron/micro-ROS-Agent/tree/namespaces


auto remapped_topic_name = namespace_remapping_ + "/" + topic_name;

this->add_datawriter(datawriter_guid, remapped_topic_name, type_name,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this is a mistake here? the remapping should only be in the overload of add_datawriter below? This will double namespace it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

probably it was intended for add_datareader? Which neither overload has a remapping

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL