void mainloop() { threadrun = true; while (threadrun) { // update leader pos SwarmInterface.Update(); // update other mavs SwarmInterface.SendCommand(); // 5 hz System.Threading.Thread.Sleep(200); } }
void mainloop() { threadrun = true; // make sure leader is high freq updates SwarmInterface.Leader.parent.requestDatastream(MAVLink.MAV_DATA_STREAM.POSITION, 5, SwarmInterface.Leader.sysid, SwarmInterface.Leader.compid); SwarmInterface.Leader.cs.rateposition = 5; while (threadrun) { // update leader pos SwarmInterface.Update(); // update other mavs SwarmInterface.SendCommand(); // 10 hz System.Threading.Thread.Sleep(100); } }