Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Preventing spawn of two nodes with same parameter

I have a launch file that takes a serial number and a index number and launches the node based on those numbers, however if I launch one node with a serial number, and then a second node with the same serial number, then the second node will cause the first to shutdown because of "ros node with same name" and then since I have my respawn set to true (for other reasons) then the first node respawns and shutsdown node 2, and etc etc.

Any ideas how i can check for the serial number already being used? assuming the user is completely ignorant to any node already launched. I wanted to ideally check in the launch file, but I can only do boolean expressions with the "if" or "unless" statements, and for what I am trying, it doesnt work. PLEASE HELP!XD Thanks

Preventing spawn of two nodes with same parameter

I have a launch file that takes a serial number and a index number and launches the node based on those numbers, however if I launch one node with a serial number, and then a second node with the same serial number, then the second node will cause the first to shutdown because of "ros node with same name" and then since I have my respawn set to true (for other reasons) then the first node respawns and shutsdown node 2, and etc etc.

Any ideas how i can check for the serial number already being used? assuming the user is completely ignorant to any node already launched. I wanted to ideally check in the launch file, but I can only do boolean expressions with the "if" or "unless" statements, and for what I am trying, it doesnt work. PLEASE HELP!XD Thanks

perhaps there is an xarco type statement I can write? I am just not extremely familiar with it.