Pixhawk---SDLOG2 application detailed

Source: Internet
Author: User
Tags apm mavlink

SDLOG2 app

?? The purpose of the application is to record the flight log to the SD card, the log file format is compatible with APM binaries, but sdlog2 use mandatory message time to write timestamps.

How to use

?? Each time the sdlog2 app starts logging, it creates a new folder in the SD log card log folder. If -t the parameter option is set and the GPS timestamp is available, the name of the folder is based on the current date, log/2015-07-24 For example, otherwise it is named sessXXX (XXX represents a serial number). The file name in the folder is also the -t Same, if the option is set log/2015-07-24/11_43_52.bin , the file name is, otherwise log.XXX.bin it will be named (XXX is the serial number).

?? Regardless of whether the SDLOG2 application has been started, the system has been configured, or the Mavlink command, the log records depend on the options set by the Sdlog2 app. The options are described below:

usage: sdlog2 {start|stop|status|on|off} [-r <log rate>] [-b <buffer size>] -e -a -t -x    -r      Log rate in Hz, 0 means unlimited rate    -b      Log buffer size in KiB, default is 8    -e      Enable logging by default (if not, can be started by command)    -a      Log only when armed (can be still overriden by command)    -t      Use date/time for naming log directories and files    -x      Extended logging

The performance of the logging depends on the read and write speed of the SD used, and the better SD card can effectively avoid skipping the write/read data. When SDLOG2 is applied at full rate (that is, -r there is no option), it can cause CPU load but has no negative impact on flight. However, if the full rate requirement is not met, the information may be skipped.

Logging turned on

?? Under normal circumstances, with the configuration of the flight control, logging is started, and only the data that is required to activate the flight is the data. To start manual logging, execute the following command on the console:

sdlog2 stopsdlog2 start -t -r 200 -e -b 16

?? Stop recording:

sdlog2 stop
Analysis Log Flightplot tool (-recommended)
Fields List

FlightPlot Analysis


?? To view and analyze logs, you can use the __flightplot__gui tool (which provides an executable jar package), download it and install Java and double-click it to execute. You can read the binary log files generated by the SDLOG2 application without converting the log files and display them graphically. See links for specific usage.

?? Flightplot Supported log files:

    • PX4 autopilot log (. bin generated by SDLOG2)
    • APM binary logs (. bin files stored on SD card) (added in v.0.2.6)
    • Support Mavlink Log
Pymavlink Tools

?? You can also use the Mavgraph tool included with the Pymavlink software to draw a log image. Pymavlink provides a number of command line and visualization tools for analyzing data and charting. It supports Mavlink logs (either APM or PX4).

Matlab (convert logs into CVS) tool

?? Read the binary file and convert it to a CVS file, which can be implemented using python or Matlab script files. The analysis data is viewed by selecting different parameter options, and the specific usage is not described (both imperative and somewhat cumbersome).

logconv.m:自动转换日志文件,并图形显示飞行的数据。sdlog2_dump.py:Python脚本,将二进制形式的日志文件转换成CVS格式的文件。
Faults that may be encountered

?? To avoid critical applications in which IO has heavy load, there is a buffer on the listening message and writing log to the SD card. If at some point this buffer overflows, some log records will be skipped. Skipped record data can be detected through the console using the SDLOG2 application. This will also be printed when you close the log file, but you need -a to add the option. From the above, if the skipped record is not zero, then you need to increase the size of the buffer, the following command is to change the default 8KB buffer to 16KB:

sdlog2 start -t -r 100 -e -b 16
Load test

?? To test the transfer rate of the SD, start the SDLOG2 application should be configured to log the logging rate to -e 200hz,32kb buffer and add the option:

首先停止应用:sdlog2 stopsdlog2 start -t -r 200 -e -b 32运行perf命令查看诱导sdlog2负荷:(NOTE: 性能计数器只在记录时存在)perf或者运行运行top命令:top停止应用,清理文件系统:sdlog2 stop

Copyright NOTICE: This article for Bo Master [original] article, without BO Master permission can be reproduced, annotated blog Source: [Http://blog.csdn.net/FreeApe]

Pixhawk---SDLOG2 application detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.