Ask Your Question

Remote node does not receive parameters

asked 2017-07-24 03:14:06 -0500

heuristicus gravatar image

I'm trying to run a node remotely from one PC, which is connected to another on a local network using the following launch file:

  <arg name="machine" default="side-machine" />
  <arg name="user" default="my-user" />

  <!-- Datacentre -->
  <arg name="db_path" default="/my/db/path"/>
  <arg name="port" default="11111" />

  <arg name="defaults_path" default=""/>

  <!-- NOW when launching in a remote mode it will need the ROS_ENV_LOADER set if not it will leave it empty -->
  <machine name="$(arg machine)" address="$(arg machine)" env-loader="/home/strands/my_test_ws/devel/" user="$(arg user)" def\
  <node name="launchtest" pkg="latest" type="" output="screen" machine="$(arg machine)">
    <param name="database_path" value="$(arg db_path)"/>
</launch> looks like this:

#!/usr/bin/env python                                                       

import rospy




When I run the launch file, I get the following result:

launching remote roslaunch child with command: [env ROS_MASTER_URI=http://localhost:11311 /home/my-user/my_test_ws/devel/ roslaunch -c side-machine-0 -u http://main-machine:39722/ --run_id 127726c0-7040-11e7-9d42-901b0eacf01e]
remote[side-machine-0]: ssh connection created


 * /launchtest/database_path: /my/db/path
 * /rosdistro: indigo
 * /rosversion: 1.11.21

 * my-user

    launchtest (latest/


core service [/rosout] found
[side-machine-0]: launching nodes...
[side-machine-0]: auto-starting new master
[side-machine-0]: process[master]: started with pid [22973]
[side-machine-0]: ROS_MASTER_URI=http://localhost:11311
[side-machine-0]: setting /run_id to 127726c0-7040-11e7-9d42-901b0eacf01e
[side-machine-0]: process[launchtest-1]: started with pid [22987]
[side-machine-0]: ... done launching nodes
[side-machine-0]: [launchtest-1] process has died [pid 22987, exit code 1, cmd /home/my-user/my_test_ws/src/latest/scripts/ __name:=launchtest __log:=/home/my-user/.ros/log/127726c0-7040-11e7-9d42-901b0eacf01e/launchtest-1.log].
log file: /home/my-user/.ros/log/127726c0-7040-11e7-9d42-901b0eacf01e/launchtest-1*.log

Where the output in the log file is

[rospy.client][INFO] 2017-07-24 09:40:35,815: init_node, name[/launchtest], pid[22987]
[xmlrpc][INFO] 2017-07-24 09:40:35,815: XML-RPC server binding to
[xmlrpc][INFO] 2017-07-24 09:40:35,815: Started XML-RPC server [http://side-machine:55695/]
[rospy.init][INFO] 2017-07-24 09:40:35,815: ROS Slave URI: [http://side-machine:55695/]
[rospy.impl.masterslave][INFO] 2017-07-24 09:40:35,816: _ready: http://side-machine:55695/
[xmlrpc][INFO] 2017-07-24 09:40:35,816: xml rpc node: starting XML-RPC server
[rospy.registration][INFO] 2017-07-24 09:40:35,816: Registering with master node http://localhost:11311
[rospy.init][INFO] 2017-07-24 09:40:35,916: registered with master
[rospy.rosout][INFO] 2017-07-24 09:40:35,916: initializing /rosout core topic
[rospy.rosout][INFO] 2017-07-24 09:40:35,918: connected to core topic /rosout
[rospy.simtime][INFO] 2017-07-24 09:40:35,919: /use_sim_time is not set, will not subscribe to simulated time [/clock] topic
[rosout][INFO] 2017-07-24 09:40:35,922: {'roslaunch': {'uris': {'host_main-machine__39722': 'http://main-machine:39722/'}}, 'run_id': '127726c0-7040-11e7-9d42-901b0eacf01e'}
[rospy.core][INFO] 2017-07-24 09:40:35,923: signal_shutdown [atexit]
[rospy.impl.masterslave][INFO] 2017-07-24 09:40:35,924: atexit

It appears that the remote node is not receiving the parameters from the main-machine. This is odd, because if I do rosparam list on ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-10-31 09:25:59 -0500

I encountered this in ROS Kinetic. I found that the ROS_MASTER_URI environment variable was not set correctly on the remote machine.

I found that when I launched a remote node, the remote machine was acting as its own ROS master. That is, I could see that a process had been launched (using top, ps, or so on), but running rosnode list on either the local or remote machine did not show the node. Attaching a debugger on the remote machine and inspecting the environment confirmed that ROS_MASTER_URI was still set to http://localhost:11311.

Note that setting ROS_MASTER_URI in ~/.bashrc or somewhere similar _does not_ work in this case, because that file does not get sourced when your remotely launch a node. This is why your node might have worked fine if you were to log in to the remote machine and launch it from there.

I believe the preferred solution is to make sure that the script specified by the env-loader parameter in your <machine> entry is setting ROS_MASTER_URI correctly; if you have it set to env-loader="/opt/ros/kinetic/" or something like that, then it's probably _not_ being set correctly by default.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-07-24 03:14:06 -0500

Seen: 228 times

Last updated: Jul 24 '17