ROS2 rosbag data analysis library
Project description
baglab
ROS2 rosbag data analysis library. Load, explore, and visualize rosbag data with MATLAB-like simplicity using pandas DataFrames.
Features
- Lazy loading — open a bag and read only the topics you need
- Dot-access — navigate message fields like
msg.twist.linear.x - Geometry — quaternion/euler conversion, distance, pose interpolation
- Signal processing — lowpass filter, FFT, differentiation, integration
- Diagnostics — topic rate, message gaps, latency chain analysis
- Plotting — time-series, trajectory, step response, error band
Installation
pip install baglab
For development:
git clone https://github.com/Kotakku/baglab.git
cd baglab
pip install -e ".[dev]"
Prerequisites
- Python 3.10+
- ROS2 (Humble / Jazzy)
Usage
import baglab
# Load a rosbag (lazy loading)
bag = baglab.load("path/to/rosbag")
# List topics
print(bag.topics)
# {"/motor/angle": "sensor_msgs/msg/JointState", ...}
# Access topic data (loaded on first access)
twist_df = bag["/cmd_vel"]
# Dot-access for message fields
twist_df.msg.twist.linear.x # Series
twist_df.msg.twist.linear.df # DataFrame (columns: [x, y, z])
# Timestamps
t = baglab.stamp_to_sec(twist_df) # absolute [s]
t = baglab.stamp_to_sec(twist_df, relative=True) # relative (starts at 0)
# Reindex by publication timestamp
twist_df = baglab.reindex_by_stamp(twist_df)
Plot example
import baglab
import matplotlib.pyplot as plt
bag = baglab.load("path/to/rosbag")
twist_df = bag["/cmd_vel"]
t = baglab.stamp_to_sec(twist_df, relative=True)
vel = twist_df.msg.twist.linear.df
fig, axes = plt.subplots(3, 1, sharex=True)
for ax, axis_name in zip(axes, ["x", "y", "z"]):
ax.plot(t, vel[axis_name])
ax.set_ylabel(axis_name)
axes[-1].set_xlabel("time [s]")
plt.show()
Documentation
https://kotakku.github.io/baglab/
License
Apache-2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file baglab-0.1.2.tar.gz.
File metadata
- Download URL: baglab-0.1.2.tar.gz
- Upload date:
- Size: 272.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ed9d0999eddf5ad04453e3391dc3110ffb0a606398cba5db2bb3a70cb7c5108
|
|
| MD5 |
7e19de7ded018e80ba42e13b9de24d23
|
|
| BLAKE2b-256 |
b4234dad90a38adbe3a14ad9cbbfbf361928d89f9399254542234ce501f5f8cb
|
Provenance
The following attestation bundles were made for baglab-0.1.2.tar.gz:
Publisher:
publish.yml on Kotakku/baglab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baglab-0.1.2.tar.gz -
Subject digest:
3ed9d0999eddf5ad04453e3391dc3110ffb0a606398cba5db2bb3a70cb7c5108 - Sigstore transparency entry: 1115292007
- Sigstore integration time:
-
Permalink:
Kotakku/baglab@3b9c30c188284d8c332cb190d9a4316789382c55 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Kotakku
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3b9c30c188284d8c332cb190d9a4316789382c55 -
Trigger Event:
push
-
Statement type:
File details
Details for the file baglab-0.1.2-py3-none-any.whl.
File metadata
- Download URL: baglab-0.1.2-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44ca22704cc222a45fed091dbf9977cd06294b1f3ad338414aa0ef7ad836519f
|
|
| MD5 |
99012170739846b5ceefdfb5f25e2d58
|
|
| BLAKE2b-256 |
d7093ac58cd95e87a8eebe5ab725ae5253e08359e42dde488486f5b999cb4e32
|
Provenance
The following attestation bundles were made for baglab-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on Kotakku/baglab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baglab-0.1.2-py3-none-any.whl -
Subject digest:
44ca22704cc222a45fed091dbf9977cd06294b1f3ad338414aa0ef7ad836519f - Sigstore transparency entry: 1115292010
- Sigstore integration time:
-
Permalink:
Kotakku/baglab@3b9c30c188284d8c332cb190d9a4316789382c55 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Kotakku
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3b9c30c188284d8c332cb190d9a4316789382c55 -
Trigger Event:
push
-
Statement type: