0
$\begingroup$

Rosanswers logo

Hello everyone. I am trying to run nodes on multiple machines, run a "talker" node on a machine called "hxj" and a "listenner" node on a machine called "lili"(the talker and listener nodes are from the tutorials). I want to see the output of listener on the screen, I add a launch-prefix attribute for the node "listener", so I wrote my launch file like this:

<launch>
<machine name="hxj" address="hxj-ideapad.local" user="hxj" env-loader="/opt/ros/indigo/mine_env.sh" default="true"/>    
<machine name="lili" address="lili-pc.local" user="lili" env-loader="/opt/ros/indigo/mine_env.sh" default="true"/>  
<node pkg="beginner_tutorials" name="talker" type="talker" machine="hxj">
</node>
<node pkg="beginner_tutorials" name="listener" type="listener" machine="lili" output="screen" launch-prefix="xterm -e"/>   
</launch>

And I got an error like this:

[lili-pc.local-0]: ... done launching nodes
[lili-pc.local-0]: [listener-1] process has died [pid 3779, exit code 1, cmd xterm -e /home/lili/catkin_ws/deve/lib/beginner_tutorials/listener __name:=listener __log:=/home/lili/.ros/log/a0ecf616-5732-11e4-ad32-8ca982b606e6/listener-1.log].
log file: /home/lili/.ros/log/a0ecf616-5732-11e4-ad32-8ca982b606e6/listener-1*.log
[lili-pc.local-0]: all processes on machine have died, roslaunch will exit
remote[lili-pc.local-0]: xterm: Xt error: Can't open display: 
xterm: DISPLAY is not set

I googled this error, the problem may be that it is not allowed to open a window through ssh, I tried to modified the configuration file of sshd /etc/ssh/sshd_config, but cannot find the corresponding variable. Who can give me any advice?


Originally posted by kristpan on ROS Answers with karma: 1 on 2014-10-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If you were doing this normally, you would ssh to your remote machine with ssh -X to enable X forwarding, and then any graphical programs that run remotely would be displayed locally.

Since roslaunch is running ssh for you as part of the launch process, you'll need to find a way to pass the -X flag to the ssh client. There don't appear to be any command-line arguments to roslaunch that do this.

It looks like you can edit your ~/.ssh/config to include the ForwardX11 option to automatically turn on X forwarding. See: http://linux.die.net/man/5/ssh_config

A section like this in your SSH config should turn it on for only the remote host you're interested in:

Host lili-pc.local
ForwardX11 yes

Originally posted by ahendrix with karma: 47576 on 2014-10-19

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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