ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Connection Problem Simulink (matlab 2017a - ROS Network in Virtual Machine(Ubuntu 14.14)

asked 2018-09-23 06:19:17 -0500

roberto gravatar image

updated 2022-02-22 11:23:38 -0500

lucasw gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-09-24 01:51:40 -0500

gvdhoorn gravatar image

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).

edit flag offensive delete link more

Comments

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,

roberto gravatar image roberto  ( 2018-09-25 03:44:35 -0500 )edit

Question Tools

Stats

Asked: 2018-09-23 06:19:17 -0500

Seen: 419 times

Last updated: Sep 24 '18