I’m trying to create a model for two physically connected drones. I understand that in order for the two drones to interact with each other, they have to be in the same sdf model file, which I have done. However, I also want both drones to be able to fly independently and have their own instance of px4, but whenever I do this, both drones get directed to the same px4 instance, regardless of how I set the mavlink udp id’s in the sdf file. I thought maybe using nested models in the sdf would work better, but px4 is unable to find the models at all now, probably because each nested model now has its sensors in a different hierarchy than what is normally expected by px4. I was wondering if this kind of model is possible to create at all. I am using gazebo-classic and on the main branch of px4-autopilot. I attached screenshots to show how I have organized things so far.
Edit: I noticed the issue is with gps, and nesting the model creates problems with the px4 connection to the gps, resulting in the position estimate error. It seems like it is only the gps sensor because for some reason it is its own model that is included in all drone models, while the other sensors are usually built in. I believe this is the source of the problem. If someone could give me some pointers on how to work around this gps problem, that would be great.