Ask Your Question

Indexing ROS2 topics/nodes based on host?

asked 2019-10-08 01:09:36 -0600

PG_GrantDare gravatar image

Hi Everyone,

I am wondering if I am able to index a topic based on the host IP? If I have 3 robots on one network and they all look for a cmd_vel how can I index what topic to publish to? Do I have to prefix them all with /robot(n)_cmd_vel? This is what ROS1 had to do, I thought ROS2 was better at this functionality.

edit retag flag offensive close merge delete


"based on host" or 'robot'? host != robot in the general case I would say.

gvdhoorn gravatar image gvdhoorn  ( 2019-10-08 03:54:29 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-10-08 04:25:31 -0600

tfoote gravatar image

We have not changed the basic communication model of anonymous publish subscribe between ROS 1 and ROS 2. To that end in general if you're on the same topic you're expected to want the same data.

You don't have to specifically modify each topic. There are tools you can leverage such as namespaces to push all the content into a lower namespace so as not to interfere with similarly structured robots in another namespace.

edit flag offensive delete link more


Thank you. Are there plans to have robots indexable by their hosts?

PG_GrantDare gravatar image PG_GrantDare  ( 2019-10-08 17:00:08 -0600 )edit

In general no, that's not a pattern that we're designing for. The computational graph should be generally independent of what host it's running on. Many robots have one or more hosts and you might want to migrate processing to different hosts (maybe onboard, maybe offboard) transparently depending on your deployment and equipment capability. The assumption of a one to one association of host and robot does not hold for many use cases.

tfoote gravatar image tfoote  ( 2019-10-08 17:35:36 -0600 )edit

Ok, I understand that. What would be the standard to have a robot identifier given that it does have a one-to-one host relationship? Would it be using namespaces/ a prefix?

PG_GrantDare gravatar image PG_GrantDare  ( 2019-10-10 20:44:38 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-10-08 01:09:36 -0600

Seen: 29 times

Last updated: Oct 08 '19