Setting and clearing Missions with Mavlink protocol

1,455 views
Skip to first unread message

Jason Gillikin

unread,
Jan 24, 2014, 6:10:28 PM1/24/14
to mav...@googlegroups.com
Hello All,

I am having some issues with the mavlink protocol setting and recieving missions

First:
when I send Mission clear all and then request mission list, there is always mission seq #0  which appears to be my current lat and long (might also be position where I turned on the copter).  Is this Correct? is this mission always going to be there?  I just wanted to make sure I am doing it correctly.

Second:

when I set a mission I send 
Messages: 
#44, Mission_Count .. to initiate a write transaction
#39, Mission_Item ... the mission Item I want to write

 Bytes Sent:
254 : start byte
 37 : payload
 2 : seq
 255 : systemID
 190 :component ID
 39 :Msg ID

//using mav_cmd enum 16 -- "Mav_CMD_Nav_WayPoint"

param1 =0 //hold
param2 =1 //radius
param3 =0 //pass through
param4 =0 //yaw
param5 =1 //lat  just as test
param6 =1 //long just as test
param7 =0 //alt

 : 0 : seq
  16 :  command 
 1 : Target systemID
 0 :  Target componentID
 0 : frame 
 1:current
 0 : auto continue
CRC





In response I get a Message #40 which is mission_request and seq#0 
(I think its in response to the mission Count I sent)

then I get mission Mission Ack value=0
which is great because it means it accepted my mission.

But, then I get a Message #253 Severity =1  which is

"Action should be taken immediately. Indicates error in non-critical systems."

and the text is "flight plan received"

However, when I request the mission list, the mission is not changed...
does anyone know the right order of commands to write missions?

I just sniffed some packets from mission planner to come up with how to do it.

thanks,

Jason

PS. I am writing in C# creating packets byte by byte and sending them.  I am not using any of the c++ mavlink code for packing messages.
my CRC's are correct also.






John Sauter

unread,
Jan 31, 2014, 11:26:12 AM1/31/14
to mav...@googlegroups.com
I'm no expert, but according to the Waypoint protocol (http://qgroundcontrol.org/mavlink/waypoint_protocol) after sending the MISSION_COUNT message you must wait for the MISSION_REQUEST message and then reply with the corresponding MISSION_ITEM message. The MISSION_ACK will be sent after the number of MISSION_ITEMS specified in the original count message has been requested and received. 

Jason Gillikin

unread,
Jan 31, 2014, 4:25:21 PM1/31/14
to mav...@googlegroups.com
Hey John,

thanks for replying, So oddly enough, if I do not a Mission_Ack back to the Mav after it sends one to the GCS it doesn't save the coordinates.  However a new problem has emerged.  It seems it does not save my new Home coordinate (seq==0)  It gives me error code 3.

Jason

Domenic Del Nano

unread,
Apr 22, 2015, 8:17:33 PM4/22/15
to mav...@googlegroups.com
Jason,

Did you ever figure this out?  I am trying to implement creating a mission as well.

Dom

Gillikin, Jason Lee

unread,
Apr 23, 2015, 11:48:35 AM4/23/15
to mav...@googlegroups.com
haven't messed with it in a while. but from what I remember, home is always mission zero. also, I used the mavlink messages, which is a seperate ID. I don't have it in front of me right now.

hope this helps

jason
________________________________________
From: mav...@googlegroups.com [mav...@googlegroups.com] On Behalf Of Domenic Del Nano [ddel...@gmail.com]
Sent: Wednesday, April 22, 2015 8:17 PM
To: mav...@googlegroups.com
Subject: [MAVLINK] Re: Setting and clearing Missions with Mavlink protocol
--
Sie erhalten diese Nachricht, weil Sie in Google Groups ein Thema der Gruppe "MAVLink" abonniert haben.
Wenn Sie sich von diesem Thema abmelden möchten, rufen Sie https://groups.google.com/d/topic/mavlink/U4iuvR7tX_g/unsubscribe auf.
Wenn Sie sich von dieser Gruppe und allen Themen dieser Gruppe abmelden möchten, senden Sie eine E-Mail an mavlink+u...@googlegroups.com<mailto:mavlink+u...@googlegroups.com>.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages