Ask Your Question
3

How can I launch rviz on a remote machine ?

asked 2016-10-04 21:19:19 -0500

elpidiovaldez gravatar image

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=:0in 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 ?

edit retag flag offensive close merge delete

Comments

I would also like to know an answer to this. I tried both setting the display and the -X option when I ssh in.

shoemakerlevy9 gravatar image shoemakerlevy9  ( 2016-12-05 11:12:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-10-05 04:03:51 -0500

rastaxe gravatar image

Try ssh fred@thetis -X

edit flag offensive delete link more

Comments

1

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.

elpidiovaldez gravatar image elpidiovaldez  ( 2016-10-05 23:20:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2016-10-04 21:19:19 -0500

Seen: 2,790 times

Last updated: Oct 05 '16