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:

<launch>
  <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/env.sh" user="$(arg user)" def\
ault="true"/>
  <node name="launchtest" pkg="latest" type="launchtest.py" output="screen" machine="$(arg machine)">
    <param name="database_path" value="$(arg db_path)"/>
  </node>
</launch>

launchtest.py looks like this:

#!/usr/bin/env python                                                       

import rospy

rospy.init_node("launchtest")

rospy.loginfo(rospy.get_param(""))

rospy.loginfo(rospy.get_param("~database_path")

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/env.sh roslaunch -c side-machine-0 -u http://main-machine:39722/ --run_id 127726c0-7040-11e7-9d42-901b0eacf01e]
remote[side-machine-0]: ssh connection created

SUMMARY
========

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

MACHINES
 * my-user

NODES
  /
    launchtest (latest/launchtest.py)

ROS_MASTER_URI=http://localhost:11311

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/launchtest.py __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 0.0.0.0:0
[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