When I was running two drones at the same time in a multi-vehicle simulation, and sending the same position to both drones in offboard mode, both positions were the same in the vehicle_local_position topic, but it was obvious in gazebo that one drone was high and one drone was low. When turning on multiple drones, a warning is prompted:
What do your model and world .sdf files look like?
Can the issue you’re talking about be solved by adding a reference link at the start of the model (mentioned in my last post here)? The positions seem to be taken relative to the first link in the world and thus if your first link is a drone, the reference position will move, giving strange results.
Following the method of opening multiple vehicles under the official documentation, I found that this problem also exists, and may have nothing to do with the nested model. However, after consulting the official px4 ekf documentation, I reset the following parameters under the PX4-Autopilot/src/module folder EKF2_MULTI_IMU = 2, EKF2_MULTI_MAG = 2, SENS_IMU_MODE = 0, SENS_MAG _MODE = 0. After making px4_sitl, I found that ekf is still losing data when opening the second px4.
How do you run the srcond drone ? Make sure you are assigning different mavlink id and node id to each one otherwise comamnds and packets might be conflicted
You can dohble check it by checkjng the rate of hear beat message receiving be exactly one (means no packets are conflicting)
I found that when I change the parameters inside the src/modules/sensers/senser_params_mag.c file and make px4_sitl , it doesn’t change the parameters. I would like to know where to add a parameter file like senser_params_mag.c to the cmake file.
Had simillar problem that parametes would be overwritten
If i am not msitaken, you should go to build folder init.d and look for rcs file . In that you can use command " set param " for your parameters