public void setNextWPTargetAlt(ushort wpno, float alt) { // get the existing wp Locationwp current = getWP(wpno); mavlink_mission_write_partial_list_t req = new mavlink_mission_write_partial_list_t(); req.target_system = MAV.sysid; req.target_component = MAV.compid; req.start_index = (short) wpno; req.end_index = (short) wpno; // change the alt current.alt = alt; // send a request to update single point generatePacket((byte) MAVLINK_MSG_ID.MISSION_WRITE_PARTIAL_LIST, req); Thread.Sleep(10); generatePacket((byte) MAVLINK_MSG_ID.MISSION_WRITE_PARTIAL_LIST, req); MAV_FRAME frame = (current.options & 0x1) == 0 ? MAV_FRAME.GLOBAL : MAV_FRAME.GLOBAL_RELATIVE_ALT; //send the point with new alt setWP(current, wpno, MAV_FRAME.GLOBAL_RELATIVE_ALT, 0); // set the point as current to reload the modified command setWPCurrent(wpno); }
/// <summary> /// Set start and finish for partial wp upload. /// </summary> /// <param name="startwp"></param> /// <param name="endwp"></param> public void setWPPartialUpdate(ushort startwp, ushort endwp) { mavlink_mission_write_partial_list_t req = new mavlink_mission_write_partial_list_t(); req.target_system = MAV.sysid; req.target_component = MAV.compid; req.start_index = (short) startwp; req.end_index = (short) endwp; generatePacket((byte) MAVLINK_MSG_ID.MISSION_WRITE_PARTIAL_LIST, req); }