0
$\begingroup$

Rosanswers logo

hi, I am using indigo in ubuntu14.04.2. I am trying to connect my desktop computer(zyq.local) and another computer(thinker.local). I can ping them from each one, and I have set the hostname and host_master_uri like this: in my desktop computer:

export ROS_HOSTNAME=zyq.local
export ROS_MASTER_URI=http://thinker.local:11311

in another:

export ROS_HOSTNAME=thinker.local

then I login the robot computer through ssh

ssh thinker.local -l think
roscore &
roslaunch rbx1_bringup fake_pi_robot.launch

after this I open another terminal in my desktop computer an connect robot computer again

ssh thinker.local -l think
rosrun rviz rviz -d `rospack find rbx1_nav`/sim.rviz

now error occurs:rviz: cannot connect to X server I do not why, two computers can ping each other. Thanks.


Originally posted by yongqi on ROS Answers with karma: 39 on 2016-06-13

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

By default a ssh connection does not allow any graphical interface to be displayed. To allow this you have to add the -X argument to the connection.

It should be something like

ssh -X thinker.local -l think

Then you will be able to open any GUI.

Regards,


Originally posted by Mario Garzon with karma: 802 on 2016-06-13

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by yongqi on 2016-06-13:
thanks, it works.I have another question.When I control the robot through desktop computer without ssh like thiszyq@zyq:~$ rosrun rviz rviz -d rospack find rbx1_nav/sim.rviz, it told me [rospack] Error: package 'rbx1_nav' not found. But I have set the HOSTNAME and URI, what should I do thanks

Comment by Mario Garzon on 2016-06-13:
This is because probably you don't have the rbx1_nav package on your desktop computer. Maybe just run rviz rosrun rviz rviz and then add the displays manually

Comment by yongqi on 2016-06-13:
no, I don't have this package. But I have it in my robot computer, I want to add the displays manually on my desktop computer while don't use ssh. Can this be achieved? If not, I don't know what is the HOST_MASTER_URI used for(I have set it http://thinker.local:11311). Thanks very much.

Comment by Mario Garzon on 2016-06-14:
Yes, you can manually add the displays in your desktop computer. The ROS_MASTER_URI variable is used to tell ROS that the roscore is running on your robot computer, and therefore being able to read the topics on that computer.

Comment by yongqi on 2016-06-14:
Thanks a lot

Comment by Dhuzi on 2023-03-29:
hello,I have got the same issue, and after I used the command 'ssh -X .....', the issue was still here. What could be the issue ? Can you please help me?

$\endgroup$
0
$\begingroup$

Rosanswers logo

You forgot to enable X11 Forwarding. Try to use

ssh -X thinker.local -l think
rosrun rviz rviz -d `rospack find rbx1_nav`/sim.rviz

Note: -X (upper case) enables X11 Forwarding whereas -x (lower case) disables it.


Originally posted by JohnDoe2991 with karma: 305 on 2016-06-13

This answer was NOT 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.