ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

roslaunch nodes / launch files only available on remote machine?

asked 2021-02-10 02:23:47 -0500

Rufus gravatar image

As pointed out in roslaunch/XML

Substitution args are currently resolved on the local machine. In other words, environment variables and ROS package paths will be set to their values in your current environment, even for remotely launched processes

Is there any way to use roslaunch to launch nodes or launch files that are only available on a remote machine?

I've checked this solution but it doesn't seem to be working (nor is it supposed to work).

edit retag flag offensive close merge delete

Comments

I don't believe there is a supported way.

I've seen some hacks with Docker images, dummy pkgs and launch-prefix, but it's not officially supported.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-10 02:29:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-02-10 03:13:50 -0500

Rufus gravatar image

updated 2021-02-10 03:28:07 -0500

Assuming host has ssh key access to remote, I accomplished this with the following:

Host machine launch file:

<launch>
    <node pkg="local_pkg" type="remote_bringup.sh" name="remote_bringup"/>
</launch>

Host machine remote_bringup.sh

#!/usr/bin/env bash

trap 'ssh remote@remote "pkill roslaunch"' INT TERM
ssh remote@remote "~/bringup.sh"
wait

Remote machine bringup.sh

#!/bin/bash

export ROS_MASTER_URI=http://host_machine:11311
export ROS_IP=remote_machine
nohup /opt/ros/install/env.sh roslaunch remote_pkg normal.launch &

The script properly catches SIGINT, SIGTERM and forwards it to the remote machine's roslaunch

edit flag offensive delete link more

Comments

1

Yes, that's similar to one of the work-arounds I mentioned.

Remote machine bringup.sh

#!/bin/bash
source /opt/ros/melodic/setup.bash
source /opt/ros/install/setup.bash
export ROS_MASTER_URI=http://host_machine:11311
export ROS_IP=remote_machine
nohup roslaunch remote_pkg normal.launch &

Couldn't you use /opt/ros/install/env.sh as a prefix for roslaunch remote_pkg normal.launch?

Seems much simpler.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-10 03:16:30 -0500 )edit

@gvdhoorn TIL, thx for the tip :D

Rufus gravatar image Rufus  ( 2021-02-10 03:28:31 -0500 )edit

@gvdhoorn Any workaround for windows host machine and ubuntu remote machine?

billnava gravatar image billnava  ( 2022-04-16 04:35:11 -0500 )edit
1

Couldn't you still use SSH? There are clients for Windows (as well as servers).

gvdhoorn gravatar image gvdhoorn  ( 2022-04-16 06:04:37 -0500 )edit

How to accomplish this as at startup? Let's say, the host runs a script that starts the roslaunch file after the startup automatically. We need to make sure that the remote machine is up if we will execute ssh remote@remote "~/bringup.sh". What would be the trick to catch this?

asaglam gravatar image asaglam  ( 2023-06-15 09:04:33 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-02-10 02:23:47 -0500

Seen: 515 times

Last updated: Feb 10 '21