Skip to content

Commit d1a07d5

Browse files
iblnknclaude
andcommitted
rosbag2 storage plugin for Rerun .rrd files
A rosbag2 storage plugin that records ROS 2 bags as Rerun `.rrd` files: a thin C++ pluginlib shim over a Rust core that does the CDR decoding, Arrow building and Rerun writing. Supports raw, reflected and lens representations, live streaming to a running viewer, layering onto an existing recording id, indexed seeking and replay through `ros2 bag play`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
0 parents  commit d1a07d5

55 files changed

Lines changed: 14998 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
BasedOnStyle: Google
2+
3+
# Make it slightly more similar to Rust.
4+
# Based loosely on https://gist.github.com/YodaEmbedding/c2c77dc693d11f3734d78489f9a6eea4
5+
AccessModifierOffset: -2
6+
AlignAfterOpenBracket: BlockIndent
7+
AllowAllArgumentsOnNextLine: false
8+
AllowShortBlocksOnASingleLine: false
9+
AllowShortCaseLabelsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: Empty
11+
AllowShortIfStatementsOnASingleLine: Never
12+
AlwaysBreakAfterReturnType: None
13+
AlwaysBreakBeforeMultilineStrings: true
14+
BinPackArguments: false
15+
BreakStringLiterals: false
16+
ColumnLimit: 100
17+
ContinuationIndentWidth: 4
18+
DerivePointerAlignment: false
19+
EmptyLineBeforeAccessModifier: LogicalBlock
20+
IndentWidth: 4
21+
IndentWrappedFunctionNames: true
22+
InsertBraces: true
23+
InsertTrailingCommas: Wrapped
24+
MaxEmptyLinesToKeep: 1
25+
NamespaceIndentation: All
26+
PointerAlignment: Left
27+
ReflowComments: false
28+
SeparateDefinitionBlocks: Always
29+
SpacesBeforeTrailingComments: 1
30+
31+
# Don't change include blocks, we want to control this manually.
32+
# Sorting headers however is allowed as all our headers should be standalone.
33+
IncludeBlocks: Preserve
34+
SortIncludes: CaseInsensitive

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto eol=lf
2+
Cargo.lock linguist-generated=false

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!--
2+
* Keep your PR:s small and focused.
3+
* The PR title is what ends up in the changelog, so make it descriptive!
4+
* If applicable, add a screenshot or gif.
5+
* Do NOT open PR:s from your `main` branch, as that makes it hard for maintainers to test and add commits to your PR.
6+
* Remember to run `cargo fmt` and `cargo clippy`.
7+
* Open the PR as a draft until you have self-reviewed it and it passes CI.
8+
* When you have addressed a PR comment, mark it as resolved.
9+
10+
Please be patient!
11+
-->
12+
13+
* Closes #ISSUE_NUMBER

.github/workflows/cargo_shear.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Cargo Shear
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
types: [opened, synchronize]
9+
10+
jobs:
11+
cargo-shear:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Install Cargo Shear
18+
uses: taiki-e/install-action@v2.48.7
19+
with:
20+
tool: cargo-shear@1.11.2
21+
22+
- name: Run Cargo Shear
23+
run: |
24+
cargo shear

.github/workflows/cpp.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
# The C++ shim is an ament package: CI for it needs a ROS 2 environment (robostack),
3+
# which is not set up yet. Manual trigger only until then.
4+
on:
5+
workflow_dispatch:
6+
7+
name: C++
8+
9+
jobs:
10+
cpp-check:
11+
name: C++
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: prefix-dev/setup-pixi@v0.8.8
17+
with:
18+
pixi-version: v0.77.1
19+
cache: true
20+
21+
- run: pixi run build
22+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PR Branch Name Check
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, synchronize]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
check-source-branch:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check PR source branch
15+
env:
16+
IS_FORK: ${{ github.event.pull_request.head.repo.fork }}
17+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
18+
run: |
19+
# Check if PR is from a fork
20+
if [[ "${IS_FORK}" == "true" ]]; then
21+
# Check if PR is from the master/main branch of a fork
22+
if [[ "${HEAD_REF}" == "master" || "${HEAD_REF}" == "main" ]]; then
23+
echo "ERROR: Pull requests from the master/main branch of forks are not allowed, because it prevents maintainers from contributing to your PR"
24+
echo "Please create a feature branch in your fork and submit the PR from that branch instead."
25+
exit 1
26+
fi
27+
fi
28+
29+
- name: Leave comment if PR is from master/main branch of fork d
30+
if: ${{ failure() }}
31+
uses: actions/github-script@v6
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
script: |
35+
github.rest.issues.createComment({
36+
issue_number: context.issue.number,
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
body: '⚠️ **ERROR:** Pull requests from the `master`/`main` branch of forks are not allowed, because it prevents maintainers from contributing to your PR. Please create a feature branch in your fork and submit the PR from that branch instead.'
40+
})

