Trying to Understand Mavlink Command Generated by MP

Hello All,

I am trying to understand the command sent by MP when doing a "go to" from map. I am connected to SITL via MAVPROXY, and am capturing the command packets via Wireshark.

When executing the command, I get:

fe:25:53:ff:be:27:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:98:22:07:42:b1:cc:ec:c2:00:00:7a:44:00:00:10:00:01:01:03:02:01:bd:c3

Which looks to be a "MISSION_ITEM" Mavlink message (x27, d39). So far so good, but when I try to decode the data (based on http://mavlink.org/messages/common#MISSION_ITEM), I get:

target system - 00
Target component - 00
seq - 0000
frame - 00
command - 0000
current - 00
autocontinue - 00
param1 - 00000000
param2 - 00000098
param3 - 220742b1
param4 - ccecc200
x - 007a4400
y - 00100001
z - 01030201

This is what confuses me: why would everything up to param2 be 0? Moreover, I cannot seem to properly decode the x/y/z coordinates. My understanding is that they are little-endian floats (single precision).

Any pointers would be greatly appreciated.

Regards

-Ted

You need to be a member of diydrones to add comments!

Join diydrones

Replies are closed for this discussion.

Replies

  • To document in case someone else comes across this in the future: the ordering of the parameter on the web documentation (http://mavlink.org/messages/common#MISSION_ITEM) IS NOT the same as the definition of the parameters in mavlink_msg_mission_item.h which is:

    typedef struct __mavlink_mission_item_t
    {
    float param1; ///< PARAM1, see MAV_CMD enum
    float param2; ///< PARAM2, see MAV_CMD enum
    float param3; ///< PARAM3, see MAV_CMD enum
    float param4; ///< PARAM4, see MAV_CMD enum
    float x; ///< PARAM5 / local: x position, global: latitude
    float y; ///< PARAM6 / y position: global: longitude
    float z; ///< PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
    uint16_t seq; ///< Sequence
    uint16_t command; ///< The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
    uint8_t target_system; ///< System ID
    uint8_t target_component; ///< Component ID
    uint8_t frame; ///< The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
    uint8_t current; ///< false:0, true:1
    uint8_t autocontinue; ///< autocontinue to next wp

    Applying the actual definition the the datastream from MP makes the data make sense.

This reply was deleted.

Activity