Streamed C++ ULog reader and writer library.
- Options for keeping log data in memory or processing immediately.
- Pure C++17 without additional dependencies (
SimpleWriterrequires platform-specificfsync/FlushFileBuffers). - The reader is ~10 times as fast compared to the python implementation. However, the API is more low-level, and if you're just looking for an easy-to-use parsing library, use pyulog.
- Unsupported ULog features:
- Appended data (
DATA_APPENDED)
- Appended data (
- A little endian target machine is required (an error is thrown if this is not the case)
- The reader keeps errors stored, so parsing can be continued and any errors can be read out at the end.
The writer directly throws exceptions (
ulog_cpp::ExceptionBase).
Check the examples subdirectory.
To use the library with FetchContent in cmake, add the following to the CMakeLists.txt:
include(FetchContent) FetchContent_Declare( ulog_cpp GIT_REPOSITORY https://github.com/PX4/ulog_cpp.git GIT_TAG v1.0.0 SYSTEM EXCLUDE_FROM_ALL) FetchContent_MakeAvailable(ulog_cpp) target_link_libraries(YOUR_PROJECT PUBLIC ulog_cpp::ulog_cpp )
To add the library as a submodule with cmake, use the following steps:
git submodule add https://github.com/PX4/ulog_cpp.git ulog_cpp
Then extend your CMakeLists.txt with:
add_subdirectory(ulog_cpp) target_link_libraries(YOUR_PROJECT PUBLIC ulog_cpp::ulog_cpp )
For development, install the pre-commit scripts:
pre-commit install
CI runs a number of checks which can be executed locally with the following commands.
cd build
make clang-tidycd build
make run-unit-testsThese run automatically when committing code. To manually run them, use:
pre-commit run -a