Skip to content

Latest commit

 

History

History
132 lines (118 loc) · 3.55 KB

README.md

File metadata and controls

132 lines (118 loc) · 3.55 KB

PX4 ublox gps dump

PX4 has an optional parameter (GPS_DUMP_COMM) to dump the raw communication of ublox GPS module into the flight log (ulog format). However the standard log analysis tools do not evaluate this information, for example, plotjuggler, therefore the repo is trying to extract the communication logs of the uBlox GNSS module from the PX4 flight log.

This repo tries to extract the gps_dump messages that logged by PX4, the data parsing is based on pyubx2 to simply parse individual ublox message.

Installation

pip3 install -r requirements.txt

Usage

Run python scripts :

python3 main.py -i path/to/logfile.ulog

Run python scripts with GUI :

python3 main_gui.py

Parsed messages will be written to csv:

  • logfile_name_MON-RF.csv: Parsed ublox MON-RF messages from the ublox module
  • logfile_name_NAV-DOP.csv: Parsed ublox NAV-DOP messages from the ublox module
  • logfile_name_NAV-PVT.csv: Parsed ublox NAV-PVT messages from the ublox module

ublox Protocol Reference

Following ulog protocol messages are extracted. But of course, there are limitations as PX4 does not enable all messages by default. At the moment, we found the NAV-PVT, NAV-DOP, and MON-RF are logged.

MSGATTR = {
    "NAV-PVT": [
        "iTOW",
        "year",
        "month",
        "day",
        "hour",
        "min",
        "second",
        "validDate",
        "validMag",
        "validTime",
        "fullyResolved",
        "tAcc",
        "nano",
        "fixType",
        "gnssFixOk",
        "diffSoln",
        "psmState",
        "headVehValid",
        "carrSoln",
        "numSV",
        "lon",
        "lat",
        "height",
        "hMSL",
        "hAcc",
        "vAcc",
        "velN",
        "velE",
        "velD",
        "gSpeed",
        "headMot",
        "sAcc",
        "headAcc",
        "pDOP",
        "headVeh",
        "magDec",
        "magAcc",
    ],
    "NAV-DOP": ["iTOW", "gDOP", "pDOP", "tDOP", "vDOP", "hDOP", "nDOP", "eDOP"],
    "MON-RF": [
        "version",
        "nBlocks",
        "reserved0",
        {
            "rgroup": (
                "nBlocks",
                [
                    "blockId",
                    "jammingState",
                    "antStatus",
                    "antPower",
                    "postStatus",
                    "reserved1",
                    "noisePerMS",
                    "agcCnt",
                    "jamInd",
                    "ofsI",
                    "magI",
                    "ofsQ",
                    "magQ",
                    "reserved2",
                ],
            )
        },
    ],
    "MON-SYS": [
        "msgVer",
        "bootType",
        "cpuLoad",
        "cpuLoadMax",
        "memUsage",
        "memUsageMax",
        "ioUsage",
        "ioUsageMax",
        "runTime",
        "noticeCount",
        "warnCount",
        "errorCount",
        "tempValue",
        "reserved0",
    ],
}

Pre-commit

The pre-commit config file are set. Possible to use this feature when commit changes to this repo.

pre-commit install

References