Rust ULog Parser
A robust Rust implementation of a parser for the ULog file format, commonly used in PX4 flight stack for logging system data. This parser provides a safe, efficient way to read and process ULog files with strong type checking and error handling.
Project Status
This project is currently in development, it basically works but I'll be making changes to the interface as I go.
- Parse ULog files and extract all messages
- Make a nice interface for the parser (in progress)
- Documentation
- Add cli features for the binary (right now it just gives some summary data for a sanity check)
- Add tests (Parity tests are in progress, using pyulog for comparison. The holdup is munging the data to match the format from pyulog)
- Benchmarking
Features
- Complete implementation of the ULog file format specification
- Support for all ULog message types including:
- Data messages
- Format messages
- Parameter messages
- Logged messages (both plain and tagged)
- Multi messages
- Subscription messages
- Dropout tracking
- Safe handling of nested message types
- Comprehensive error handling
- Zero-copy parsing where possible
- Support for appended data sections
Usage
Add this to your Cargo.toml:
[]
= "0.0.1"
Basic Example
use File;
use ULogParser;
Project Structure
The project is organized into several modules, each handling specific aspects of ULog parsing:
lib.rs: Core parser implementation and type definitionsdata_message.rs: Handles data message parsingdropout_message.rs: Manages dropout tracking and statisticsformat_message.rs: Processes message format definitionsinfo_message.rs: Handles info message parsinglogged_message.rs: Manages regular logged messagesmulti_message.rs: Handles multi-part messagesparameter_message.rs: Processes parameter messagessubscription_message.rs: Manages message subscriptionstagged_logged_message.rs: Handles tagged log messages
API Overview
Main Parser Interface
The ULog struct provides the main interface for parsing ULog files:
use ULog;
let ulog = parse_file?;
// Access header information
println!;
println!;
// Get logged messages
for message in &ulog.logged_messages
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License