running launch files on multiple master at the same time

asked 2021-01-20 16:28:33 -0500

RosSam gravatar image

Hi, In my project, i need to set up parallel testing jobs. so i have multiple launch files with different parameters, using the same default nodes, that should run in parallel. I tried to assign a different namespace to each launchfile, but still some nodes are shutting down. i guess it's all about the master, because they are all connecting to the same master even with different namespace. I want to ask if it is possible to run exactly multiple masters i parallel? thus each launch file should be connected to it's own master. i need to run 50 launchfiles with their respective masters at the same time (ci parallel jobs) is that possible ?

edit retag flag offensive close merge delete

Comments

If everything is namespaced properly, I'm not sure why nodes are shutting down. Can you post the output/errors you're getting and the launch file(s)?

tryan gravatar image tryan  ( 2021-01-22 06:51:53 -0500 )edit

first.launch

<launch>
  <group ns="v0">
    <node a=""/>
    <node b=""/>
    <node c=""/>
  </group>
</launch>

second.launch

<launch>
  <group ns="v1">
    <node a=""/>
    <node b=""/>
    <node c=""/>
  </group>
</launch>

third.launch

<launch>
  <group ns="v2">
    <node a=""/>
    <node b=""/>
    <node c=""/>
  </group>
</launch>

this is my structure for every launch file. The launch files are launched by different scripts at the same time. let say first.sh, second.sh and third.sh. in Gitlab ci these scripts are executed in parallel jobs.i tried the namespace groups before and i noticed the following: when node a in first.launch quit, then node a in every launch quit. this is very unexpected behavior. so i tried the following: inside every script i export the roscore with different port then i start launch files with ...(more)

RosSam gravatar image RosSam  ( 2021-01-22 13:50:36 -0500 )edit

output first.launch

process has finished cleanly
log file: /root/.ros/log/1fa0fa7a-5cea-11eb-9038-0242ac110002/vehicle0-terminator-2*.log
Initiating shutdown!

output second.launch

REQUIRED process [vehicle1/timer-3] has died!
process has died [pid 451, exit code -15, cmd /home/adore_workspace_dir/install/lib/adore_if_ros/adore_timer_node __name:=timer __log:=/root/.ros/log/2081d310-5cea-11eb-9c1a-0242ac110002/vehicle1-timer-3.log].
log file: /root/.ros/log/2081d310-5cea-11eb-9c1a-0242ac110002/vehicle1-timer-3*.log
Initiating shutdown!

output third.launch

REQUIRED process [vehicle2/timer-3] has died!
process has died [pid 653, exit code -15, cmd /home/adore_workspace_dir/install/lib/adore_if_ros/adore_timer_node __name:=timer __log:=/root/.ros/log/20aba47e-5cea-11eb-9104-0242ac110002/vehicle2-timer-3.log].
log file: /root/.ros/log/20aba47e-5cea-11eb-9104-0242ac110002/vehicle2-timer-3*.log
Initiating shutdown!
RosSam gravatar image RosSam  ( 2021-01-22 13:58:54 -0500 )edit

Do you run roscore separately before the launch files? If not, the master starts automatically with the first one, but it will also shutdown when the first finishes.

tryan gravatar image tryan  ( 2021-01-23 14:45:54 -0500 )edit

Yes. Every launch file connect to seperate master, inside every script as follow:

Export ros_master_uri=xxxxx
Roscore -p xxxxx
Roslaunch -p xxxx
RosSam gravatar image RosSam  ( 2021-01-27 05:27:37 -0500 )edit

It should be ROS_MASTER_URI (all caps). Is that a typo?

tryan gravatar image tryan  ( 2021-01-27 09:19:06 -0500 )edit