Servers by jDrones

Regarding the swarming Simulation with Morse

General

I’m trying to simulate the swarming flight using 5 SITL with Morse following official document.

It has been successful to launch 5 SITL instances and connect to the MavProxy instance on a one-to-one basis. If I use MavProxy / SITL without using Morse as a simulator and issue Arm / Takeoff command for each of the 5 SITL instances, all drones will take off.

What I’m not clear is that when I use MavProxy / SITL / Morse, the Arm command succeeds only on the last connected SITL instance, but other drones violate the Prearm check and cannot Arm.

Steps to reproduce

  1. Launch the Morse / Generate 5 SITL instances morse run copter_swarm/copters.py
    sh copter_swarm/start_copters_tcp.sh

    copter_swarm/copters.py is based on rover_follow.py and quadcopter.py, with the Rover description replaced by the QuadCopter one

    copter_swarm/start_copters_tcp.sh is based on start_fllow.sh.
    It replaces the parm file and configuration with Copter’s and executes all sitl in a for block.
    Sitl execute command: build/sitl/bin/arducopter -S --model "morse-quad:127.0.0.1:$port1:$port2" --speedup 1 --instance $(expr $i - 1) --defaults Tools/autotest/default_params/copter.parm &
    The morse-quad’s port is shifted by 2 for each instance like 60000:60001, 60002:60003…

5 drones are generated in Morse

  1. Open 5 consoles and run mavproxy instance on each consoles. mavproxonsole --out=127.0.0.1:14550 --out=127.0.0.1:14551 --master=tcp:127.0.0.1:5760 --sitl=127.0.0.1:5501
    The master’s port is shifted by 10 for each instance like 5760, 5770…

  2. Issue throttle arm on each consoles. The Arm command succeeds only on the last connected SITL instance.
    Other SITL instances dump the EKF error.

    APM: PreArm: EKF2 Roll/Pitch inconsistent by 15 deg
    APM: PreArm: EKF2 Roll/Pitch inconsistent by 12 deg
    APM: PreArm: EKF2 Yaw inconsistent by 79 deg
    APM: PreArm: EKF2 Yaw inconsistent by 34 deg
    

Environment

Ubuntu 18.04

Servers by jDrones