Best practice needed. Spawning many topics from a service?
I'm playing around with ROS and multiple VMs, each representing a robot. Now, I'm wondering about best practices regarding communication to and from these VMs and the master.
Currently I have the following in my mind:
- Master runs a service,
- A robot comes online, sends message to the service containing its name (predefined on the robot),
- The Master spawns a topic, this topic is used for communication between the robot and rosbridge
When another robot comes online, the service creates a new topic for the robot etc.
Is this an acceptable approach? How do I spawn topics from a service without actually blocking the application? Is this entirely nonsensical?
Is it better to just start the topic/node on the robot if the result of logon is OK? While keeping a collection of logged on robots on the master?
Can you please clarify what you mean with "master" here specifically? The Master is actually a concept in ROS, with a clearly defined role, and 'spawn[ing] a topic' is not one of them.
If you mean something else, please clarify.
Ok, then I'm mistaken in the responsibilites of the Master. Up till now I viewed as more of a client-server model, with the robot representing the client and the master the server.
Yes. The master is only really involved in a small part of the communication. Client-server is supported, but always between nodes. The master is not involved in any of the real work at all.
Okay, so I should just run rosbridge on every robot and directly communicate to the windows back end? Sounds like a simplification :)