Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.

feat: port bno085/vl53l1x/zed_f9p/oak_d_lite to phoxal 0.16#8

Merged
jBernavaPrah merged 1 commit into
mainfrom
feat/port-sensor-drivers
Jun 28, 2026
Merged

feat: port bno085/vl53l1x/zed_f9p/oak_d_lite to phoxal 0.16#8
jBernavaPrah merged 1 commit into
mainfrom
feat/port-sensor-drivers

Conversation

@jBernavaPrah

Copy link
Copy Markdown
Contributor

What

Ports the four remaining sensor component drivers from the old phoxal 0.9 Runtime trait onto the new #[derive(phoxal::Runtime)] pattern (matching the already-migrated ddsm115), publishing the recovered y2026_1 component-capability contracts (framework #108, shipped in phoxal 0.16.0).

driver capabilities published
bno085 imu, accelerometer, gyroscope
vl53l1x range (distance seeded from the Range capability's max_range_m)
zed_f9p gnss (was previously unimplemented → now a working stub publisher)
oak_d_lite camera (per distinct id: left_mono/rgb/right_mono) + depth + imu + accelerometer + gyroscope

Design

  • Model-driven capability discovery. Each driver reads its instance's capabilities from the resolved model (ctx.robot()?.component_for_instance(&instance)) instead of hardcoding ids, so a component with multiple same-kind capabilities — oak_d_lite's three cameras — is handled by binding one publisher per capability id. The derive recognizes Vec<Publisher<T>> and reports each contract once.
  • Fixed clock + per-capability divisor. #[step(hz=N)] needs a compile-time literal, so each driver runs at a fixed max rate and gates each capability with divisor = round(step_hz / publish_rate_hz), reproducing the old per-capability publish rates.
  • Simulation stubs. Backends emit representative zero/identity samples — exactly as the old bno085/vl53l1x were stubs (and zed_f9p/oak_d_lite were unimplemented). Real hardware backends are a follow-up.

Workspace

Moves to phoxal = "0.16" (including ddsm115, now on the workspace dep). Per-crate clap/tokio/async-trait/tracing dropped (the framework owns the runtime + CLI parsing). Old src/runtime.rs modules removed; each driver is a single src/main.rs.

Verification

  • cargo build, cargo test (11 tests), cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --all -- --check — all green
  • Per-driver emit-apis tests assert the expected publish contracts; helper tests cover the divisor + frame-sizing logic
  • Reviewer cross-check: bodies field-by-field against the recovered api::component::* types; capability discovery validated against each component.yaml

🤖 Generated with Claude Code

Port the four remaining sensor component drivers from the old phoxal 0.9
Runtime trait onto the new #[derive(phoxal::Runtime)] pattern (matching the
already-migrated ddsm115), publishing the recovered y2026_1 component-capability
contracts.

- bno085: imu + accelerometer + gyroscope
- vl53l1x: range (distance from the Range capability's max_range_m)
- zed_f9p: gnss (was previously unimplemented; now a working stub publisher)
- oak_d_lite: camera (per distinct capability id: left_mono/rgb/right_mono) +
  depth + imu + accelerometer + gyroscope

Each driver discovers its capabilities from the resolved component model
(ctx.robot().component_for_instance) rather than hardcoding ids, so a component
with multiple same-kind capabilities (oak_d_lite's three cameras) is handled.
A fixed #[step] clock plus a per-capability divisor (round(step_hz /
publish_rate_hz)) reproduces the old per-capability publish rates. Backends are
simulation stubs (as the old bno085/vl53l1x were; zed_f9p/oak_d_lite were
unimplemented) - real hardware backends are a follow-up.

Workspace moves to phoxal 0.16 (incl. ddsm115); clap/tokio/async-trait/tracing
dropped per crate (the framework owns the runtime + CLI). Old src/runtime.rs
modules removed; each driver is a single src/main.rs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@jBernavaPrah
jBernavaPrah merged commit ff6194c into main Jun 28, 2026
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant