Skip to main content

Lint rosbag2 metadata for LiDAR/IMU SLAM workflows.

Project description

rosbag_slam_lint

rosbag_slam_lint CI

Lint rosbag2 metadata.yaml for LiDAR/IMU SLAM recording quality. (No ROS runtime required.)

rosbag2metadata.yaml を対象に、LiDAR/IMU SLAM向けの録画品質をチェックするCLIです。(ROS実行環境なしで動きます)

Install

PyPI:

python3 -m pip install -U rosbag-slam-lint

CLIだけ欲しい場合(隔離環境):

pipx install rosbag-slam-lint

開発用(editable install, このmonorepoから):

python3 -m pip install -e ./oss/rosbag_slam_lint

Quickstart

rosbag-slam-lint /path/to/bag_dir
rosbag-slam-lint /path/to/metadata.yaml
rosbag-slam-lint /path/to/bag_dir --fail-on warn

目的

録画後に以下を即判定します。

  • 必須トピックがあるか
  • 平均Hzが最低ラインを満たすか
  • 録画時間・総メッセージ数が極端に不足していないか

使い方

rosbag-slam-lint /path/to/bag_dir

metadata.yaml を直接渡すこともできます。

rosbag-slam-lint /path/to/metadata.yaml

JSON出力:

rosbag-slam-lint /path/to/bag_dir --json

WarningでもCIを落とす:

rosbag-slam-lint /path/to/bag_dir --fail-on warn

設定ファイルで閾値を上書き:

rosbag-slam-lint /path/to/bag_dir --profile lio --config examples/config.sample.yaml

デモ(サンプル)

サンプル入力:

examples/metadata.sample.yaml

rosbag-slam-lint examples/metadata.sample.yaml

出力例:

== rosbag_slam_lint ==
source: examples/metadata.sample.yaml
duration_s: 100.000
message_count: 5200
topic_count: 3

topics:
  - /imu/data (sensor_msgs/msg/Imu): 4200 msgs, 42.000 Hz
  - /velodyne_points (sensor_msgs/msg/PointCloud2): 900 msgs, 9.000 Hz
  - /odom (nav_msgs/msg/Odometry): 100 msgs, 1.000 Hz

diagnostics:
  [WARN] LOW_TOPIC_RATE: imu average rate is 42.00Hz; recommended >= 50.0Hz. IMU topic average rate looks low (< 50Hz).
    suggestion: Check sensor frame rate, network bandwidth, and QoS reliability.
  [INFO] MISSING_RECOMMENDED_TOPICS: Recommended topic group 'tf' not found (patterns=['/tf']).
    suggestion: This is optional, but useful for downstream debug/visualization.
  [INFO] MISSING_RECOMMENDED_TOPICS: Recommended topic group 'tf_static' not found (patterns=['/tf_static']).
    suggestion: This is optional, but useful for downstream debug/visualization.

閾値調整(実bagを使う)

複数の metadata.yaml から、プロファイルに必要なトピック群の実測Hz分布を集計できます。

rosbag-slam-profile-stats /data/bags --json

/data/bags は再帰探索され、metadata.yaml が自動収集されます。
出力の required_groups[].suggested_min_hz は、既定で p10 * 0.8 で計算されます。

