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

Cannot open a xterm on a remote machine through ssh

asked 2014-10-18 23:59:03 -0600

kristpan gravatar image

updated 2014-10-19 00:06:42 -0600

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-10-19 00:50:20 -0600

ahendrix gravatar image

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
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-10-18 23:59:03 -0600

Seen: 1,350 times

Last updated: Oct 19 '14