0
$\begingroup$

Rosanswers logo

Hi all! I am running ROS Melodic on two machines that are on the same network (host X and remote computer Y). I attempting to run a launch file on host X, which launches packages from X and remote computer Y. However, I always seem to get this error, no matter what I try:

Done checking log file disk usage. Usage is <1GB.

Resource not found: Y_package
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/XUser/base_ws/src
ROS path [2]=/opt/ros/melodic/share
The traceback for the exception was written to the log file

I am able to rosrun a talker on X and a listener on Y, and have them communicate, as well as a listener on Y and a talker on X - I can ping X from Y and Y from X. I know that they can communicate.

Below is my launch file code:

<launch>
        <arg name="port"        default="/dev/ttyACM0" />
        <arg name="config"      default="defaultConfig.yaml" />


        <machine name="X" address="192.168.8.104" user="XUser" env-loader="/opt/ros/melodic/env.sh" password="XPassword" />
                <node machine="X" pkg="X_package" type="cpp1" name="cpp1" required="true" output="screen" />
                <node machine="X" pkg="X_package" type="cpp2" name="cpp2" required="true" output="screen" />
                <node machine="X" pkg="X_package" type="py1.py" name="py" required="true" output="screen"  />

        <machine name="Y" address="192.168.8.200" user="YUser" env-loader="/opt/ros/melodic/env.sh" password="YPassword" />
                <node machine="Y" pkg="joy" type="joy_node" name="joy_node" required="true" output="screen"/>
                <node machine="Y" pkg="rosserial_arduino" type="serial_node.py" name="serial_node" args="$(arg port)" required="true" output="screen" />
                <node machine="Y" pkg="Y_package" type="py2.py" name="py2" required="true" output="screen" />
                <node machine="Y" pkg="Y_package" type="py3.py" name="py3" required="true" output="screen" />
                <node machine="Y" pkg="Y_Package" type="py4.py" name="py4" required="true" output="screen" />

</launch>

I can run all these files in a launch file locally on Y just fine with roscore running on X. It's just when trying to run a launch file on X with Y_package in it that I get the above error.

I already know about the ROS Multiple Machines, the ROS NetworkSetup and the roslaunch XML tutorials, and have applied them where needed, but they were still not enough.

Please let me know what else you might need to help me, I'm at my wits end! Thank you!

Edit: Forgot to mention that everything is sourced correctly as well - at least I'm pretty sure.

This is my /opt/ros/melodic/env.sh on machine X:

#!/usr/bin/env sh
# generated from catkin/cmake/templates/env.sh.in
source /home/XUser/base_ws/devel/setup.bash

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

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

# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(cd "`dirname "$0"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"
exec "$@"

And here is the one on machine Y:

#!/usr/bin/env sh
# generated from catkin/cmake/templates/env.sh.in
source home/YUser/catkin_ws/devel/setup.bash

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

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

# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(cd "`dirname "$0"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"
exec "$@"

Originally posted by Mattisha on ROS Answers with karma: 11 on 2022-04-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi all!

I used this tutorial and it made everything work out - the only change I had was making the custom env file export the local machine (machine X) for the ROS_MASTER_URI so everything ran on the local machine instead the remote one.

Hope this helps!


Originally posted by Mattisha with karma: 11 on 2022-04-20

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.