disable ros topics
I am running some ros nodes like camera, audio and joy publisher in one ros network. And it is creating lots of lag and latency because it looks like since all other unneccessary topics are also passed from same network it is eating the bandwidth.
So how can i make only certial ros topics to be passed from the network so that the passed topics will have more real time feature?
Asked by dinesh on 2020-05-31 05:12:02 UTC
Answers
Unless you're forcing these topics to be "passed" (are you using a multimaster setup?) no traffic should be generated unless there are actual subscribers. No subscribers -> no data transfer.
You'll have to provide more information about what it is exactly you are doing, as right now, this is unanswerable (and should actually not even be a problem).
As to your screenshot: the Topic Monitor actually subscribes to topics to calculate bandwidth and rate. So that would immediately mean you create a subscriber. Same as rostopic hz
and rostopic bw
.
Edit: this topic comes up every now and then. For (future) readers: if there are no subscribers to a topic, no data is being transferred. It doesn't matter whether that is on the same machine, on the same network, on another network or to the other side of the world.
Asked by gvdhoorn on 2020-06-01 05:04:52 UTC
Comments
I'm not using multimaster setup. i'm running one master in controller and slave in robot. and every topic is image_raw/compreesed, audio, mobile_base_conttroller/cmd velocity has been subscribed in one or another machine. Is it better to use ros 2 considering the multiple topics has to be passed from network?
Asked by dinesh on 2020-06-01 05:44:23 UTC
every topic is image_raw/compreesed, audio, mobile_base_conttroller/cmd velocity has been subscribed in one or another machine.
Do you know why they are subscribed to? Again: only if there are subscribers will data be transferred.
If you have subscribers for them (I guess other than RQT Topic Monitor), then it would seem those are needed.
it looks like since all other unneccessary topics are also passed from same network it is eating the bandwidth
which topics are unnecessary exactly? Unnecessary topics wouldn't have subscribers, would they?
Asked by gvdhoorn on 2020-06-01 06:48:53 UTC
like /cam1/image_raw i'm not subscribing this topic in any node, but still it is taking lot of bandwidth more than /cam1/image_raw/compressed. and other small topics like cap1/image/theroa etc. so does it means that if only compressed image is being subscribed the raw image will not pass from network?
Asked by dinesh on 2020-06-01 06:55:05 UTC
If you quit RQT Topic Monitor, and run rostopic info /cam1/image_raw
, how many subscribers does that return? And make sure to try this on a freshly started system.
Asked by gvdhoorn on 2020-06-01 06:58:33 UTC
ok. got it. those which topics are not subscribed by any node, they don't pass through network.
Asked by dinesh on 2020-06-01 07:18:48 UTC
Exactly.
So do you now understand your question is a bit strange?
Why "disable topics" if they do not contribute to the total volume of traffic?
Also: none of the topics are useless (from a network traffic perspective), as, if they were useless, they'd probably not have any subscribers. And if they don't have any subscribers, they don't contribute to the network traffic, so there would be no problem in having them there.
Asked by gvdhoorn on 2020-06-01 07:22:06 UTC
Could you please mark the question as answered by ticking the checkmark (✓) to the left of the answer if you feel it has been answered? Thanks.
Asked by gvdhoorn on 2020-06-01 07:51:10 UTC
Comments