設定ファイル(--config

サンプル: examples/config.sample.yaml

checks:
  short_recording_s: 120
  low_message_count: 5000

profiles:
  lio:
    required_groups:
      lidar_points:
        min_hz: 8.0
      imu:
        min_hz: 80.0

サポート項目:

  • checks.short_recording_s
  • checks.low_message_count
  • profiles.<profile>.required_groups.<group>.min_hz

プロファイル

  • lio(現在実装済み)
    • 必須: LiDAR群, IMU群
    • 推奨: /tf, /tf_static, /odom
  • lio_glim(厳しめ設定)
    • 必須: LiDAR群 (>= 8Hz), IMU群 (>= 88Hz)
    • 推奨: /tf, /tf_static, /odom
  • ekf
    • 必須: IMU群 (>= 50Hz), Wheel/Odometry群 (>= 10Hz)
    • 推奨: /tf, /tf_static
  • vio
    • 必須: IMU群 (>= 100Hz), Camera image群 (>= 10Hz)
    • 推奨: /tf, /tf_static
  • wheel_lio
    • 必須: LiDAR群 (>= 5Hz), IMU群 (>= 50Hz), Wheel/Odometry群 (>= 10Hz)
    • 推奨: /tf, /tf_static

終了コード

  • 0: 失敗条件に達する問題なし
  • 1: --fail-on で指定した閾値以上の問題あり
  • 2: 入力不正や読み込み失敗

今後の予定

  • /tf チェーン整合チェック
  • GitHub Actions向けサンプル
  • プロファイル自動推定(トピック構成ベース)

リリースノート

  • CHANGELOG.md を参照
  • RELEASE_NOTES_v0.3.2.md を参照
  • RELEASE_NOTES_v0.3.1.md を参照
  • RELEASE_NOTES_v0.3.0.md を参照
  • RELEASE_NOTES_v0.2.0.md を参照
  • RELEASE_NOTES_v0.2.1.md を参照
  • ANNOUNCE_v0.3.2.md に告知テンプレを用意
  • ANNOUNCE_v0.3.1.md に告知テンプレを用意
  • ANNOUNCE_v0.3.0.md に告知テンプレを用意
  • ANNOUNCE_v0.2.1.md に告知テンプレを用意

テスト

cd oss/rosbag_slam_lint
pytest -q

PyPI公開(メンテナ向け)

ローカルビルド検証:

cd oss/rosbag_slam_lint
python3 -m pip install build twine
python3 -m build
python3 -m twine check dist/*

GitHub Actionsでの公開:

  1. リポジトリシークレット PYPI_API_TOKEN を設定
  2. バージョンを更新してタグ/リリースを作成
  3. Publish rosbag_slam_lint workflow が release event で実行される

Secret設定を補助するスクリプト:

cd oss/rosbag_slam_lint
./scripts/setup_pypi_secret.sh --set

設定確認だけする場合:

cd oss/rosbag_slam_lint
./scripts/setup_pypi_secret.sh --check

CIで失敗させる最小例

name: bag-quality-check
on: [push, pull_request]

jobs:
  lint-bag:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: python -m pip install -e ./oss/rosbag_slam_lint
      - run: |
          rosbag-slam-lint path/to/metadata.yaml \
            --profile lio \
            --config oss/rosbag_slam_lint/examples/config.sample.yaml \
            --fail-on warn

リリース手順(v0.1.0ベース)

  1. pyproject.tomlversion を更新
  2. CHANGELOG.md に変更内容を追記
  3. ローカル確認
    • python3 -m py_compile rosbag_slam_lint.py
    • rosbag-slam-lint examples/metadata.sample.yaml
    • rosbag-slam-lint examples/metadata.sample.yaml --json
  4. コミットとタグ作成
    • git add oss/rosbag_slam_lint
    • git commit -m "Release rosbag_slam_lint vX.Y.Z"
    • git tag vX.Y.Z
  5. push
    • git push
    • git push --tags

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

rosbag_slam_lint-0.3.2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rosbag_slam_lint-0.3.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file rosbag_slam_lint-0.3.2.tar.gz.

File metadata

  • Download URL: rosbag_slam_lint-0.3.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rosbag_slam_lint-0.3.2.tar.gz
Algorithm Hash digest
SHA256 5fe4ccbae0d2664b0fc30a94a63e28cdb5a27a46ad8b00ac7ffbf59d8dce061c
MD5 991d04acf4254836e3f14253e1d8441d
BLAKE2b-256 503e1a265452c7d377ae17a4e3e94b9ae2b410cad50a2a504f5dd572b726bab8

See more details on using hashes here.

File details

Details for the file rosbag_slam_lint-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rosbag_slam_lint-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11f0d4fc0390ebe7df55e29001184f1ae32b4d8ea333ed49731d186d1acd4642
MD5 ee7d5f3dd951ababf90fadbdb5a8e364
BLAKE2b-256 e153167f4bc6332912cf1e5bcb2053c21d820ccb18e26317020151ab8312b0c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page