Determine message origin in a multirobot environment

asked 2021-09-03 02:51:12 -0500

texdade gravatar image

Hi! I'm pretty new to ROS (noetic) and I'm currently trying to run the AMCL localization algorithm in an environment where multiple robots have to communicate between each other. Because of this, we have a single roscore acting as an intermediary between multiple robots and robots themselves publish messages in topics that are shared between the group. My problem is: how can a robot tell that a specific message is for him (or from him)?

Example: two robots are running AMCL nodes and do only computations for themselves. Both publish their laser scans to the /scan topic, but how can their respective AMCL node tell which data to use? How can I be sure that robot1 is not using the laser scan from robot2?

Sorry if the question is trivial, but I think that the header message could cover this problem, but apparently it doesn't.

edit retag flag offensive close merge delete

Comments

Quick comment:

two robots are running AMCL nodes and do only computations for themselves. Both publish their laser scans to the /scan topic, but how can their respective AMCL node tell which data to use? How can I be sure that robot1 is not using the laser scan from robot2?

for this specifically, you'd use namespacing.

Each robot has its own namespace, and topics are looked up relative to the namespace a node is in.

You mention having multiple robots, so I would expect you're already using namespaces to make that possible.

One thing you should avoid is publishing to /scan. Instead, publish to scan. Otherwise namespacing can't work.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-03 03:34:56 -0500 )edit

That's perfect! Thank you!

texdade gravatar image texdade  ( 2021-09-05 02:08:35 -0500 )edit