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

How to properly configure system to remotely launch nodes

asked 2017-06-13 19:05:01 -0500

jayess gravatar image

updated 2017-06-13 21:13:50 -0500

I'm having trouble launching nodes remotely using launch files and need some help. Even using ssh keys roslaunch still cannot find the remote computer (despite it stating that it started the ssh session). I'm running Indigo with Ubuntu 14.04 on both my workstation computer and the computer aboard the robot, I'm not setting any parameters, and I don't have ROS_HOSTNAME set, only ROS_IP which is 192.168.1.103 for the workstation (master) and 192.168.1.212 for the robot. These are the steps that have been taken so far:

  1. Went through the ROS Network Setup Tutorial and made sure that the machines can ping each other and used netcat to check that communication over ports is possible.
  2. Create an RSA ssh key to make it possible to ssh into a machine without a password (and checked it).
  3. Used ssh -oHostKeyAlgorithms='ssh-rsa' host when making the first connection as shown in this answer
  4. Followed the example in the roslaunch machine tag wiki.
  5. Tried using the ROSLAUNCH_SSH_UNKNOWN environment variable
  6. Tried steps 4 and 5 with a DSA key, but still no luck.

The robot can still be sshed into and can have code run from there and everything works normally (can see data coming in from topics from the robot, etc.) so I don't think that it's a network issue (although it could be). It's just the launching using machine tags that doesn't work. Here's the test launch file (talker.launch) that I've been using:

<launch>
    <machine name="robot" user="ngcneuro" address="red2" default="true" env-loader="/opt/ros/indigo/env.sh"/>
    <node pkg="beginner_tutorials" name="talker" type="talker.py" machine="robot" />
</launch>

My package is called test_machine and here's what ROS master is telling me after running:

$ roslaunch test_machine talker.launch

... logging to /home/ngcneuro/.ros/log/7ce15492-50a4-11e7-8d3e-40167e358fbd/roslaunch-NGNeuromorphic1-14982.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.1.103:59087/
remote[red2-0] starting roslaunch
remote[red2-0]: creating ssh connection to red2:22, user[ngcneuro]
/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)
launching remote roslaunch child with command: [env ROS_MASTER_URI=http://192.168.1.103:11311 /opt/ros/indigo/env.sh roslaunch -c red2-0 -u http://192.168.1.103:59087/ --run_id 7ce15492-50a4-11e7-8d3e-40167e358fbd]
remote[red2-0]: ssh connection created

SUMMARY
========

PARAMETERS
 * /rosdistro: indigo
 * /rosversion: 1.11.21

MACHINES
 * robot

NODES
  /
    talker (beginner_tutorials/talker.py)

ROS_MASTER_URI=http://192.168.1.103:11311

core service [/rosout] found
^C[red2-0] killing on exit
^Cerror launching on [red2-0, uri http://robot:39508/]: Interrupted system call
Launch of the following nodes most likely failed: beginner_tutorials/talker.py
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-06-13 20:02:54 -0500

tfoote gravatar image

Your ssh connection is connecting.

I believe that your problem is that your robot's hostname is 'robot' and that is not resolvable on the robot.

[roslaunch][ERROR] 2017-06-13 16:09:14,455: error launching on [address-0, uri http://robot:47383/]: No route to host
[roslaunch][ERROR] 2017-06-13 16:09:14,456: Launch of the following nodes most likely failed: beginner_tutorials/talker.py

When you say that you checked that you could ping each other. Did you check that you can ping yourself?

ping `hostname`

You can create a custom env file on the robot that sets things like ROS_HOSTNAME as well as sourcing the setup.bash. Or you can resolve the hostname resolution.

edit flag offensive delete link more

Comments

I've tried the hostname with a number of different names (red, yellow, etc.) along with different names for the address and user and have had the exact same results. I can also ping myself as well.

jayess gravatar image jayess  ( 2017-06-13 20:17:15 -0500 )edit

Can you explain what you mean by red and yellow? Can you provide a non-sanitized output? One of the machines cannot ping itself. And remember that when you ssh like this you don't get your ~/.bashrc.

ssh user@address ping \`hostname\`
ssh user@address ping robot
tfoote gravatar image tfoote  ( 2017-06-13 20:34:46 -0500 )edit

red and yellow are just names I have in my hosts file that I use to map to IP addresses within my network (based on the color of the robot). I was able to ping back and forth before so I never tried what you suggested. I pinged myself as you suggested and I get connect: Network is unreachable

jayess gravatar image jayess  ( 2017-06-13 20:40:33 -0500 )edit

Disregard the last comment. I had a misspelling in my command. I can ping myself without any problems.

jayess gravatar image jayess  ( 2017-06-13 20:42:43 -0500 )edit

Please provide the actual outputs from the commands you run with all the variations. Without that I can't do much to help you. You can edit your question to add more details. Share what are your hostnames, what's in /etc/hosts? What are the parameters your setting?Otherwise I can't help you debug.

tfoote gravatar image tfoote  ( 2017-06-13 20:58:34 -0500 )edit

Thanks for the update. As you can see the error is that it's still trying to contact robot You mention that you're setting ROS_IP, but you're using the stock indigo/env.sh You either need to change the hostname to or create a custom env script which will set the ROS_IP on the remote machine.

tfoote gravatar image tfoote  ( 2017-06-13 21:26:38 -0500 )edit

Thank you very much for patiently walking me through all of this, it's now working. I did what you said: created a script to set the ROS_IP and ROS_MASTER_URI on the remote machine and sources the devel/setup.bash script.

jayess gravatar image jayess  ( 2017-06-14 14:09:49 -0500 )edit

Funny thing that's happening now is that after I stop the launch file (using Ctrl-C ) I can see that the nodes are still running by using rosnode list and I can't start up another roscore/master as it says that one is still running despite me not seeing one running in my terminal.

jayess gravatar image jayess  ( 2017-06-14 14:12:14 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2017-06-13 19:05:01 -0500

Seen: 6,817 times

Last updated: Jun 13 '17