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

using multiple robots with the same roscore on multiple machines

asked 2021-03-30 09:20:00 -0500

os gravatar image

Hi, I have 2 robots with the same code. They are running on multiple machines(each robot on one machine). I have one node that needs to sync the data between them. The question is, how I change the topics on the launch so that each robot will work with its own topics and still be able to configure the topic of the syncing node so it will be able to subscribe from the second robot topics.
I'm using ROS 1 Kinetic

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-03-30 15:44:20 -0500

hidmic gravatar image

To the best of knowledge, ROS graph isolation in ROS1 relies on namespaces. So if you've consistently used relative names, you should be able to <include/> an entire launch file hierarchy from within a <group/>, which allows you to set a namespace (see http://wiki.ros.org/roslaunch/XML/group). If you haven't, or if you rely on code that doesn't (e.g. tf2 is likely hitting /tf and /tf_static), you can explicitly <remap/>within each group (see http://wiki.ros.org/roslaunch/XML/remap). Some node in the root namespace can then target any topic using fully qualified names.

edit flag offensive delete link more

Comments

Is there a way to this globally without edit each launch file? In my project, I have multiple lanch and I try to find out if there is an easy way to do this?

Can the remapping/group adding be done dynamically?

os gravatar image os  ( 2021-03-31 03:43:15 -0500 )edit

Dynamic remapping is not supported in ROS 1. There are plans for ROS 2. But I believe you're not necessarily asking for remapping at runtime, only remapping without editing files.

Remapping launch files can be done external to the .launch file, by adding an ns attribute to the include element.

gvdhoorn gravatar image gvdhoorn  ( 2021-03-31 04:17:48 -0500 )edit

@gvdhoorn So in order to avoid editing all my .launch files, I need to create a new launch that will load the others, and in that primary launch add the ns attribute?

os gravatar image os  ( 2021-03-31 06:02:38 -0500 )edit

That's about right. Moreover, if the same launch files are deployed to different robots, launch arguments and/or $(env) substitutions are a simple way to parameterize and reuse the same top-level .launch.

hidmic gravatar image hidmic  ( 2021-03-31 08:17:27 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-03-30 09:20:00 -0500

Seen: 270 times

Last updated: Mar 30 '21