0
$\begingroup$

Rosanswers logo

Hi everybody,

I am experiencing a weird problem with ROS2 foxy. Basically I have one machine that is not able to commuinate over ROS2 with others on the same network.

Let me give you some details:

MACHINE 1 (the one with the problem) Laptop DELL Ubuntu 20.04 LTS ROS2 Foxy

MACHINE 2 (this one is able to communicate with others in the same network but not with MACHINE 1) Laptop DELL Ubuntu 18.04 LTS ROS2 Foxy

Machine 1 cannot discover topic being published, and if it publish I cannot see the topics being published on Machine2(or any other machine)

I am able to ping M1 from M2 and viceversa, ROS_DOMAIN_ID is not set and even if I set it, that does not solve the problem. I would exclude that the porblem is because of the mismatch of two OS, in fact I have other machines with Ubuntu 20.024 able to communicate over ros topics.

Anybody has any clue on what's going on here?

I already tried to uninstall and reinstall ROS, that did not fix the issue


Originally posted by Mrmara on ROS Answers with karma: 71 on 2021-09-23

Post score: 1


Original comments

Comment by Ranjit Kathiriya on 2021-09-23:
Can you please! provide all steps you have followed. Thanks

Comment by Mrmara on 2021-09-23:
I am not sure what do you mean with all the steps I have followed. I publish a topic with ros2 topic pub /topicXYZ msg_type (e.g. ros2 topic pub /asdfg nav_msgs/msg/Path) and on the other machine I use ros2 topic echo /topicXYZ (e.g. ros2 topic echo /asdfg)

Comment by Ranjit Kathiriya on 2021-09-23:
I was telling you about configuration steps, Do you have /topicXYZ msg file in other machines? If no then I would suggest to add the following msg file and build a package and try.

Comment by Mrmara on 2021-09-23:
That message type is installed in both machines

Comment by Ranjit Kathiriya on 2021-09-23:
Main Pc:

export ROS_MASTER_URI=http://url:11311/
export ROS_HOSTNAME=192.168.1.1
export ROS_IP=192.168.1.1

Second Pc:

export ROS_MASTER_URI=http://192.168.1.1:11311/    # Ip address of 1 PC
export ROS_HOSTNAME=192.168.1.2
export ROS_IP=192.168.1.2

This was my configuration while connecting 2 PC.

You have to include this in your bashrc file.

Comment by Mrmara on 2021-09-23:
Thank you for your support and time but the problem was the firewall, sudo ufw disable solved the issue

Comment by Ranjit Kathiriya on 2021-09-23:
make it an answer and tick it.

Comment by Per Edwardsson on 2021-09-23:
ROS2 does not use any of those environment variables to connect.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It turned out to be a firewall issue.

sudo ufw disable

made the magic


Originally posted by Mrmara with karma: 71 on 2021-09-23

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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