[Solved] Recommended solution to launch Graphic Programs via SSH

Greetings to all fellow Husarion community members,

I would like to kindly seek advice on solutions to…

“Launch graphic intensive programs (RViz) from the robot onto the remote computer via SSH”

Currently I am using X11 forwarding

ssh husarion@robot_name -X

I am able to launch simple operating system programs (leafpad) from the robot successfully.

However, when I tried to launch PlotJuggler or RViz

  • it takes more than a minute to launch
  • any actions applied on it, took a minute to be reflected

Based on what I have research, people mentioned X11 forwarding is not suitable for those kinds of programs.

Thus, I would like to know what is the recommended solution for it.

My Setup
Robot: ROSbot 2.0 pro
Remote computer: Running on Ubuntu 16.04 LTS dual-boot with Windows

Hi onezerofive,

I usually use Remmina Remote Desktop Client and it’s quite OK. Please check how to use manual and test it by yourself. I hope you will like it.

Best regards,
Hubert

Hi Hubert,

Thanks for the suggestion of Remmina.

However upon trying it, I receive the error message saying

unable to connect to VNC server

I have tried enabling the remote desktop sharing properties on my machine. But I am unsure about the remote robot side (Lubuntu)

Do you think this guide could be of use?
https://wiki.ubuntu.com/Lubuntu/RemoteDesktop

Hi onezerofive,

You have to edit file /etc/xrdp/startwm.sh. Open it and paste:

#!/bin/sh
# xrdp X session start script (c) 2015, 2017 mirabilos
# published under The MirOS Licence

if test -r /etc/profile; then
        . /etc/profile
fi

if test -r /etc/default/locale; then
        . /etc/default/locale
        test -z "${LANG+x}" || export LANG
        test -z "${LANGUAGE+x}" || export LANGUAGE
        test -z "${LC_ADDRESS+x}" || export LC_ADDRESS
        test -z "${LC_ALL+x}" || export LC_ALL
        test -z "${LC_COLLATE+x}" || export LC_COLLATE
        test -z "${LC_CTYPE+x}" || export LC_CTYPE
        test -z "${LC_IDENTIFICATION+x}" || export LC_IDENTIFICATION
        test -z "${LC_MEASUREMENT+x}" || export LC_MEASUREMENT
        test -z "${LC_MESSAGES+x}" || export LC_MESSAGES
        test -z "${LC_MONETARY+x}" || export LC_MONETARY
        test -z "${LC_NAME+x}" || export LC_NAME
        test -z "${LC_NUMERIC+x}" || export LC_NUMERIC
        test -z "${LC_PAPER+x}" || export LC_PAPER
        test -z "${LC_TELEPHONE+x}" || export LC_TELEPHONE
        test -z "${LC_TIME+x}" || export LC_TIME
        test -z "${LOCPATH+x}" || export LOCPATH
fi

if test -r /etc/profile; then
        . /etc/profile
fi

unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR
. $HOME/.profile

test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession

Save file and reboot device. Connecting to remote desktop should be already available.

Best regards,
Hubert

Hi Hubert,

Thank you the suggestion. Unfortunately that solution of modifying the .sh file didn’t work either.

I went and tried this approach too. But no success either

https://wiki.ubuntu.com/Lubuntu/RemoteDesktop

I am now suspecting, it could be the remote desktop side’s issue (my computer to the robot)

Remote computer setup: Ubuntu 16.04 LTS

Hi onezerofive,

May I ask you to run remote desktop using another computer?

Best regards,
Hubert

Hi buddy,

Not sure if you have solved your problem yet or not, but I have a quite simple solution for your issue.

What I understand is, you have Rosbot on your LAN (wifi probably) and you want to run rviz, or plotJuggler, to visulize the data being generated by your RosBot.

My solution: do NOT share screen via X-server or vnc etc. Its gonna be slow.

Subscribe to the same ROS master as your Rosbot is.

on your rosbot:
set the ROS_IP
export ROS_IP=xxx.yyy.zzz.qqq (the IP of your rosbot)
or
export ROS_IP=husarion.local (if your ROSbot is running avahi daemon)

On your remote system/desktop/laptop
set ROS_IP, following same steps as above, except use the IP of YOUR REMOTE system.

set ROS_MASTER_URI, to use the ROS Master of rosbot, instead of setting a new one.

export ROS_MASTER_URI=http://xxx.yyy.zzz.qqq:11311
replace ‘xxx.yyy.zzz.qqq’ with IP address of ROSbot or husarion.local if ROSbot is running avahi daemon.

Now you are ready to go. Now you can run Rviz or plot juggler on the terminal where you set ros master URI and ros ip, and it will use the ros core of ROSbot and output as if it rviz was running on rosbot itself.

Have fun. Let me know if you have any issues.

PS: you can get IP address by hostname -I (thats a capital i in the end)

Best
Puru Rastogi
puru@mowito.in

Puru_Rastogi,

Thank you for your suggestion. Your solution is very good if you are sure that you will not change your internet connection.

We suggest to use Husarnet in this type of use case. It’s VPN which allows you to connect devices over the Internet in ROS network using peer-to-peer technology.

Best regards,
Hubert