roslaunch with missing remote

asked 2021-09-23 20:44:16 -0500

lalvarez gravatar image

Is there a way of specifying a "not required" argument in a machine definition within a launch file? I'm trying to run a launch file that starts a node on a remote machine, however the roslaunch process fails if the remote machine can't be found on the network. I tried using a required="true" tag in the node definition but the whole program still fails if the machine cannot be found.

edit retag flag offensive close merge delete


No, that's not supported AFAIK.

The required attribute you mention is for node and configures roslaunch such that it will shut down the whole application (well, the nodes it's managing) if/when it detects that particular node dies/shuts down (ie: the one with required="true").

Could you perhaps clarify why you'd have a .launch file intended to start nodes on a remote machine but then not have that machine available? ROS 1 sort-of assumes a 'perfect network', so intermittent failures or machines leaving/joining at unpredictable times are not handled very well.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-25 00:43:43 -0500 )edit

Thanks for the answer! I'm working on some experimental features for a robot service running in production. Because of this, the new features I'm developing are running on a second computer onboard the robot. My current solution is simply having two .launch files, with the new one calling the .launch that brings up the remote node. I would like to have only one file so that running the system in the field is easier for the operator.

I considered using a shell script to ping the remote machine and set an enviroment variable that I can then check using an if argument, however the only way I could think of invoking said script would be using a cron job that runs constantly every 30 or so seconds. Do you think there's a more elegant solution?

lalvarez gravatar image lalvarez  ( 2021-09-26 19:17:49 -0500 )edit