Multiple copters but both micro-ros-agents creating two /ap nodes

Hi all,

My setup is: ros2 Humble + Gazebo Harmonic + Ardupilot + Mavros.
I created two ardupilot_sitl instances to simulate two copters in Gazebo. When it comes to micro-ros-agents, they both create two nodes with same name /ap. I could observe the following:

  1. In ardupilot/libraries/AP_DDS/AP_DDS_config.h, we have
    #ifndef AP_DDS_PARTICIPANT_NAME
    #define AP_DDS_PARTICIPANT_NAME “ap”
    #endif

  2. In ardupilot/libraries/AP_DDS/AP_DDS_Client.cpp, we have
    bool AP_DDS_Client::create()
    {
    WITH_SEMAPHORE(csem);
    // Participant
    const uxrObjectId participant_id = {
    .id = 0x01,
    .type = UXR_PARTICIPANT_ID
    };
    const char* participant_name = AP_DDS_PARTICIPANT_NAME;

So, is it hard coded? Can’t we have two namespaces to create two nodes such as /drone_1/ap and /drone_2/ap?

Thank you.

I’m facing the same issue for my multiagent simulation setup. Also micro-ROS-Agent doesn’t support namespacing yet A way to set a ROS namespace in the Agent · Issue #126 · micro-ROS/micro-ROS-Agent · GitHub.

Related issue: Not possible to do multiagent simulation with external odometry · Issue #140 · ArduPilot/ardupilot_gazebo · GitHub

I am also facing the same problem. PX4 has this target_system property to allow for controlling the desired drone rather than all of them. The issue I am facing is services are arming all drones, and send the same way points. I want to send different commands to the different drones. NeitherROS_DOMAIN_ID nor DDS_DOMAIN_ID seems to work. I also tried remapping the topic names from micro_ros but also does not work. Is there any such functionality in Ardupilot or any suggestions for how to proceed? Multi-Vehicle Simulation with ROS 2 | PX4 Guide (v1.15)