2
$\begingroup$

I am trying to launch a file from remote computer but I could not success. Actually I can connect to remote computer but I think the problem is with including a file from remote computer. In other words, I am looking for a machine tag for include. Here is the my code:

<launch>  

    <group >
      <machine name="marvin-1" address="tek-marvin-1" user="blabla" password="blabla" env-loader="/home/blabla/.rosLaunchScript.sh"/>  

      <include file="$(find openni_launch_marvin)/launch/kinect_left.launch"/>
    </group>     

</launch>
$\endgroup$
1
  • 1
    $\begingroup$ You may find help on this topic here, but you may have more luck getting a fast answer at answers.ros.org. $\endgroup$ – brnd4n Jul 9 '13 at 23:59
3
$\begingroup$

A better approach would be to first ssh into the remote computer. In the remote terminal, run

export MASTER_URI = http://IP_address_master:Port_number

where IP_address_master should be the IP address of the computer on which you want to run the master node. IP address could either be of your local machine or remote computer. Port_number is the port of your master node (generally it is 11311). On the same terminal, run

export ROS_IP = IP_address_remote

where IP_address_remote is the IP of your remote computer. In the terminal of your local machine (not the one where you are running ssh from), run the following commands:

export MASTER_URI = http://IP_address_master:Port_number
export ROS_IP = IP_address_local

where, IP_address_master and Port_number is same as above but IP_address_local should be the IP address of your local computer.

Now, you are ready to launch the file from your remote terminal. Your no longer require a separate launch file. In the ssh terminal, run the launch file kinect_left.launch directly as:

roslaunch openni_launch_marvin kinect_left.launch
$\endgroup$
0
$\begingroup$

The following hacky method is only valid if you have packages / launch files that are ONLY available on remote. If the packages / launch files are available on both host and remote machine, you can simply use the <machine> tag from roslaunch which is much cleaner.

(cross posting from https://answers.ros.org/question/371480/roslaunch-nodes-launch-files-only-available-on-remote-machine/?answer=371491#post-id-371491)

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.