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

Select the desired port.

asked 2018-12-27 05:31:58 -0500

D0l0RES gravatar image

how to set a specific port (Ethernet) for publishing topics. I have 2 Ethernet ports, I want only one port to publish topics.

edit retag flag offensive close merge delete


@D0l0RES: please clarify why #q311530 is not a duplicate of this post.

gvdhoorn gravatar image gvdhoorn  ( 2018-12-27 08:38:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-27 06:25:26 -0500

This is a networking question more than it is a ROS question. The answer is it depends on your computer's network configuration.

ROS publishes data to the whole of the network it's connected to, so if both of the ethernet ports on your computer connect to different parts of the same network then messages could be published over both ports. However if your computer is connected to two different networks then you control which one ROS connects to using the ROS_IP or ROS_HOSTNAME environment variables as described here.

Hope this helps.

edit flag offensive delete link more


what if I have a need to publish data to different networks? it probably won't work like a belt one? or do you need to create several local areas in the global area and set network settings in them?

D0l0RES gravatar image D0l0RES  ( 2018-12-27 06:31:30 -0500 )edit

As far as I know ROS is only designed to work across a single network. There may be a solution with a VPN.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-12-27 06:49:56 -0500 )edit

I'm on this subject wrote the question

D0l0RES gravatar image D0l0RES  ( 2018-12-27 07:00:41 -0500 )edit

Question Tools

1 follower


Asked: 2018-12-27 05:31:58 -0500

Seen: 692 times

Last updated: Dec 27 '18