Using multimaster with 2 identical robots and a ground station
See original GitHub issueHi, I’d like to use multimaster for a setup with 3 machines, each running their own ROS master. One of the machines is a ground station, while the other 2 are identical vehicles with many nodes and topics. I would only like a small subset of topics from each of the vehicles to be shared with the base station alone. On each of the vehicles, I launch:
<launch>
<arg name="robot_name" default="robot0" />
<node name="master_discovery" pkg="master_discovery_fkie" type="master_discovery" >
</node>
<!-- Launch the relay node -->
<node pkg="topic_tools" type="relay" name="robot_relay" args="/shared_topic /$(arg robot_name)/shared_topic" />
</launch>
with a different "robot_name"
argument for each since I want the base station to differentiate between this shared_topic. On the base station, I launch:
<launch>
<node name="master_discovery" pkg="master_discovery_fkie" type="master_discovery" output="screen">
</node>
<node name="master_sync" pkg="master_sync_fkie" type="master_sync" output="screen">
<rosparam param="sync_topics"> ['/robot0/shared_topic', '/robot1/shared_topic'] </rosparam>
</node>
</launch>
which allows the base station to successfully receive /robot0/shared_topic
OR /robot1/shared_topic
when only one of the vehicle’s has launched the first launch file. When I try to run both, I get the following warning before the nodes on the vehicle shutdown:
Reason given for shutdown: [new node registered with same name]
.
Each vehicle and the base station have their own ROS Master with their own local IP address as the ROS_MASTER_URI
. I was under the impression that master_discovery
simply makes the machines aware of one another, and only master_sync
will cause collisions like this. Is there some argument that master_discovery
needs like "ignore_hosts"
or "ignore_nodes"
? I only want the ground station to be aware of a few topics from each vehicle, but the fact that the vehicles have a large number of nodes with the same name prevents this. I realize I could namespace each vehicle so that the topics and nodes all have different names, but I was wondering if there was another solution with just arguments to the launch files I have here, or if I’m misunderstanding the default behaviour of master_discovery
. Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Ahhh thank you so much, that did the trick! I had read elsewhere that for single ROS master setups I should avoid setting
ROS_MASTER_URI
explicitly, but that made it becomelocalhost
. It works great now!how can give my shared topics to sync node from launch file