Do unsubscribed topics cause network traffic?

asked 2021-04-12 09:18:44 -0500

fnax8902 gravatar image

updated 2021-04-12 11:59:00 -0500

Hello, I'm trying to restrict some nodes to only publish their topics on localhost to minimize network traffic. Is this maybe possible using https://github.com/ros2/launch ? Thank you.

edit retag flag offensive close merge delete

Comments

Just to clarify: as in ROS 1, if there are no subscribers, no data is sent across the network.

Are you worried about unsubscribed topics using bandwidth?

gvdhoorn gravatar image gvdhoorn  ( 2021-04-12 11:16:00 -0500 )edit

I do have multiple vehicles in one network. But to minimize network traffic I want to publish topics which are only relevant for the inner-vehicle communcation on localhost.

fnax8902 gravatar image fnax8902  ( 2021-04-12 11:27:42 -0500 )edit

I'm not sure I've made myself clear: if there are no subscribers off-vehicle, no traffic will be generated.

ROS 2 / DDS publishing is not broadcast, pub-sub connections must be explicitly created (unless otherwise configured).

Or are you actually asking how to prevent off-vehicle subscribers from subscribing to certain topics?

gvdhoorn gravatar image gvdhoorn  ( 2021-04-12 11:30:35 -0500 )edit

Okay, that sounds good I wasn't aware of that. My approach to prevent off-vehicle subscribers consists of adding a uniqe namespace to the inner-vehicle topics. Is there another way?

fnax8902 gravatar image fnax8902  ( 2021-04-12 11:51:35 -0500 )edit

Okay, that sounds good I wasn't aware of that.

so was "do unsubscribed topics cause network traffic?" your actual question?

If so: please update the title of your post here so we avoid the xy-problem.

gvdhoorn gravatar image gvdhoorn  ( 2021-04-12 11:54:00 -0500 )edit