[ROS2] Communication across multiple local users
Is there a way of communicating between 2 ROS2 processes/nodes on the same machine but being run as 2 different users?
My specific use case is one process/node run as root (for interfacing with a piece of hardware) and one as a regular user.
However, the two nodes cannot seem to communicate with each other or even 'see' each other, as in: the node nor its topics are not visible via ros2 node list
/ros2 topic list
.
I've narrowed it down to two nodes running as different users on the same machine - I've spun up a fresh Ubuntu 20.04 Server VM (linux 5.4.0, x86_64), installed ROS2 Foxy, added 2 users and confirmed that ros2 run demo_nodes_cpp talker
does not communicate with ros2 run demo_nodes_cpp listener
(across different users - running as one user works as expected).
The same test on a Ubuntu 18.04 & ROS2 Eloquent box works as expected, ie the listener receives messages from the talker...
What's peculiar, the /rosout
topic on one user shows the logs printed by the node run as the other one (or at least some, I wasn't able to replicate this with the demo/example nodes - perhaps due to log severity being too low).
I've verified that the multicast test (ros2 multicast send/receive
) between the users passes successfully.
I don't have a solution but can confirm the problem. But first investigation shows, that the behaviour depends on the existence of a network connection. Without any connected network topics can be seen.