lopsided98 / nix-ros-overlay

ROS overlay for the Nix package manager
Apache License 2.0
173 stars 69 forks source link

ros2 node service can't communicate with non services ros2 node #333

Open realsnick opened 7 months ago

realsnick commented 7 months ago

Hi,

I have the talker runs as a service and publish messages via the code:

{ pkgs, ... }:
{
    services.ros2 = {
    enable = true;
    distro = "iron";
    domainId = 0;

  nodes = {
    talker = {
      package = "demo_nodes_cpp";
      node = "talker";
    };
  };  
}

problem is when i run nix develop .#iron.demo_nodes_cpp and run the listener

ros2 run demo_nodes_cpp listener

the listener does not receive any messages...

the listener will start receiving message when i either run the talker with ros2 run or if i run the listener as a service like i do with the talker above...very strange behavior

lopsided98 commented 7 months ago

This happens because the services are running as the ros user. I think it has something to do with shared memory fallback not working correctly, but it has been a while since I looked into it.

realsnick commented 7 months ago

could it be related to this?

https://github.com/ros2/rclcpp/pull/2335 ? the new version of iron has this fix.

if not, any pointers on how to fix it?