I wrote a script with Python to run with rovers on Mission Planner. The function of the script is essentially the same function as the Swarm application available from the Ctrl+F command on Mission Planner. There are two vehicles involved, a leader and a follower. I wrote a script for each vehicle so the leader can send coordinates and parameters and the follower can receiver them and interpret them into waypoints. Since I'm using two scripts, I run the scripts on two instances of Mission Planner. The Mission Planner instances can run on the same computer or on separate computers (I've tried both, but an IP address must be in the code if using separate computers).
To set the waypoints on the follower script using Python, I use these three lines to set the lat, long, and alt for the waypoint:
My script works and does what I want it to. However, the problem I'm having is there is a 4-5 second delay from when the leader script sends the coordinates/parameters to the follower, and the follower receives them. No matter how fast I set the leader script to send or transmit, the follower script still maintains a 4-5 second delay. I've narrowed the problem down to the altitude line. As soon as I commented this out, the follower script ran instantaneously. However, then the follower vehicle wouldn't follow the leader. In fact, it didn't move at all. My guess is the rover vehicle needs to have all three waypoint parameters set before it can execute a waypoint. This doesn't make much sense because the rover is on the ground, but it seems to be necessary. I've even tried setting arbitrary values to the altitude and all had the same delay except when I set it to 0. But when setting it to 0, the follower didn't move again.
So does anyone know of a way to limit this follower delay or negate it in any way, while still maintaining the desired function?