• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python module & scripts for ULog files

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.

The provided command line 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:

pip install pyulog

Installation from source:

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):

pip install -e .

Testing

pytest test

or

python setup.py test

Code Checking

pylint pyulog/*.py

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):

Display information from an ULog file (ulog_info)

Usage:

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:

$ 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)

Convert ULog to rosbag files (ulog2rosbag)

Note You need a ROS environment with px4_msgs built and sourced.

Usage:

usage: ulog2rosbag [-h] [-m MESSAGES] file.ulg result.bag

Convert ULog to rosbag

positional arguments:
  file.ulg              ULog input file
  result.ulg            rosbag output 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'

Migrate/setup the database for use with the DatabaseULog class (ulog_migratedb)

Warning This command must be run whenever the schema changes, otherwise DatabaseULog won't function.

Warning Even if you store logs in the database, you should keep the original .ulg files. Otherwise you may lose your data.

Usage:

usage: ulog_migratedb [-h] [-d DB_PATH] [-n] [-s SQL_DIR] [-f]

Setup the database for DatabaseULog.

optional arguments:
  -h, --help            show this help message and exit
  -d DB_PATH, --database DB_PATH
                        Path to the database file
  -n, --noop            Only print results, do not execute migration scripts.
  -s SQL_DIR, --sql SQL_DIR
                        Directory with migration SQL files
  -f, --force           Run the migration script even if the database is not
                        created with this script.

Example output (to console):

ubuntu@ubuntu:~/github/pyulog$ ulog_migratedb
Using migration files in /home/ubuntu/github/pyulog/pyulog/sql.
Database file pyulog.sqlite3 not found, creating it from scratch.
Current schema version: 0 (database) and 1 (code).
Executing /home/ubuntu/github/pyulog/pyulog/sql/pyulog.1.sql.
Migration done.

More Repositories

1

PX4-Autopilot

PX4 Autopilot Software
C++
7,009
star
2

PX4-Avoidance

PX4 avoidance ROS node for obstacle detection and avoidance.
C++
618
star
3

PX4-ECL

Estimation & Control Library for Guidance, Navigation and Control Applications
C++
473
star
4

eigen

Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
C++
418
star
5

PX4-SITL_gazebo-classic

Set of plugins, models and worlds to use with OSRF Gazebo Simulator in SITL and HITL.
C++
368
star
6

PX4-user_guide

PX4 User Guide
Jupyter Notebook
257
star
7

PX4-Bootloader

PX4 Bootloader for PX4FMU, PX4IO and PX4FLOW
C
236
star
8

PX4-Flow

Firmware for PX4FLOW board
C
232
star
9

sapog

Sapog - advanced multiplatform ESC firmware
C
203
star
10

PX4-Devguide

PX4 Devguide GitBook
TeX
193
star
11

flight_review

web application for flight log analysis & review
Python
191
star
12

PX4-Matrix

Lightweight, dependency free Matrix library (BSD)
C++
176
star
13

PX4-OpticalFlow

This repository contains different algorithms to calculate the optical flow. It can be used as input for a position estimator
C++
156
star
14

NuttX

Standard NuttX with current PX4 patches
C
138
star
15

px4_ros_com

ROS2/ROS interface with PX4 through a Fast-RTPS bridge
C++
120
star
16

PX4-GPSDrivers

Platform independent GPS drivers
C++
84
star
17

DriverFramework

Operating system and flight stack agnostic driver framework for POSIX (Linux, NuttX, Mac OS, QNX, VxWorks).
C++
77
star
18

px4_msgs

ROS/ROS2 messages that match the uORB messages counterparts on the PX4 Firmware
CMake
69
star
19

homebrew-px4

PX4-related Homebrew formula for developers using OS X
Ruby
68
star
20

PX4-containers

Build scripts for containers running various PX4 setups, like SITL with ROS.
Makefile
64
star
21

HIL

Hardware in the loop tools for PX4 Firmware
Python
38
star
22

PX4NuttX

For Migration to new NuttX Repository layout
36
star
23

PX4-windows-toolchain

Repo containing all scripts to install and use the PX4 Toolchain for Windows.
Batchfile
31
star
24

snap_cam

This package provides tools to work with the Snapdragon Flight cameras as well as perform optical flow for use with the PX4 flight stack.
C++
27
star
25

NuttX-apps

Standard NuttX apps with current PX4 patches
C
26
star
26

PX4-gazebo-models

Model repo in app.gazebosim.org
Python
18
star
27

uvc_ros_driver

A ros node to stream images from a multi-camera UVC device
C++
18
star
28

px4ros

contains submodules for ROS SITL, used to define relations between projects/versions
17
star
29

Lepton

FLIR Lepton ROS node
C++
14
star
30

docs.px4.io

PX4 User Guide Content: See https://github.com/PX4/px4_user_guide
HTML
11
star
31

micrortps_agent

microRTPS agent side of the microRTPS bridge. Used to interface PX4 with the DDS world through FastRTPS/FastDDS.
C++
10
star
32

UAVCAN_Bootloaders

C
8
star
33

disparity_to_point_cloud

ROS Node which converts a disparity map in a point cloud
C++
8
star
34

electronWebGCS

JavaScript
7
star
35

ulog_cpp

C++ library for reading and writing ULog files
C++
7
star
36

dev.px4.io

PX4 Developer Guide Content: See https://github.com/PX4/Devguide
HTML
7
star
37

rpi_toolchain

Files for building PX4 POSIX on Raspberry Pi
Shell
5
star
38

mav_comm

This repository contains message and service definitions used for mavs. All future message definitions go in here, existing ones in other stacks should be moved here where possible.
C++
4
star
39

px4_sdk

Library to control PX4 from a companion computer using ROS 2
C++
4
star
40

PX4-Metadata-Translations

Translated metadata for https://github.com/PX4/PX4-Autopilot
Python
3
star
41

Board_ID

3
star
42

uavcan_board_ident

CMake
2
star
43

PX4-graphics

Downloadable media assets and branding guideline
2
star
44

Toolchains

PX4 build system toolchains
Shell
2
star
45

Firmware-Doxygen

PX4 Firmware Doxygen documentation
HTML
2
star
46

rddrone_uavcan

2
star
47

companion

Companion computer bringup and maintenance scripts
Shell
1
star
48

px4_msgs-release

Release repository of px4_msgs for ROS (1) distros
1
star
49

px4_msgs2-release

Release repository of px4_msgs for ROS 2 distros
1
star
50

NuttX-NxWidgets

C++
1
star
51

rfcs

Requests for Comment for PX4/Firmware
1
star