0
$\begingroup$

Rosanswers logo

Please I am connecting Simulink(matlab 2017a) to the ROS Network deployed in a Virtual Machine- Ubunt 14.04 in my PC, I can see all the nodes, topics, etc. However from Simulink I can not subscribe to the topics sent by the virtual machine. I can subscribe and view the topics sent by Simulink from the virtual machine. Thank you so much


[Originally posted](https://answers.ros.org/question/304028/connection-problem-simulink-(matlab-2017a---ros-network-in-virtual-machine(ubuntu-14.14)/) by roberto on ROS Answers with karma: 3 on 2018-09-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If you're using a VM, you'll have to review the networking configuration it uses.

If it's using NAT, connecting to processes running inside the VM will not be possible without (extensive) port forwarding. With an application that uses dynamically chosen ports (ie: random), then forwarding will be difficult to setup correctly. All your ROS nodes use random ports (well, from a certain range, but still random enough).

If you're running this on a machine in an unmanaged network (ie: at home, or in a really small company with no IT policy/department), you may get away with using bridged networking between the host and the VM. Your VM will get a "real" IP address, allowing it to communicate with all other hosts on your network, as-if it was a real computer.

If you're in a company (that has strict networking policies) or don't want to give your VM an IP from your physical network, then try to use host only networking. It is like bridging, but only within your own computer.


Note that after you have all of this setup, you need to make sure ROS (and Ubuntu) in the VM are properly configured for a multi-machine setup. See wiki/ROS/NetworkSetup for a start with that, or one of the myriad of questions here on ROS Answers about setting up Matlab for use with ROS (use Google: matlab ros_ip ros_hostname site:answers.ros.org).


Originally posted by gvdhoorn with karma: 86574 on 2018-09-24

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by roberto on 2018-09-25:
Thanks a lot for your replying, it was so useful. Now, based on your suggestions, it is working well under the host only networking. I was using bridge networking in an unmanaged network and also trying with NAT, Thanks,

$\endgroup$

Your Answer

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