eProsima / Micro-XRCE-DDS-Agent

Micro XRCE-DDS Agent respository. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
113 stars 81 forks source link

Multiple agents #309

Closed TreeGrow closed 2 years ago

TreeGrow commented 2 years ago

Hi,When there are multiple agents and each agent has only different IP, how to distinguish the connection in the network of ros2. What parameters or settings should the agent add or change the settings of ros2?

pablogs9 commented 2 years ago

Could you explain better the issue?

TreeGrow commented 2 years ago

Sorry, maybe I didn't make it clear. Problems encountered: I have multiple micro xrce DDS agents in the same network segment. They communicate with ros2 and encounter problems when sending and listening to ros2. When ros2 publishes a message, micro xrce DDS starts subscription, and multiple agents will receive messages at this time. Is there any way to specify a specific proxy subscription?

pablogs9 commented 2 years ago

Well, DDS uses the publication/subscription paradigm where the data produced by one publisher will reach all the subscribers that match the publisher.

I'm not sure if I have understood well your question. Could you expose a use case and a demo where we can reproduce your problem?

TreeGrow commented 2 years ago

Yes, DDS network, sharing publishers and subscribers. Now I need to limit this sharing. I want to use ros2 for specific users

Micro xrce DDS agent node, publish and subscribe, and other nodes are not affected.

TreeGrow commented 2 years ago

For example, I have three robots. They are detected by ros2 through micro xrce DDS agent. When ros2 releases a message, the three robots will receive the same ros2. When I only want one of them to receive it. Are there any restrictions in this regard? Right IP? Or the domain of ros2? I don't quite understand this aspect. Thank you for your reply.

TreeGrow commented 2 years ago

What I learned can be achieved through ROS DOMAIN ID is restricted. How can I find the registered ROS DOMAIN ID to avoid duplication. PC1 open micro xrce DDS agent: 1649727957

PC1 open ros2-android: Screenshot_20220412_094941

PC2 open micro xrce DDS PublishHelloWorld: 1649728088

PC2 Vm ubuntu20.04 open publication and subscription : 7d01ec80d284474a1e7f35ea2d41af4

pablogs9 commented 2 years ago

On the ROS 2 side, as you can see in the documentation, the domain id can be configured by setting the environment variable DOMAIN_ID to the desired value. In XRCE-DDS, as stated in the documentation, each participant creatin API has a domain argument for setting this value.

I'm closing, please reopen if you have further questions.

TreeGrow commented 2 years ago

Thank you. It's very useful to me