How to tell remote machines not to start separate roscores when using roslaunch? (Fuerte regression?)
Hi
My goal is to start nodes on different machines using roslaunch while all the nodes should communicate to one master. This worked in electric. In fuerte the same process starts now a master for each machine. I guess something has changed, what do I need to do to fix it?
I created a sample launchfile that looks like this:
<launch>
<machine name="m3" address="marvin-3" default="true"/>
<machine name="m4" address="marvin-4" default="true"/>
<group >
<node name="m" pkg="turtlesim" type="mimic" respawn="false" machine="m4"/>
<node name="t" pkg="turtlesim" type="turtlesim_node" respawn="false" machine="m3"/>
</group>
</launch>
I start my launch-script in the following way:
user@marvin-3:~$ export ROS_MASTER_URI="http://marvin-3:11311"
user@marvin-3:~$ roslaunch myLaunch.launch
The output I get looks like this:
user@marvin-3:~$ roslaunch myLaunch.launch
... logging to /home/user/.ros/log/827ebf04-b705-11e1-85a7-bcaec524ca66/roslaunch-marvin-3-23516.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://marvin-3:51304/
remote[marvin-4-0] starting roslaunch
remote[marvin-4-0]: creating ssh connection to marvin-4:22
launching remote roslaunch child with command: [/opt/ros/fuerte/env.sh roslaunch -c marvin-4-0 -u http://marvin-3:51304/ --run_id 827ebf04-b705-11e1-85a7-bcaec524ca66]
remote[marvin-4-0]: ssh connection created
SUMMARY
========
PARAMETERS
* /rosdistro
* /rosversion
MACHINES
* m3
* m4
NODES
/
t (turtlesim/turtlesim_node)
m (turtlesim/mimic)
auto-starting new master
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[master]: started with pid [23535]
ROS_MASTER_URI=http://marvin-3:11311
setting /run_id to 827ebf04-b705-11e1-85a7-bcaec524ca66
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[rosout-1]: started with pid [23548]
started core service [/rosout]
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[t-2]: started with pid [23560]
[marvin-4-0]: launching nodes...
[marvin-4-0]: auto-starting new master
[marvin-4-0]: process[master]: started with pid [27764]
[marvin-4-0]: ROS_MASTER_URI=http://localhost:11311
[marvin-4-0]: setting /run_id to 827ebf04-b705-11e1-85a7-bcaec524ca66
[marvin-4-0]: process[m-1]: started with pid [27778]
[marvin-4-0]: ... done launching nodes
In the line
[marvin-4-0]: ROS_MASTER_URI=http://localhost:11311
things are starting to go wrong. This should be rather set to marvin-3 (that is why I set ROS_MASTER_URI before running the launch script).
I realize (and confirmed) that I can set the ROS_MASTER_URI using a custom env-loader on my target machine. But that seems to be very complicated. This also leads to an explosion of the number of env-scripts needed.
I tried to look into the tutorial Roslaunch tips for larger projects. But that seems outdated.
Does someone have a better solution for me here?
Dirk