Ask Your Question
1

ROS2 communication between Raspberry and host

asked 2020-12-18 04:08:45 -0600

rostyv gravatar image

Hi all, here's my problem. I want to have a communication with ROS2 between my Raspberry and my PC in order to run one node on my computer and another one on the raspberry. The Raspberry has IP 192.168.8.55 and my computer has IP 192.168.25.101 and they can't be modified (for job reasons). They can communicate because I've tried a ping on both machines and it's ok and I can also have SSH access on my Raspberry but when I try to launch two nodes in the two machines they cannot communicate. How can I solve it? Thanks in advance .

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-02-04 18:10:03 -0600

sloretz gravatar image

They can communicate because I've tried a ping on both machines and it's ok and I can also have SSH access on my Raspberry but when I try to launch two nodes in the two machines they cannot communicate. How can I solve it? Thanks in advance .

There are a few reasons that pinging between the two machines could work while ROS 2 communication does not. Here are a few checks to try. You might also be interested in this ROS 2 troubleshooting guide.

Is ROS_DOMAIN_ID the same?

ROS 2 nodes can use the ROS_DOMAIN_ID environment variable to intentionally separate traffic. If one machine has ROS_DOMAIN_ID set, or if they're set to different values then ROS 2 nodes from each won't communicate with each other.

$ echo $ROS_DOMAIN_ID

It's ok if this variable is empty. If the output of the above command is different on each machine, then ROS 2 nodes won't communicate.

Is RMW_IMPLEMENTATION the same or compatible?

ROS 2 allows you to choose different middlewares for communication between nodes.

echo $RMW_IMPLEMENTATION

It's ok if this variable is empty. If the output on each machine is different, then the machines may not communicate with each other. I don't know of any documentation about which RMW implementations are compatible, but you can get a sense for what's expected to work from what's tested in the test_communication packages from the system_tests repo.

Is ROS_DISTRO the same?

ROS distributions aren't guaranteed to communicate with each other. A machine using ROS Foxy definitely won't communicate with one using ROS Ardent. You can check which is which by the path that you use to source your ROS installation

. /opt/ros/<rosdistro/setup.bash

Or if your installation is already sourced, you can check the ROS_DISTRO environment variable.

$ echo ROS_DISTRO

Does multicast communication work?

It sounds like the network these to machines are on is closely administrated. The default RMW implementation uses multicast traffic. Maybe the administrators have disabled multicast? There's a tool called ros2multicast that can check this. Run the receive command on one machine, and the send command on the other. If multicast traffic can't be sent across the network the machines are on, then the machines won't be able to communicate.

Here's what it should look like on two machines that can communicate:

$ ros2 multicast send
Sending one UDP multicast datagram...

And on the receving machine

$ ros2 multicast receive
Waiting for UDP multicast datagram...
Received from 192.168.1.150:53070: 'Hello World!'

If this doesn't work, it may be worth asking your network administrator, or asking the RMW implementation vendor you're using if there are any vendor specific settings that can be set for your use case.

edit flag offensive delete link more
0

answered 2020-12-18 13:12:52 -0600

kscottz gravatar image

Read up on ROS Master URI. The ROS Master URI indicates which computer is running the master ROS processes.

edit flag offensive delete link more

Comments

1

I thought ROS2 does not have a Master process anymore..

sabin gravatar image sabin  ( 2021-02-02 10:24:19 -0600 )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

3 followers

Stats

Asked: 2020-12-18 04:08:45 -0600

Seen: 257 times

Last updated: Feb 04