mavlink dropped packets

It appears, from looking at the code (see below) that the packet_rx_drop_count field of the status is really a report of the number of receive errors. It does not use the sequence numbers. Does anyone know why this changed?

In the code below (from mavlink_helpers.h), not how the part the used to count missing packets based on sequence numbers is commented out.

    if (status->msg_received == MAVLINK_FRAMING_OK)
    {
        //while(status->current_seq != rxmsg->seq)
        //{
        //    status->packet_rx_drop_count++;
        //               status->current_seq++;
        //}
        status->current_rx_seq = rxmsg->seq;
        // Initial condition: If no packet has been received so far, drop count is undefined
        if (status->packet_rx_success_count == 0) status->packet_rx_drop_count = 0;
        // Count this packet as received
        status->packet_rx_success_count++;
    }

    r_message->len = rxmsg->len; // Provide visibility on how far we are into current msg
    r_mavlink_status->parse_state = status->parse_state;
    r_mavlink_status->packet_idx = status->packet_idx;
    r_mavlink_status->current_rx_seq = status->current_rx_seq+1;
    r_mavlink_status->packet_rx_success_count = status->packet_rx_success_count;
    r_mavlink_status->packet_rx_drop_count = status->parse_error;
    status->parse_error = 0;

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

Join diydrones

Email me when people reply –

Activity