.github/workflows/labels.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
3+
# https://github.com/marketplace/actions/require-labels
4+
# Check for existence of labels
5+
# See all our labels at https://github.com/rerun-io/rerun/issues/labels
6+
7+
name: PR Labels
8+
9+
on:
10+
pull_request:
11+
types:
12+
- opened
13+
- synchronize
14+
- reopened
15+
- labeled
16+
- unlabeled
17+
18+
jobs:
19+
label:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check for a "do-not-merge" label
23+
uses: mheap/github-action-required-labels@v3
24+
with:
25+
mode: exactly
26+
count: 0
27+
labels: "do-not-merge"
28+
29+
- name: Require label "include in changelog" or "exclude from changelog"
30+
uses: mheap/github-action-required-labels@v3
31+
with:
32+
mode: minimum
33+
count: 1
34+
labels: "exclude from changelog, include in changelog"

.github/workflows/links.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
types: [ opened, synchronize ]
8+
9+
name: Link checker
10+
11+
jobs:
12+
link-checker:
13+
name: Check links
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Restore lychee cache
19+
uses: actions/cache@v4
20+
with:
21+
path: .lycheecache
22+
key: cache-lychee-${{ github.sha }}
23+
restore-keys: cache-lychee-
24+
25+
# Check https://github.com/lycheeverse/lychee on how to run locally.
26+
- name: Link Checker
27+
id: lychee
28+
uses: lycheeverse/lychee-action@v2
29+
with:
30+
fail: true
31+
# When given a directory, lychee checks only markdown, html and text files, everything else we have to glob in manually.
32+
args: |
33+
--root-dir . --cache --max-cache-age 1d . "**/*.rs" "**/*.toml" "**/*.hpp" "**/*.cpp" "**/CMakeLists.txt" "**/*.py" "**/*.yml"

.github/workflows/python.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
types: [ opened, synchronize ]
8+
9+
name: Python
10+
11+
jobs:
12+
python-check:
13+
name: Python
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: prefix-dev/setup-pixi@v0.8.8
19+
with:
20+
pixi-version: v0.77.1
21+
cache: true
22+
23+
- run: pixi run py-fmt-check
24+
25+
- run: pixi run py-lint

.github/workflows/rust.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
types: [ opened, synchronize ]
8+
9+
name: Rust
10+
11+
env:
12+
RUSTFLAGS: -D warnings
13+
RUSTDOCFLAGS: -D warnings
14+
15+
jobs:
16+
rust-check:
17+
name: Rust
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions-rust-lang/setup-rust-toolchain@v1
23+
with:
24+
components: rust-docs, clippy, rustfmt
25+
toolchain: 1.96.0
26+
override: true
27+
28+
- uses: prefix-dev/setup-pixi@v0.8.8
29+
with:
30+
pixi-version: v0.77.1
31+
32+
- name: Rustfmt
33+
run: pixi run cargo fmt --all -- --check
34+
35+
- name: check --all-features
36+
run: pixi run cargo check --all-features --all-targets
37+
38+
- name: check default features
39+
run: pixi run cargo check --all-targets
40+
41+
- name: check --no-default-features
42+
run: pixi run cargo check --no-default-features --all-targets
43+
44+
# No doc-tests: the one crate is a staticlib, which has no lib target to run them in.
45+
46+
- name: cargo doc --lib
47+
run: pixi run cargo doc --lib --no-deps --all-features
48+
49+
- name: cargo doc --document-private-items
50+
run: pixi run cargo doc --document-private-items --no-deps --all-features
51+
52+
- name: Build tests
53+
run: pixi run cargo build --tests --all-features
54+
55+
- name: Run test
56+
run: pixi run cargo test --all-features
57+
58+
- name: Clippy
59+
run: pixi run cargo clippy --all-targets --all-features -- -D warnings
60+
61+
# ---------------------------------------------------------------------------
62+
63+
# ---------------------------------------------------------------------------
64+
65+
cargo-deny:
66+
name: Check Rust dependencies (cargo-deny)
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v3
70+
- uses: EmbarkStudios/cargo-deny-action@v2
71+
with:
72+
rust-version: "1.96.0"
73+
log-level: warn
74+
command: check

0 commit comments

Comments
 (0)