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:
In ardupilot/libraries/AP_DDS/AP_DDS_config.h, we have #ifndef AP_DDS_PARTICIPANT_NAME #define AP_DDS_PARTICIPANT_NAME “ap” #endif
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?
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)
I still managed to run multiple drones and control each of them individually but what I couldn’t get working due to all of them having the same namespace is passing each one its own external odometry as they currently all listen to the same /ap/tf topic.