0
$\begingroup$

Rosanswers logo

I have a launch file that is meant to kick off freenect on a robot(zen) and rviz on a desktop computer(thetis). I understand that rviz is graphical and needs to use thetis' screen. After some googling I discovered a recommendation saying that I could do this by placing export DISPLAY=:0 in my env.sh file (on thetis). Sadly it does not work.

The launch file starts promisingly and produces:

started roslaunch server http://zen:40724/
remote[thetis-0] starting roslaunch
remote[thetis-0]: creating ssh connection to thetis:22, user[paul]
launching remote roslaunch child with command: [env ROS_MASTER_URI=http://zen:11311 /opt/ros/kinetic/env.sh   roslaunch -c thetis-0 -u http://zen:40724/ --run_id d0af37a2-8a9c-11e6-9197-247703b09b04]
remote[thetis-0]: ssh connection created

But later it reports:

[thetis-0]: [Zen-1] process has died [pid 8018, exit code -6, cmd /opt/ros/kinetic/lib/rviz/rviz __name:=Zen __log:=/home/paul/.ros/log/d0af37a2-8a9c-11e6-9197-247703b09b04/Zen-1.log].
log file: /home/paul/.ros/log/d0af37a2-8a9c-11e6-9197-247703b09b04/Zen-1*.log
[thetis-0]: all processes on machine have died, roslaunch will exit
remote[thetis-0]: QXcbConnection: Could not connect to display 
[Zen-1] process has died [pid 8018, exit code -6, cmd /opt/ros/kinetic/lib/rviz/rviz __name:=Zen __log:=/home/paul/.ros/log/d0af37a2-8a9c-11e6-9197-247703b09b04/Zen-1.log].
log file: /home/paul/.ros/log/d0af37a2-8a9c-11e6-9197-247703b09b04/Zen-1*.log

My launch file is:

<launch>
  <machine name="thetisx" address="thetis" env-loader="/opt/ros/kinetic/env.sh" user="fred"/>

  <include file="$(find freenect_launch)/launch/freenect.launch"/>

  <node machine="thetisx" pkg="rviz" type="rviz" name="Zen" output="screen">
  </node>

</launch>

Doing some investigation, I discovered that if, from zen, I do:

ssh fred@thetis
password: *****
rosrun rviz rviz

I get a failure and core dump saying QXcbConnection: Could not connect to display

However if I do:

ssh fred@thetis
password: *****
export DISPLAY=:0
rosrun rviz rviz

then rviz successfully appears on the remote machine.

So why does putting export DISPLAY=:0 in the env.sh file not work and how can I launch rviz remotely ?


Originally posted by elpidiovaldez on ROS Answers with karma: 142 on 2016-10-04

Post score: 3


Original comments

Comment by shoemakerlevy9 on 2016-12-05:
I would also like to know an answer to this. I tried both setting the display and the -X option when I ssh in.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Try ssh fred@thetis -X


Originally posted by rastaxe with karma: 620 on 2016-10-05

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by elpidiovaldez on 2016-10-05:
Thanks, but -X makes no difference. The crucial thing is to set DISPLAY. I already know how to run rviz remotely via ssh. I want to run it remotely from a launch file. That should work by setting DISPLAY in the env.sh for the remote machine, but it doesn't.

$\endgroup$

Your Answer

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