getting BAD_DATA when running mavlogdump.py

873 views
Skip to first unread message

Marcela Campo

unread,
May 7, 2014, 7:56:26 PM5/7/14
to mav...@googlegroups.com
Hi,
 I am new to MAVLink and I've just downloaded pymavlink following these instructions http://www.qgroundcontrol.org/mavlink/pymavlink.
I am having some issues running the mavlogdump tool, I am getting the following messages printed out to my terminal:

ATTITUDE {time_boot_ms : 100, roll : 0.0115241166204, pitch : 0.0396822839975, yaw : 0.136841028929, rollspeed : -0.00306432135403, pitchspeed : -0.000666156702209, yawspeed : -0.000666156585794}
569858-07-09 03:17:26.93: ATTITUDE {time_boot_ms : 100, roll : 0.0115241166204, pitch : 0.0396822839975, yaw : 0.136841028929, rollspeed : -0.00306432135403, pitchspeed : -0.000666156702209, yawspeed : -0.000666156585794}


and then nothing else is printed out. I tried printing debug messages and all I get after these two entries is a few (just 3) bad data messages:

BAD_DATA {Bad prefix, data:['0']}


Loading the same file in QGroundControl and replaying runs for a couple of minutes and ATTITUDE messages vary over time, so I would expect many more messages printed by the script.

Attaching the file I am testing with. Does someone have any idea what I might be doing wrong?

I am running with the --dialect=pixhawk option.

Thanks in advance
Marcela





14_18hs.mavlink

Lorenz Meier

unread,
May 8, 2014, 1:49:49 AM5/8/14
to mav...@googlegroups.com
Hi,

QGroundControl only recently switched to the same log format (you would have to build from source to get that state). The version you used probably does not yet output compatible logs. If you now build from source, you will be able to do what you tried there.

-Lorenz

--
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+u...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.
<14_18hs.mavlink>

Marcela Campo

unread,
May 8, 2014, 9:35:46 AM5/8/14
to mav...@googlegroups.com
Hi Lorenz, 
  Thank you for your response. I got the logs from other person so I am not sure I understand. This means that the problem is with the logs retrieved from the UAV and in that part of the process we need to use the newest code?
If that's not possible, where can I find documentation on the previous format so to build a parsing script?

Thanks again!
Marcela

Kevin Hester

unread,
May 8, 2014, 3:47:16 PM5/8/14
to mav...@googlegroups.com
I think Lorenz is probably sleeping at the moment, so I think I can help (we just chatted about this offline):

Mission planner, the python tools and both of the android apps have always been formatting tlogs as follows:

8 byte usecs since 1970
mavlink msg

over and over again 

QGC has been using a different format (documented here: http://qgroundcontrol.org/dev/logging):

8 byte usecs since 1970
mavlink msg (padded to 263 bytes)

It sounds like your files have the padding - all you need to do is remove the extra padding if you want to 'save' these files (or slightly tweak the pymavlink tool to expect padding to be there)

I noticed this about a year ago when I wrote droneshare and people started uploading logs.  Some of the logs wouldn't parse, so (not knowing about the qgc spec) I looked at the file and saw that some gcses were padding.  I had the droneshare reader just skip padding as needed.

 

Marcela Campo

unread,
May 8, 2014, 4:41:27 PM5/8/14
to mav...@googlegroups.com, kev...@geeksville.com
Thank you so much Kevin for your explanation. Crystal clear for me now.

Thanks
Marcela

George

unread,
May 8, 2014, 4:45:01 PM5/8/14
to mav...@googlegroups.com, kev...@geeksville.com
Additionally, QGroundControl logs the timestamp as a different endianness than the python tools expect. QGC logs the timestamp in the native endianness of whatever platform it's on, which is little-endian on x86 processors. The python tools expect big endian numbers. This issue was fixed as well 2 days ago.

Marcela Campo

unread,
May 9, 2014, 10:03:06 AM5/9/14
to mav...@googlegroups.com, kev...@geeksville.com
Thanks Bryant! Very useful information. 

Cheers!
Marcela
Reply all
Reply to author
Forward
0 new messages