How to isolate topics of different uRTPS agent if I have multiplel instance

When simulating multiple vehicles with micrortps client activated, I end up having two micrortps agents running on different udp ports. Now, when I try to listen for a certain topic using ros2 topic echo <topic_name>, I end up getting the messages published to both micrortps agents. Similarly, if I create a ROS2 node with a subscriber to a certain topic, I get the messages coming from all the vehicles. How can I isolate messages coming on a certain udp port for a certain micrortps agent.

1 Like

We have an option to the agent to set the namespace for the topics: PX4-Autopilot/microRTPS_agent.cpp.em at master · PX4/PX4-Autopilot · GitHub

3 Likes