Remote note launch works except when done through bash script

asked 2021-06-08 02:47:34 -0500

kidargueta gravatar image

Hi. I followed this blog and got remote launching right using the machine tag. Now I need to launch the launch file from a bash script in order to do it at boot time. When done this way, it fails with an ssh authentication message like this:

started roslaunch server http://robot:33535/
remote[sedrad-robot.local-0] starting roslaunch
remote[sedrad-robot.local-0]: creating ssh connection to sedrad-robot.local:22, user[shl]
/usr/lib/python2.7/dist-packages/Crypto/Cipher/blockalgo.py:141: FutureWarning: CTR mode needs counter parameter, not IV
  self._cipher = factory.new(key, *args, **kwargs)
remote[sedrad-robot.local-0]: failed to launch on sedrad-robot.local:

Authentication to remote computer[shl@sedrad-robot.local:22] failed.
A common cause of this error is a missing key in your authorized_keys file.

My launch file is this:

<?xml version="1.0"?>
<launch>
    <machine
        name="sedrad-robot.local"
        address="sedrad-robot.local"
        env-loader="/opt/ros/melodic/env_romario.sh"
        default="true"
        user="shl"
    />
    <include file="$(find zed_wrapper)/launch/zed_no_tf.launch" />
</launch>

and the bash file that tries to launch it is this:

#!/bin/bash

function log() {
  logger -s -p user.$1 ${@:2}
}

source /home/robot/catkin_ws/devel/setup.bash

export ROS_HOSTNAME=$(hostname)

export ROS_MASTER_URI=http://robot.local:11311
export ROS_HOME=${ROS_HOME:=$(echo ~robot)/.ros}
export ROS_LOG_DIR=$log_path

log info "Launching ROS_HOSTNAME=$ROS_HOSTNAME, ROS_IP=$ROS_IP, ROS_MASTER_URI=$ROS_MASTER_URI, ROS_HOME=$ROS_HOME, ROS_LOG_DIR=$log_path"

setuidgid robot roslaunch "/home/robot/catkin_ws/launch/include/sedrad_bringup.launch" &

As mentioned earlier, the remote launch works fine when I manually launch it from the terminal, it only fails when done through this bash file, so I suspect it has to do with this particular way of launching it. Is there anything that I can add to the bash script to fix this issue?

Thanks

edit retag flag offensive close merge delete