# pyulog
This repository contains a python package to parse ULog files and scripts to
convert and display them. ULog is a self-describing logging format which is
documented [here](https://dev.px4.io/en/log/ulog_file_format.html).
The provided [command line scripts](#scripts) are:
- `ulog_info`: display information from an ULog file.
- `ulog_messages`: display logged messages from an ULog file.
- `ulog_params`: extract parameters from an ULog file.
- `ulog2csv`: convert ULog to CSV files.
- `ulog2kml`: convert ULog to KML files.
## Installation
Installation with package manager:
```bash
pip install pyulog
```
Installation from source:
```bash
python setup.py build install
```
## Development
To install the code in a format so that it can be easily edited use the
following command (this will install the package as a link to the repo):
```bash
pip install -e .
```
## Testing
```bash
nosetests -sv
```
or
```bash
python setup.py test
```
## Code Checking
```bash
pylint pyulog/*.py
```
<span id="scripts"></span>
## Command Line Scripts
All scripts are installed as system-wide applications (i.e. they be called on the command line without specifying Python or a system path), and support the `-h` flag for getting usage instructions.
The sections below show the usage syntax and sample output (from [test/sample.ulg](test/sample.ulg)):
### Display information from an ULog file (ulog_info)
Usage:
```bash
usage: ulog_info [-h] [-v] file.ulg
Display information from an ULog file
positional arguments:
file.ulg ULog input file
optional arguments:
-h, --help show this help message and exit
-v, --verbose Verbose output
```
Example output:
```bash
$ ulog_info sample.ulg
Logging start time: 0:01:52, duration: 0:01:08
Dropouts: count: 4, total duration: 0.1 s, max: 62 ms, mean: 29 ms
Info Messages:
sys_name: PX4
time_ref_utc: 0
ver_hw: AUAV_X21
ver_sw: fd483321a5cf50ead91164356d15aa474643aa73
Name (multi id, message size in bytes) number of data points, total bytes
actuator_controls_0 (0, 48) 3269 156912
actuator_outputs (0, 76) 1311 99636
commander_state (0, 9) 678 6102
control_state (0, 122) 3268 398696
cpuload (0, 16) 69 1104
ekf2_innovations (0, 140) 3271 457940
estimator_status (0, 309) 1311 405099
sensor_combined (0, 72) 17070 1229040
sensor_preflight (0, 16) 17072 273152
telemetry_status (0, 36) 70 2520
vehicle_attitude (0, 36) 6461 232596
vehicle_attitude_setpoint (0, 55) 3272 179960
vehicle_local_position (0, 123) 678 83394
vehicle_rates_setpoint (0, 24) 6448 154752
vehicle_status (0, 45) 294 13230
```
### Display logged messages from an ULog file (ulog_messages)
Usage:
```
usage: ulog_messages [-h] file.ulg
Display logged messages from an ULog file
positional arguments:
file.ulg ULog input file
optional arguments:
-h, --help show this help message and exit
```
Example output:
```
ubuntu@ubuntu:~/github/pyulog/test$ ulog_messages sample.ulg
0:02:38 ERROR: [sensors] no barometer found on /dev/baro0 (2)
0:02:42 ERROR: [sensors] no barometer found on /dev/baro0 (2)
0:02:51 ERROR: [sensors] no barometer found on /dev/baro0 (2)
0:02:56 ERROR: [sensors] no barometer found on /dev/baro0 (2)
```
### Extract parameters from an ULog file (ulog_params)
Usage:
```
usage: ulog_params [-h] [-d DELIMITER] [-i] [-o] file.ulg [params.txt]
Extract parameters from an ULog file
positional arguments:
file.ulg ULog input file
params.txt Output filename (default=stdout)
optional arguments:
-h, --help show this help message and exit
-d DELIMITER, --delimiter DELIMITER
Use delimiter in CSV (default is ',')
-i, --initial Only extract initial parameters
-o, --octave Use Octave format
```
Example output (to console):
```
ubuntu@ubuntu:~/github/pyulog/test$ ulog_params sample.ulg
ATT_ACC_COMP,1
ATT_BIAS_MAX,0.0500000007451
ATT_EXT_HDG_M,0
...
VT_OPT_RECOV_EN,0
VT_TYPE,0
VT_WV_LND_EN,0
VT_WV_LTR_EN,0
VT_WV_YAWR_SCL,0.15000000596
```
### Convert ULog to CSV files (ulog2csv)
Usage:
```
usage: ulog2csv [-h] [-m MESSAGES] [-d DELIMITER] [-o DIR] file.ulg
Convert ULog to CSV
positional arguments:
file.ulg ULog input file
optional arguments:
-h, --help show this help message and exit
-m MESSAGES, --messages MESSAGES
Only consider given messages. Must be a comma-
separated list of names, like
'sensor_combined,vehicle_gps_position'
-d DELIMITER, --delimiter DELIMITER
Use delimiter in CSV (default is ',')
-o DIR, --output DIR Output directory (default is same as input file)
```
### Convert ULog to KML files (ulog2kml)
> **Note** The `simplekml` module must be installed on your computer. If not already present, you can install it with:
```
pip install simplekml
```
Usage:
```
usage: ulog2kml [-h] [-o OUTPUT_FILENAME] [--topic TOPIC_NAME]
[--camera-trigger CAMERA_TRIGGER]
file.ulg
Convert ULog to KML
positional arguments:
file.ulg ULog input file
optional arguments:
-h, --help show this help message and exit
-o OUTPUT_FILENAME, --output OUTPUT_FILENAME
output filename
--topic TOPIC_NAME topic name with position data
(default=vehicle_gps_position)
--camera-trigger CAMERA_TRIGGER
Camera trigger topic name (e.g. camera_capture)
```
没有合适的资源?快使用搜索试试~ 我知道了~
pyulog:适用于ULog文件的Python模块和脚本
共33个文件
py:14个
txt:6个
ulg:3个
5星 · 超过95%的资源 需积分: 49 9 下载量 80 浏览量
2021-05-05
15:47:23
上传
评论 1
收藏 3.42MB ZIP 举报
温馨提示
pyulog 该存储库包含一个python包,用于解析ULog文件和脚本以进行转换和显示。 ULog是一种自我描述的日志记录格式,记录。 提供的是: ulog_info :显示来自ULog文件的信息。 ulog_messages :显示来自ULog文件的已记录消息。 ulog_params :从ULog文件中提取参数。 ulog2csv :将ULog转换为CSV文件。 ulog2kml :将ULog转换为KML文件。 安装 使用软件包管理器进行安装: pip install pyulog 从源安装: python setup.py build install 发展 要以某种格式安装代码,以便可以轻松地对其进行编辑,请使用以下命令(这会将软件包安装为回购链接): pip install -e . 测验 nosetests -sv 或者 python setup.py
资源详情
资源评论
资源推荐
收起资源包目录
pyulog-master.zip (33个子文件)
pyulog-master
.gitignore 51B
setup.cfg 330B
README.md 6KB
.github
workflows
test.yml 730B
test
sample_appended_info.txt 25KB
sample_appended_multiple_info.txt 61KB
sample_appended_multiple.ulg 475KB
sample_appended_multiple_messages.txt 82B
sample_appended_messages.txt 82B
sample_messages.txt 248B
test_ulog2csv.py 3KB
__init__.py 0B
sample.ulg 3.87MB
sample_appended.ulg 4.34MB
sample_info.txt 1KB
pylintrc 14KB
pyulog
ulog2csv.py 3KB
ulog2kml.py 8KB
px4.py 4KB
messages.py 1023B
_version.py 18KB
__init__.py 209B
core.py 34KB
info.py 4KB
params.py 5KB
extract_gps_dump.py 3KB
run_tests.sh 58B
.gitattributes 32B
LICENSE.md 1KB
MANIFEST.in 68B
setup.py 2KB
gen_expected_output.sh 242B
versioneer.py 69KB
共 33 条
- 1
w4676
- 粉丝: 28
- 资源: 4620
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1