- Debugging/Logging - 飞行日志分析
- Debugging/Logging - ULog文件格式
- 教程
- 教程 - 地面站
- 教程 - 编写应用程序
- 教程 - QGC的视频流
- 教程 - 远距离视频流
- 教程 - u-blox M8P RTK
- 新手上路
- 新手上路 - 初始设置
- 新手上路 - 安装工具链
- 安装工具链 - Mac OS
- 安装工具链 - Linux
- Linux - Advanced Linux
- 安装工具链 - Windows
- 新手上路 - Fast RTPS installation
- 新手上路 - 代码编译
- 新手上路 - 高级配置
- 新手上路 - 贡献& 开发者电话会议
- 贡献& 开发者电话会议 - GIT例程
- 贡献& 开发者电话会议 - Documentation
- 新手上路 - Licenses
- 概念解读
- 概念解读 - 飞行模式
- 概念解读 - 结构概述
- 概念解读 - 飞行控制栈
- 概念解读 - 中间件
- 概念解读 - 混控和执行器
- 概念解读 - PWM限制状态机
- Hardware
- Hardware - 自驾仪硬件
- 机型 - 统一的基础代码
- 机型 - 参考机型
- 机型 - 添加一个新的机型
- Data Links - SiK Radio
- Data Links - Wifi数传
- Data Links - 数传
- I2C总线 - SF1XX lidar
- 传感器和执行机构总线 - UAVCAN总线
- UAVCAN总线 - UAVCAN Bootloader
- UAVCAN总线 - UAVCAN固件升级
- UAVCAN总线 - UAVCAN配置
- UAVCAN总线 - UAVCAN 的各种笔记
- 传感器和执行机构总线 - UART
- UART - uLanding Radar
- 传感器和执行机构总线 - 设置云台控制
- 传感器和执行机构总线 - 相机触发器
- Hardware - 协同电脑
- 仿真
- 仿真 - 基本仿真
- 仿真 - Gazebo仿真
- 仿真 - HITL仿真
- 仿真 - 连接到ROS
- 仿真 - AirSim仿真
- 仿真 - 多机仿真
- 中间件及架构
- 中间件及架构 - uORB消息机制
- 中间件及架构 - MAVLink消息机制
- 中间件及架构 - 守护程序
- 中间件及架构 - 驱动框架
- 模块 & 命令
- 模块 & 命令 - 命令
- 模块 & 命令 - 通信
- 模块 & 命令 - 驱动
- 模块 & 命令 - 系统
- Robotics
- Robotics - 用Linux进行外部控制
- Robotics - ROS
- ROS - 在RPi上安装ROS
- ROS - MAVROS (ROS上的MAVLink)
- ROS - MAVROS外部控制例程
- ROS - 外部位置估计
- ROS - Gazebo Octomap
- Robotics - DroneKit
- Debugging/Logging
- Debugging/Logging - FAQ
- Debugging/Logging - 系统控制台
- Debugging/Logging - 自驾仪调试
- Debugging/Logging - Sensor/Topic Debugging
- Debugging/Logging - 仿真调试
- Debugging/Logging - System-wide Replay
- Debugging/Logging - 发送调试的值
- Debugging/Logging - Profiling
- Debugging/Logging - 日志记录
- 教程 - 光流
- 教程 - ecl EKF
- 教程 - 飞行前检查
- 教程 - 着陆检测
- 教程 - Linux系统下使用S.Bus驱动
- Advanced Topics
- Advanced Topics - 系统启动
- Advanced Topics - 参数&配置
- Advanced Topics - 参考参数
- Advanced Topics - 安装Intel RealSense R200的驱动
- Advanced Topics - 切换状态估计器
- Advanced Topics - 外部模块
- Advanced Topics - STM32 Bootloader
- 测试和持续集成
- 测试和持续集成 - 持续集成
- 测试和持续集成 - Jenkins持续集成环境
- 测试和持续集成 - 综合测试
- 测试和持续集成 - Docker容器
- 测试和持续集成 - 维护
Debugging/Logging - 日志记录
translated_page: https://github.com/PX4/Devguide/blob/master/en/log/logging.md
translated_sha: 95b39d747851dd01c1fe5d36b24e59ec865e323e
Logging
This describes the new logger, SYS_LOGGER
set to 1.
The logger is able to log any ORB topic with all included fields. Everything
necessary is generated from the .msg
file, so that only the topic name needs
to be specified. An optional interval parameter specifies the maximum logging
rate of a certain topic. All existing instances of a topic are logged.
The output log format is ULog.
Usage
By default, logging is automatically started when arming, and stopped when
disarming. A new log file is created for each arming session on the SD card. To
display the current state, use logger status
on the console. If you want to
start logging immediately, use logger on
. This overrides the arming state, as
if the system was armed. logger off
undoes this.
Use
logger help
for a list of all supported logger commands and parameters.
Configuration
The list of logged topics can be customized with a file on the SD card. Create a
file etc/logging/logger_topics.txt
on the card with a list of topics:
<topic_name>, <interval>
The <interval>
is optional, and if specified, defines the minimum interval in
ms between two logged messages of this topic. If not specified, the topic is
logged at full rate.
The topics in this file replace all of the default logged topics.
Scripts
There are several scripts to analyze and convert logging files in the
pyulog repository.
Dropouts
Logging dropouts are undesired and there are a few factors that influence the
amount of dropouts:
- Most SD cards we tested exhibit multiple pauses per minute. This shows
itself as a several 100 ms delay during a write command. It causes a dropout
if the write buffer fills up during this time. This effect depends on the SD
card (see below). - Formatting an SD card can help to prevent dropouts.
- Increasing the log buffer helps.
- Decrease the logging rate of selected topics or remove unneeded topics from
being logged (info.py <file>
is useful for this).
SD Cards
The following provides performance results for different SD cards.
Tests were done on a Pixracer; the results are applicable to Pixhawk as well.
SD Card | Mean Seq. Write Speed [KB/s] | Max Write Time / Block (average) [ms] |
---|---|---|
SanDisk Extreme U3 32GB | 461 | 15 |
Sandisk Ultra Class 10 8GB | 348 | 40 |
Sandisk Class 4 8GB | 212 | 60 |
SanDisk Class 10 32 GB (High Endurance Video Monitoring Card) | 331 | 220 |
Lexar U1 (Class 10), 16GB High-Performance | 209 | 150 |
Sandisk Ultra PLUS Class 10 16GB | 196 | 500 |
Sandisk Pixtor Class 10 16GB | 334 | 250 |
Sandisk Extreme PLUS Class 10 32GB | 332 | 150 |
More important than the mean write speed is the maximum write time per block (of
4 KB). This defines the minimum buffer size: the larger this maximum, the larger
the log buffer needs to be to avoid dropouts. Logging bandwidth with the default
topics is around 50 KB/s, which all of the SD cards satisfy.
By far the best card we know so far is the SanDisk Extreme U3 32GB. This
card is recommended, because it does not exhibit write time spikes (and thus
virtually no dropouts). Different card sizes might work equally well, but the
performance is usually different.
You can test your own SD card with sd_bench -r 50
, and report the results to
https://github.com/PX4/Firmware/issues/4634.
Log Streaming
The traditional and still fully supported way to do logging is using an SD card
on the FMU. However there is an alternative, log streaming, which sends the
same logging data via MAVLink. This method can be used for example in cases
where the FMU does not have an SD card slot (e.g. Intel® Aero Ready to Fly Drone) or simply to avoid
having to deal with SD cards. Both methods can be used independently and at the
same time.
The requirement is that the link provides at least ~50KB/s, so for example a
WiFi link. And only one client can request log streaming at the same time. The
connection does not need to be reliable, the protocol is designed to handle
drops.
There are different clients that support ulog streaming:
mavlink_ulog_streaming.py
script in Firmware/Tools.- QGroundControl:
- MAVGCL
Diagnostics
- If log streaming does not start, make sure the
logger
is running (see
above), and inspect the console output while starting. - If it still does not work, make sure that Mavlink 2 is used. Enforce it by
settingMAV_PROTO_VER
to 2. - Log streaming uses a maximum of 70% of the configured mavlink rate (
-r
parameter). If more is needed, messages are dropped. The currently used
percentage can be inspected withmavlink status
(1.8% is used in this
example):
Also make sureinstance #0:
GCS heartbeat: 160955 us ago
mavlink chan: #0
type: GENERIC LINK OR RADIO
flow control: OFF
rates:
tx: 95.781 kB/s
txerr: 0.000 kB/s
rx: 0.021 kB/s
rate mult: 1.000
ULog rate: 1.8% of max 70.0%
accepting commands: YES
MAVLink version: 2
transport protocol: UDP (14556)
txerr
stays at 0. If this goes up, either the NuttX sending
buffer is too small, the physical link is saturated or the hardware is too
slow to handle the data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论