ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How to specify the network interface ros2 uses for communication?

asked 2021-03-02 10:39:00 -0500

Hakaishin gravatar image

When I launch my node, after installing a docker image, I get following warning, luckily it arbitrarily selects the right interface, but how can I specify it to get rid of the warning? [od-1] 1614701696.982410 [0] od: using network interface eno1 (udp/ selected arbitrarily from: eno1, docker0, br-ab6309382a59, tun0I'm using Ros2 build from source master and ros2 branches. I found: and I was wondering if this applies in my case? I didn't find much information and before reading the extensive fast dds api to figure out how to set it, I ask here to make sure, this would even be a solution to my problem and if there is a new(set it directly by ros2) way to specify the network instead of going and fiddling with the default implementation.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-04-07 06:16:11 -0500

Hakaishin gravatar image

Create a file like this: example.xml and launch the node with following command: FASTRTPS_DEFAULT_PROFILES_FILE=<path/to/xml/example.xml> RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 launch my_node file.launch

<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="">
    <participant profile_name="CustomUDPTransportParticipant">
edit flag offensive delete link more


Hi, I tried your proposed solution, but it does not not send the data over the specified interface. Do we have to change something inside the pub/sub code?

omair50 gravatar image omair50  ( 2021-05-10 04:11:40 -0500 )edit

No, that was all that was needed for me

Hakaishin gravatar image Hakaishin  ( 2021-08-25 02:53:14 -0500 )edit

thanks very very much. I was using docker with ros2 (Ardupilot's SITL + mavros2 + ros2 in docker and my own script from the host! ) and I was really really confused by its behavior. I could send my messages with rqt and command line but my scripts wouldn't work. it took me about 2-3 days until I realized it's not my script's bug, QoS mismatch, docker's network bad config, mavros/mavlink bad behavior, etc! and suddenly solved everything!

antonyramsy gravatar image antonyramsy  ( 2022-02-05 08:00:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-03-02 10:39:00 -0500

Seen: 3,186 times

Last updated: Apr 07 '21