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

Revision history [back]

click to hide/show revision 1
initial version

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

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 &

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

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

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 /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