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

Why does this launch file fail to start node on remote machine ?

asked 2019-03-19 22:43:10 -0500

elpidiovaldez gravatar image

I am trying to launch a node on a Raspberry Pi, called thalia from a desktop machine, called clio. I have spent many nights on this, but still cannot get it to work.

clio runs lubuntu 18.04 and melodic.

thalia runs lubuntu 16.04 and kinetic

My launch file is:

<launch>
  <machine
    name="thalia"
    address="thalia"
    env-loader="/home/paul/catkin_ws/devel/setup.sh"
    password="mypassword"
  />

  <node
    machine="thalia"
    name="PiServoNode"
    pkg="servos"
    type="ServoNode"
  />
</launch>

The command following command successfully launches a node when run on thalia:

rosrun servos ServoNode

I spent some time setting up thalia and clio so that I could ssh without a password bidirectionally. The method I used to do this involves creating an RSA key and copying it to the other machine (method given here ssh setup). However when I used the launch file I got an error saying the machine was not in known hosts. I found this explanation:

Roslaunch uses paramiko to create ssh connections, and it seems that paramiko still does not support the ecdsa algorithm, used now as default by last ssh, so it can't read from the known_hosts file generated with ecdsa and can't create the remote connections. full article

(kind of wish they had led with that !) I have not been able to get ssh to work without passwords using the solution given. I don't know if that is the root of the problem or not.

So I added a password to the machine definition in the launch file. This seems to allow a connection from clio to thalia, but the node still fails to launch. The log file is:

pastebin link

Any help will be appreciated as I am now out of ideas.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-03-19 23:27:14 -0500

ahendrix gravatar image

updated 2019-03-19 23:31:28 -0500

It looks like your env loader is not set properly. You cannot use the setup.sh as the env loader. You must use a special script which sets the environment and then executes the command that was given to it. http://wiki.ros.org/roslaunch/XML/mac... describes the env loader in more detail.

catkin creates an env loader for you in your workspace, instead of setup.sh it's called env.sh.

You can use it with:

<launch>
  <machine
    name="thalia"
    address="thalia"
    env-loader="/home/paul/catkin_ws/devel/env.sh"
    password="mypassword"
  />

  <node
    machine="thalia"
    name="PiServoNode"
    pkg="servos"
    type="ServoNode"
  />
</launch>

I am less familiar with the paramiko issue, but you should be able to add an option to your ssh config which uses the older hash algorithm for that host.

EDIT

I did a quick experiment with my local ssh config, and confirmed that adding the following to my ~/.ssh/config sets the correct hash algorithm for a single remote machine:

Host thalia
HostKeyAlgorithms ssh-rsa

(You can also omit the Host line just put HostKeyAlgorithms ssh-rsa at the top of the file to apply it to all hosts that you connect to)

edit flag offensive delete link more

Comments

Both of your suggestions worked perfectly ! Thank you very much. You have ended days of struggling. Though I am kicking myself about the env.sh vs setup.sh issue. I know that I tried env.sh unsuccessfully, but it was probably while the paramiko ssh problem was still breaking things.

elpidiovaldez gravatar image elpidiovaldez  ( 2019-03-20 20:00:51 -0500 )edit

I have returned here after nearly 2 years, as I have the same problem. Now I am using Lubuntu 20.04. The technique using ~/.ssh/config now does not work. I finally found that I have to convert the id_rsa file with this command: ssh-keygen -p -m PEM -f ~/.ssh/id_rsa (this is discussed in https://stackoverflow.com/questions/5...)

elpidiovaldez gravatar image elpidiovaldez  ( 2021-02-26 12:56:55 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-03-19 22:43:10 -0500

Seen: 587 times

Last updated: Mar 19 '19