Robotics StackExchange | Archived questions

can i use a single nodehandle for multiple subscrubers in a single cpp file

is it possible to use a single node handle to subscribe to multiple topics simultaneously or will this only subscribe to a single topic and then switch from one topic to another. will this cause me a loss of a particular topic data at that instant ? thnx

Asked by rajnunes on 2016-09-26 08:10:52 UTC

Comments

Answers

Yes, you can use a single NodeHandle to subscribe (and publish) to multiple topics.

Only when the NodeHandle instance goes out of scope will your subscriptions (and any publishers) be taken down.


Edit: note that this has been asked multiple times already, as a quick search reveals: see question about the nodehandle for subscribing and publishing and roscpp node handles convention fi.

Asked by gvdhoorn on 2016-09-26 08:50:04 UTC

Comments