MAV_CMD - Mission or MAVLink Command

178 views
Skip to first unread message

Hamish Willee

unread,
Sep 3, 2018, 6:47:11 AM9/3/18
to mav...@googlegroups.com
Hi All,

I'm updating the docs about creating message definitions (see https://github.com/mavlink/mavlink-devguide/pull/96)

My hunch is that MAV_CMDs were originally intended for mission commands
- At some point someone realised that it would be useful to use the same command outside of missions - which resulted in the Command protocol. 
- Then in MAVLink 1 message IDs started to run out, so we started using the command protocol and the much bigger enum id range to send commands which we'd otherwise have used normal messages for.

So,
1. Are the MAV_CMDs = Mission Commands or MAVLink commands?
2. When should a command be written as a MAV_CMD and when as a stand-alone message? 

Thoughts?

Michael du Breuil

unread,
Sep 3, 2018, 3:23:38 PM9/3/18
to mav...@googlegroups.com
In practice they are definitely freely used for both. There are a number of mission items (such as do_change_speed) that function quite nicely at any point during autonomous flight and reusing the command and definition is very convenient. Depending upon your internal autopilot structure you may actually be reusing the same command handler for both the mission and command version.

Commands also have the benefit that they have a ACK message. Anytime you want to make a new custom message you need to consider if there should be a corresponding ACK message, since we lack a generic form of ACK'ing. For commands to vehicles (such as change speed, or fly to this location) having an ACK/NACK is essential.

The main reasons that come to mind for stand alone command messages is that the information you want to convey does not fit into a command for some reason (needs more then 7 parameters, or needs different representation then 7 floats or 5 floats 2 int32_t's), or it's part of a larger standalone protocol.

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "MAVLink" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an mavlink+unsubscribe@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Hamish Willee

unread,
Sep 3, 2018, 6:34:58 PM9/3/18
to MAVLink
Hi Michael,

That is exactly the information I needed. Much appreciated.

I'll update the docs in line with this later today.

Regards
Hamish
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an mavlink+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages