Ask Your Question

Does ROS2 support keyed topic?

asked 2020-03-02 02:38:14 -0500

Sapodilla gravatar image

Hi everyone,

As stated in the title, does ROS2 have topic with keys? I have been studying ROS2 for few weeks and I have looked around but cannot find anywhere stating about keyed topic in ROS2.

Maybe I have missed something or ROS2 uses this properties in a different way. Thanks in advance for any answer!


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-03-02 11:22:55 -0500

Short answer: No.

Long answer: You can make them keyed by placing the topics in the keyed namespaces so that you get just the instance required. For instance if you have the poses of robots on the pose topic, it may look like /robot1/pose /robot2/pose.

edit flag offensive delete link more


This isn't a complete substitution since you can't subscribe to allpose topics in every namespace with a single subscriber.

Dirk Thomas gravatar image Dirk Thomas  ( 2020-03-02 11:25:27 -0500 )edit

True, but its a reasonable work around (unless you have in mind a better way?), and you can programmatically have a vector of subscribers checking for a /some/namespace/ending/with/pose.

stevemacenski gravatar image stevemacenski  ( 2020-03-02 11:28:02 -0500 )edit

Thanks Steven! Since your answer is sufficient for me, I mark it as correct one.

Sapodilla gravatar image Sapodilla  ( 2020-03-03 02:22:27 -0500 )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: 2020-03-02 02:38:14 -0500

Seen: 85 times

Last updated: Mar 02 '20