Servers by jDrones

Pymavlink mission uploading

Hello:)
I have problem when i try do upload mission to the copter.

wp = mavwp.MAVWPLoader()
seq = 1
frame = mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT
lat = (53.128015784034675,53.1216660)
lon = (23.11616498623093,23.1258)
alt = (20,40)
N = 2
wp.add(mavutil.mavlink.MAVLink_mission_item_message(master.target_system,
	master.target_component,
	seq,
	frame,
	mavutil.mavlink.MAV_CMD_NAV_TAKEOFF,
	0, 0, 0, radius, 0, 0,
	lat[0],lon[0],alt[0]))
	seq+=1
wp.add(mavutil.mavlink.MAVLink_mission_item_message(master.target_system,
                                                    master.target_component,
                                                    seq,
                                                    frame,
                                                    mavutil.mavlink.MAV_CMD_NAV_WAYPOINT,
                                                    0, 0, 0, radius, 0, 0,
                                                    lat[1], lon[1], alt[1]))
seq += 1
wp.add(mavutil.mavlink.MAVLink_mission_item_message(master.target_system,
                         master.target_component,
                         seq,
                         frame,
                         mavutil.mavlink.MAV_CMD_NAV_LAND,
                         0, 0, 0, radius, 0, 0,
                         lat[1],lon[1],alt[1]))
master.waypoint_clear_all_send()
master.waypoint_count_send(wp.count())
for i in range(wp.count()):
            msg = master.recv_match(type=['MISSION_REQUEST'],blocking=True)
            master.mav.send(wp.wp(msg.seq))
            print 'Sending waypoint {0}'.format(msg.seq)
mission_ack_msg = master.recv_match(type=['MISSION_ACK'], blocking=True)
disp_MISSION_ACK(mission_ack_msg)

But when i upload it, it change first mission to MAV_CMD_NAV_WAYPOINT (as in the image)

I would like if it is some kind of glitch ? Or maybe first element of mission is special and always shoud be type 16? Maybe i shoud add takeoff as a second misssion item? Anyway i cant takeoff in auto mode. Thanks for any adivise!

I believe the first element of a mission is the vehicle’s home position.

Servers by jDrones