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

roslaunch node on slave from master

asked 2022-07-06 07:35:22 -0500

dualsbiker gravatar image

Hey there, I'm using ROS Noetic on my Ubuntu 20 host pc and ROS Melodic on my raspberrypi slave machine. I try to start a node on slave via roslaunch running on master. Roscore is running on master. If I run roslaunch directly on the slave it, works fine. When I do roslaunch on master I get errors.

This is the launch file on master:

    <machine name="raspberrypi" address="" env-loader="/opt/ros/melodic/" user="pi" password="***"/>
    <node machine="raspberrypi" pkg="adc_mcc172" name="adc_mcc172" type=""/>

This is the launch file on slave:

    <node pkg="adc_mcc172" type="" name="adc_mcc172" output="screen" respawn="true" respawn_delay="30" >
    some params for device config

This is bashrc on master:

export ROS_IP=

This is bashrc on slave:

export ROS_IP=

I hope that someone has THE idea for this problem. I have no more ideas.

Thanks a lot


# # #

I get the following output on master when I do roslaunch on master:

started roslaunch server
remote[] starting roslaunch
remote[]: creating ssh connection to, user[pi]
launching remote roslaunch child with command: [env ROS_MASTER_URI= 
/opt/ros/melodic/ roslaunch -c -u --run_id 48a903fc-fc55-11ec-84a9-c517f1bf5fd1 --sigint-timeout 15.0 --sigterm-timeout 2.0]
remote[]: ssh connection created


* /rosdistro: noetic
* /rosversion: 1.15.14

* raspberrypi

adc_mcc172 (adc_mcc172/


[]: launching nodes...
[]: ERROR: cannot launch node of type [adc_mcc172/]: adc_mcc172
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share
[]: ... done launching nodes

The error comes from slave machine. I can find it in the ~/.ros/log/ folders.

This is the log-file from slave:

[roslaunch][INFO] 2022-07-06 11:59:14,826: roslaunch starting with args ['/opt/ros/melodic/bin/roslaunch', '-c', '', '-u', '', '--run_id', '48a903fc-fc55-11ec-84a9-c517f1bf5fd1', '--sigint-timeout', '15.0', '--sigterm-timeout', '2.0']
[roslaunch][INFO] 2022-07-06 11:59:14,827: roslaunch env is {'ROS_DISTRO': 'melodic', 'XDG_SESSION_TYPE': 'tty', 'SSH_CLIENT': ' 44942 22', 'LOGNAME': 'pi', 'USER': 'pi', 'HOME': '/home/pi', 'PATH': '/opt/ros/melodic/bin:/usr/local/bin:/usr/bin:/bin:/usr/games', 'CMAKE_PREFIX_PATH': '/opt/ros/melodic', 'LD_LIBRARY_PATH': '/opt/ros/melodic/lib', 'LANG': 'en_GB.UTF-8', 'SHELL': '/bin/bash', 'SHLVL': '0', 'ROS_LOG_FILENAME': '/home/pi/.ros/log/48a903fc-fc55-11ec-84a9-c517f1bf5fd1/roslaunch-raspberrypi-14959.log', 'ROS_MASTER_URI': '', 'XDG_SESSION_CLASS': 'user', 'XDG_RUNTIME_DIR': '/run/user/1000', 'PYTHONPATH': '/opt/ros/melodic/lib/python2 ...
edit retag flag offensive close merge delete


Is adc_mcc172 installed on your RPi? If it isn't: that's the problem.

If it is: is it available as part of the main installation (ie: in /opt/ros/...) or in a workspace built from source?

If the latter: that's likely why it isn't working.

You've specced /opt/ros/melodic/ as your env-loader. That file will only let you use packages located in /opt/ros/melodic/... (as is confirmed by the error message: it only lists two paths under /opt/ros as part of the ROS path).

Anything in a custom workspace will not be 'visible'.

gvdhoorn gravatar image gvdhoorn  ( 2022-07-07 00:10:21 -0500 )edit

Ahaaa, yes adc_mcc172 is a node written by me and built via catkin simple in workspace. Do you think, that it woul solve the issue, when I put the path to ros path variable?

dualsbiker gravatar image dualsbiker  ( 2022-07-07 00:20:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-07-13 01:04:07 -0500

dualsbiker gravatar image

I solved the issue. The problem was, that the bashrc is not called by shh commands. I wrote my own env-loader and put all the config stuff in it. I put it to the workspace on the slave and changed the launch file on master.

This is the env-loader on slave:


source /opt/ros/melodic/setup.bash
source /home/pi/bob_ws/install/setup.bash
export ROS_IP=
export PATH="/opt/ros/melodic/share:$PATH"
export ROS_PACKAGE_PATH=/home/pi/bob_ws/install/share:$ROS_PACKAGE_PATH

if [ $# -eq 0 ] ; then
    /bin/echo "Usage: COMMANDS"
    /bin/echo "Calling without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually."
    exit 1

# ensure to not use different shell type which was set before

# source from same directory as this file
exec "$@"

This is the part in launch file on master:

<machine name="raspberrypi" address="" env-loader="/home/pi/bob_ws/src/adc_mcc172/scripts/" user="pi" password="***"/>
<node machine="raspberrypi" pkg="adc_mcc172" name="adc_mcc172" type=""/>
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-07-06 07:35:22 -0500

Seen: 287 times

Last updated: Jul 13 '22