ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Best practice needed. Spawning many topics from a service?

asked 2018-04-24 04:39:14 -0500

ros_learner gravatar image

updated 2018-04-24 05:05:47 -0500

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?

edit retag flag offensive close merge delete

Comments

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.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-24 04:51:59 -0500 )edit

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.

ros_learner gravatar image ros_learner  ( 2018-04-24 05:21:58 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-24 05:27:54 -0500 )edit

Okay, so I should just run rosbridge on every robot and directly communicate to the windows back end? Sounds like a simplification :)

ros_learner gravatar image ros_learner  ( 2018-04-24 05:40:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-04-24 06:25:54 -0500

I'd recommend using a single topic for all of your robots and including a robot identifier (int or string) in the message. This way you don't have to worry about creating many (hundreds maybe) topics.

But there are a few things that you need to consider before choosing the best option:

  • How many different robots are you expecting to work with?
  • Will you need two way communication between the server and client robots?
  • Will you need guaranteed message delivery to or from your robots?

The answers to all of these questions will inform the design of the communication architecture.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-04-24 04:39:14 -0500

Seen: 208 times

Last updated: Apr 24 '18