EricssonResearch / scott-eu

SCOTT – Secure Connected Trustable Things
https://scottproject.eu/uc04-logistics-management-using-collaborative-robots-and-devops-methodologies/
Apache License 2.0
20 stars 8 forks source link

Support running ROS in VM & VREP on the host #89

Closed berezovskyi closed 5 years ago

berezovskyi commented 6 years ago

The performance drop of running VREP in a VM is dramatic.

Plus the ROS plugin in VREP just connects to the ROS master, which can be exposed from VM via a VirtualBox host network.

berezovskyi commented 6 years ago

https://superuser.com/questions/144453/virtualbox-guest-os-accessing-local-server-on-host-os this is the other way around, how to access the host from the VM

berezovskyi commented 6 years ago

We have now a working connection to localhost:11311 forwarded to the VM running ROS via an SSH tunnel.

Now the issue is to cross-compile a ROS plugin, opened an issue in their repo: https://github.com/CoppeliaRobotics/v_repExtRosInterface/issues/28

Below are the instructions on how to open a tunnel. cc @likelion @albertohata @jramadeu @KRaizer @rssouza


Tunneling the localhost 11311 port to a VM

The ROS plugin in a V-REP has a hardcoded V-REP URL pointing to http://localhost:11311. V-REP cannot be 3D accelerated under a VM but ROS can only run under Ubuntu 16.04 (the one that supports Turtlebots). We mostly run Mac or Win on our machines.

Leo has suggested a very simple solution: use SSH to forward the ports via a tunnel:

 ssh 192.168.56.101 -L11311:localhost:11311

This command shall be executed under the host machine. In order for the VM to respond:

  1. The VM for running ROS shall have both the default NAT network I/F and a Host-only Adapter.
  2. roscore must be up and listening on port 11311.

NB! Remove and recreate the vboxnet0 I/F under Virtualbox if you are unable to ping the machine. Also, Ubuntu comes without an SSH server by default, so sudo apt-get install openssh-server might also be required.

berezovskyi commented 5 years ago

Putting this one on hold till the Gateway the implemented (see #121).