Robotics StackExchange | Archived questions

launching remote machine

My startup_launch.sh on remote machine:

#!/bin/bash
export ROS_IP=<remote-ip>
export ROS_MASTER_URI=http://<local-ip>:11311
source /opt/ros/noetic/setup.bash
source /home/ubuntu/service_robot_ws_old/devel/setup.bash

My medicbot.launch in local pc:

<?xml version="1.0"?>
<launch>
  <machine name="ubuntu" address="<remote-ip>" user="ubuntu" password="airobotics" env-loader="~/scripts/startup_launch.sh" default="true"/>

  <include file="$(find medicbot_control)/launch/medicbot_diff_drive_controller.launch"/>
</launch>

After i launch this launch file from my local pc i'm getting this kind of errors:

Resource not found: medicbot_control
ROS path [0]=/opt/ros/noetic/share/ros
ROS path [1]=/home/ubuntu/turtlebot3_ws/src
ROS path [2]=/opt/ros/noetic/share
The traceback for the exception was written to the log file

Here i can easily ssh loing to my remote machine with ssh ubuntu@ and run the medicbot_control pkgs. But when i try to launch the same file from the local pc i'm getting above errors.

I'm using ros noetic on ubuntu 20.04. I'm connected my raspberry pi 4B (8 gb ram) through ethernet right now and doing all this testing.

Here when i try to run the node instead of launch file also it is showing error:

<?xml version="1.0"?>
<launch>
  <machine name="ubuntu" address="<remote-ip>" user="ubuntu" password="airobotics" env-loader="~/scripts/startup_launch.sh" default="true"/>
  <node machine="ubuntu" pkg="cv_camera" type="cv_camera_node" name="cv_camera_node"/>
</launch>

The error is:

remote[10.42.0.107-0] starting roslaunch
remote[10.42.0.107-0]: creating ssh connection to 10.42.0.107:22, user[ubuntu]
launching remote roslaunch child with command: [env ROS_MASTER_URI=http://localhost:11311 ~/scripts/startup_launch.sh roslaunch -c 10.42.0.107-0 -u http://linux:42821/ --run_id d6360b06-2a2f-11eb-af75-bd8bf4312da5 --sigint-timeout 15.0 --sigterm-timeout 2.0]
remote[10.42.0.107-0]: ssh connection created
[10.42.0.107-0] killing on exit
RLException: remote roslaunch failed to launch: ubuntu
The traceback for the exception was written to the log file

So even the simple cvcameranode is not working even with machine tag.

Asked by dinesh on 2020-11-18 05:30:31 UTC

Comments

Since you've confirmed that you have the resource, it seems that the issue is with the environment setup. As found in the roslaunch <machine> tag documentation, the environment script generally ends with exec "$@". Does that help?

Asked by tryan on 2020-11-18 06:46:23 UTC

Answers

I think you missed the "machine" attribute in the node tag.

Your may look like (Note machine="ubuntu" was added):

<?xml version="1.0"?>
<launch>
  <machine name="ubuntu" address="<remote-ip>" user="ubuntu" password="airobotics" env-loader="~/scripts/startup_launch.sh" default="true"/>

  <include machine="ubuntu" file="$(find medicbot_control)/launch/medicbot_diff_drive_controller.launch"/>
</launch>

See http://wiki.ros.org/roslaunch/XML/machine#Examples

Asked by Wolf on 2020-11-18 07:45:18 UTC

Comments

Haha, so did I!

Asked by tryan on 2020-11-18 07:48:21 UTC

Still same error is coming.

Asked by dinesh on 2020-11-18 10:45:21 UTC

I've seen the machine attribute when using a node tag, for example:

<node machine="ubuntu" name="map_server" pkg="map_server" type="map_server"args="/map.yaml" />

In you case you have an include tag calling another launch. You need to modify that file (medicbot_diff_drive_controller.launch) and use the machine attribute in each node you are calling in it.

Hope it helps

Asked by lfvm0001 on 2020-11-18 12:08:09 UTC

Comments

i've updated my question.

Asked by dinesh on 2020-11-19 01:25:22 UTC

Before the error was about the pkg not being found... now the new error it seems to be related to ssh connection .... Acording to this question: https://answers.ros.org/question/187320/remote-roslaunch-failed-to-launch/ you are missing an " exec "$@" " in your environment loader.

Asked by lfvm0001 on 2020-11-19 04:14:02 UTC

For example:

#!/bin/sh

. /opt/ros/fuerte/setup.sh
exec "$@"

Asked by lfvm0001 on 2020-11-19 04:15:44 UTC

Also try to avoid using SSH password (its strongly discouraged) It is highly recommended that you configure SSH keys and SSH agent instead so you can login with certificates instead. Info taken from: http://wiki.ros.org/roslaunch/XML/machine

Asked by lfvm0001 on 2020-11-19 04:17:47 UTC