Data Logging
There are two types of logs that can be used to diagnose problems while running ArduSub, or to retrieve data for post-processing.
Telemetry logs
Ground Control Station (GCS) software will store all of the autopilot telemtry in a log. These telemetry logs contain all of the MAVLink messages received in their binary format. MAVProxy and QGroundControl save telemetry logs locally in a .tlog file. Telemetry logs are the preferred way of diagnosing most problems.
Once connected to the autopilot, MAVProxy will save all telemetry to a file called 'mav.tlog'. The mav.tlog file is saved under the same path from which MAVProxy was run. By default, QGroundControl only begins logging telemetry after the vehicle has been armed. QGroundControl can be configured to log telemetry while the autopilot is disarmed in the General tab of the Application Settings menu (click the purple 'Q' icon in the menu bar). Select the option to save logs 'even if vehicle was not armed' in order to log telemetry while disarmed. QGroundControl saves the telemetry logs in the 'Telemetry' directory under the 'Save Path' that is specified in the General tab of the Vehicle Seup menu.
DataFlash logs
DataFlash logs are saved by the Autopilot directly to on-board memory (SD card in the case of the Pixhawk), regardless of a telemetry connection. These logs are saved in a .bin file. DataFlash logs are capable of logging data at a much faster rate than telemetry logs. The DataFlash logs are named and saved in ascending order. If GPS is available, the logs will be dated according to the GPS timestamp. DataFlash log files can be opened and inspected with MAVProxy, APM Planner 2 or Mission Planner.
By default, a new dataflah log file is created when the vehicle is initially armed, and logging is performed only while the vehicle is armed. The LOG_DISARMED parameter can be set to 'Enabled' in order to begin a DataFlash log as soon as the autopilot is booted, even before arming. With LOG_DISARMED enabled, logging will be performed whether the vehicle is armed or disarmed, until the vehicle is powered down.
Downloading
DataFlash logs can be retrieved in two ways:
Remove the Micro SD card from the Pixhawk and plug it into your computer to view and transfer the logs using a file explorer like a regular USB drive.
Download the logs remotely via QGroundControl or MAVProxy.
Log downloading via QGroundControl
Click the Analyze icon at the top of the window. The icon looks like a magnifying glass over a document.
Click the 'Refresh' button to view available logs.
Select the log you would like to download, and click 'Download'.
Multiple logs can be downloaded by highlighting the desired logs before clicking 'Download'.
Log downloading via MAVProxy
While connected to the autopilot via MAVProxy, type 'log list' in the MAVProxy console to list the available DataFlash logs onboard the autopilot.
Type 'log download X' to download log number X
While the log is downloading, you can type 'log status' to view the status of the download, or 'log cancel' to cancel the download.
Log Analysis
Telemetry logs and dataflash logs are stored in different formats, and contain different (but in many cases overlapping) data. The log entries for telemetry logs are the MAVLink messages that are documented here and here. The log entries in dataflash logs are self-documented in their binary format, but the formats can also be determined by looking at the code here.
Below is a brief description of some tools that are available for viewing and extracting data from logs.
MAVExplorer.py
MAVExplorer is a command line/graphical tool used to plot log data. MAVExplorer supports both telemetry logs and dataflash logs, and is included as part of a MAVProxy installation. Please refer to the MAVExplorer documentation for more information. Note, the log file name should not contain any spaces when using this tool
mavlogdump.py
mavlogdump.py is a command line tool used to filter and export log data to plain-text files like .csv or .json. mavlogdump.py supports both telemetry logs and dataflash logs, and it is just one of many such log analysis tools included as part of a pymavlink installation (also installed with MAVProxy). Note, the log file name should not contain any spaces when using this tool
To install mavlogdump.py, install pymavlink from pip:
pip install pymavlink
To use mavlogdump.py, refer to the output of mavlogdump.py --help
:
mavlogdump.py Examples
Print out all STATUSTEXT messages in the log file:
The output can be filtered based on message type, and also based on conditions in the message fields.
Export all ATTITUDE messages to a .csv file:
Export all SCALED_PRESSURE2 messages to a .csv file, filter by showing only messages while vehicle was armed
Export all messages to a human readable file, filter to discrete time span (only two seconds here)
Mission Planner
Mission Planner is a ground control station software like QGroundControl. Mission Planner does not have support for operating ArduSub, but the log files produced by ArduSub are compatible with the graphical analysis tools in Mission Planner. See the Mission Planner log analysis documentation for more details.
results matching ""
No results matching ""
Last updated