ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Best practice for running multiple robots in a class

asked 2018-12-08 13:55:50 -0600

pitosalas gravatar image

updated 2018-12-09 01:46:10 -0600

gvdhoorn gravatar image

Next semester I will have a bigger class and will have one robot for every two students. At this moment we have just one Roscore running. What is the best practice for keeping the topics straight in a scenario like that? It seems natural that we will name space our various key topics with the robots name (e.g. robot1/cmd_vel). But how do I configure each robot for minimal hassle so when it comes up all the name spacing is done as we would like? It would seem that we'd do it with environment variables somehow. I am sure many others have worked this out and I am looking for advice. Thanks.

Edit: Having a bunch of roscores is ok. We've gotten a static IP for our roscore. Having each student pair run one and entering their dynamic IPs technically works but practically there are lots of room for typos and other carelessness. I was hoping to be able to put on each robot setenv ROBOTNAME="Joseph" and have that (somehow) automatically namespace all (some) of the key topics. Any experience with that?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-08 15:44:06 -0600

ruffsl gravatar image

If your using ROS1, and you don't need the robots to talk to each other, then running a separate roscore on/for each robot would be fine. As long as students set their computers to talk to their own robot using the respective ROS_MASTER_URI, then that should be enough to prevent any cross talk between the robots in classroom. If your goal is for the robots to intercommunicate, like in a corticated swarm gossiping over a common channel, then that would require some careful namespacing unser a glocal roscore or else some complex multi ros master setup.

See the wiki for more general info:

As a side note, If you happen to migrate to ROS2 that does much of the discovery for you, the same as isolation as above could be achieved by designating each robot with its own ROS_DOMAIN id, however most DDS vendors only support a range from 0-232, so that approach might limit the number of robots that could simultaneously operate independently on the same network. You could partition a sharded domain in other ways using QoS settings via DDS partitions instead of namespacing them explicitly in ROS2 topics/nodename/services etc; you just need to set and pass in the QoS setting when launching the node.

Partitions are namespaced by a string name, as opposed to a number range, so there can be arbitrary number of separate partitions. To still allow the robots to intercommunicate you could write some kind of local bridge process between two local nodes subprocess started on different domains/partitions, where one node is cordoned off to communicate with the local robot network, and that other to communicate with the rest of the robots over a shared data space on the external network (e.g. domain_id 0 could be reserved for this). Sort of like the DDS router concept.

Choosing and setting domains:

DDS info on domain_id and DDS routing concepts

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-12-08 13:55:50 -0600

Seen: 620 times

Last updated: Dec 09 '18