Skip to content

feat(msgs): functional lyrical distro support via feature-selected asset trees - #344

Open
richardw347 wants to merge 1 commit into
ZettaScaleLabs:mainfrom
richardw347:feat/lyrical-distro
Open

feat(msgs): functional lyrical distro support via feature-selected asset trees#344
richardw347 wants to merge 1 commit into
ZettaScaleLabs:mainfrom
richardw347:feat/lyrical-distro

Conversation

@richardw347

Copy link
Copy Markdown

Summary

The lyrical (and rolling/kilted) Cargo features already exist on the
hiroz crate, but they are non-functional — enabling --features lyrical
silently generates jazzy messages:

  • hiroz_codegen::bundled_assets_dir(is_humble) only maps to "humble"/"jazzy".
  • hiroz-msgs/build.rs selects packages via an environment probe
    (detect_ros_version() reading AMENT_PREFIX_PATH) plus a hand-maintained
    allow-list (get_all_packages), neither of which is distro-feature aware.
  • There is no assets/lyrical/ tree.

This PR makes distro selection real and feature-driven, and finishes the
lyrical support the feature flags already advertise.

Changes

  • Distro enum (Humble/Jazzy/Lyrical) selected from Cargo features via
    Distro::from_features(). Defaults to Jazzy when no distro feature is
    set — no behavior change for existing users.
  • Asset-tree enumeration replaces the env-probe + allow-list: every package
    directory under hiroz-codegen/assets/<distro>/ (one containing msg/,
    srv/, or action/) is generated. Adding a package is just dropping its
    interface files into the tree — no build.rs edit. (test_msgs /
    test_interface_files stay excluded, as before, because their wstring/Nested
    fixtures don't compile.)
  • hiroz_codegen::bundled_assets_dir_for(distro: &str) added; the existing
    bundled_assets_dir(is_humble) now routes through it (kept for compatibility).
  • assets/lyrical/ — the stock upstream ROS 2 interface set (25 standard
    packages: std_msgs, sensor_msgs, geometry_msgs, nav_msgs,
    action_msgs, builtin_interfaces, rcl_interfaces, tf2_msgs,
    vision_msgs, type_description_interfaces, …). Shipped to crates.io via the
    existing assets/** include globs in hiroz-codegen/Cargo.toml.

build.rs shrinks substantially (the allow-list + system-package probing +
detect_ros_version are all removed in favor of enumeration).

Verification

cargo build -p hiroz-msgs --no-default-features --features core_msgs,lyrical
  → target ROS distro: lyrical
  → generating 25 packages from assets/lyrical

cargo build -p hiroz-msgs --no-default-features --features core_msgs,jazzy
  → target ROS distro: jazzy
  → generating 24 packages from assets/jazzy   (unchanged)

Notes / open questions for the maintainer

  • Default: kept at jazzy to preserve current behavior. Happy to change if
    you'd prefer newest-available or an explicit-required selection.
  • Asset set: assets/lyrical/ is stock upstream interfaces only. One
    package, ffmpeg_image_transport_msgs, is community (not ROS-core) — included
    because it round-trips cleanly, but easy to drop from the tree if you'd rather
    keep only core/common_interfaces.
  • rolling/kilted: those feature flags still map to no asset tree; this PR
    only adds lyrical. The enumeration mechanism makes adding them trivial later
    (drop an assets/rolling/ tree + a Distro arm).

…set trees

The lyrical/rolling/kilted Cargo features already existed but were
non-functional: bundled_assets_dir() hardcoded jazzy, build.rs selected
packages via an env-probe (detect_ros_version) + a hand-maintained
allow-list (get_all_packages), and there was no assets/lyrical/ tree. So
`--features lyrical` silently generated jazzy messages.

Make distro selection real and feature-driven:
- Add a Distro enum (Humble/Jazzy/Lyrical) chosen from Cargo features via
  from_features() (defaults to Jazzy — no behavior change for existing
  users).
- Replace the env-probe + allow-list with asset-tree enumeration: every
  package dir under hiroz-codegen/assets/<distro>/ is generated, so adding
  a package is just dropping its interface files in the tree.
- Add hiroz_codegen::bundled_assets_dir_for(distro) and route
  bundled_assets_dir(is_humble) through it.
- Add the stock upstream assets/lyrical/ tree (25 standard interface
  packages; shipped to crates.io via the existing assets/** include globs).

Verified: `--features lyrical` generates 25 packages from assets/lyrical;
`--features jazzy` unchanged (24 packages from assets/jazzy).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Sep 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants