Skip to content

Commit 05717d4

Browse files
awesomebytesclaude
andcommitted
Slim rclcppyy 0.2.0 onto the cppyy_kit suite (deprecation shims) (M3)
rclcppyy becomes the drop-in rclpy accelerator product on top of the cppyy_kit suite; the rclcpp core it carried was carved into rclcpp_kit (M1b) and the kits into their own packages. Replace the moved internals with re-export shims: - rclcppyy/bringup_rclcpp.py -> rclcpp_kit.bringup_rclcpp (silent: node.py/monkey.py use it internally). serialization / rosbag2_cpp / rosbag2_py_compat / tf -> the matching rclcpp_kit.* modules, each with a DeprecationWarning on import. All use importlib.import_module to fetch the real submodule (the package binds a bringup_rclcpp *function* over its submodule, so a plain import would shadow it). - rclcppyy/kits/*.py -> deprecation shims re-exporting the standalone kit packages (bt/pcl/ompl/nav2/moveit/control/cv/dbow_kit, cppyy_kit, cppyy_kit.freeze); a missing kit package raises a clear install hint, not a bare ModuleNotFoundError. - __init__.py: bringup stays eager; the moved submodules are exposed lazily via module __getattr__ so `import rclcppyy` doesn't fire the deprecation warnings for the product's own use, while `rclcppyy.tf` / `from rclcppyy import serialization` still resolve and warn. Dev/test wiring (pre-release, suite unpublished): a PYTHONPATH bridge exposes rclcpp_kit + cppyy_kit from a sibling cppyy_kit source checkout (workspace_activation.sh, CPPYY_KIT_SRC; only those two packages, so domain-kit shims still fail-with-hint). No file:// channel in pixi.lock (would not resolve on CI). ci.yml checks out awesomebytes/cppyy_kit for the bridge. The local recipe channel (pkg-build) stays for local recipe validation. Chosen over the local-conda channel because a committed file:// lock breaks CI/other machines; documented. Tests: the duplicated kit suites (they now live in the cppyy_kit repo) are removed and replaced by test/test_kit_shims.py (shim re-exports + warns / clear hint). The core suite is unchanged and passes against the shims. Release prep: version 0.2.0 (package.xml, pixi.toml); recipe run-deps gain ros-jazzy-rclcpp-kit + cppyy-kit; recipe/pkg-build/release.yml resolve them from the suite channel (local now -> awesomebytes post-publish). RELEASING.md documents the suite-first publish choreography. README reflects the new architecture + links the suite repo. Gates (local, ROS_DOMAIN_ID=57): build 0; lint 0; test 26 passed (core 16 + 10 kit- shim smokes); bench 3000 msgs, 0 dropped (parity with 0.1.0). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 4e753d0 commit 05717d4

38 files changed

Lines changed: 707 additions & 7383 deletions

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,24 @@ jobs:
1717
build-test:
1818
name: build + test + bench smoke
1919
runs-on: ubuntu-latest
20+
env:
21+
# M3 pre-release bridge: rclcppyy 0.2.0 imports rclcpp_kit / cppyy_kit (the
22+
# carved-out suite), which is not published to prefix.dev yet. Provide them
23+
# from a source checkout of the cppyy_kit repo; workspace_activation.sh puts
24+
# exactly those two packages on PYTHONPATH via CPPYY_KIT_SRC. Remove this
25+
# (and the checkout step) once rclcppyy depends on the published conda
26+
# packages (channel swap local/awesomebytes; see RELEASING.md).
27+
CPPYY_KIT_SRC: ${{ github.workspace }}/_cppyy_kit
2028
steps:
2129
- name: Checkout
2230
uses: actions/checkout@v5
2331

32+
- name: Checkout cppyy_kit (suite source for the pre-release bridge)
33+
uses: actions/checkout@v5
34+
with:
35+
repository: awesomebytes/cppyy_kit
36+
path: _cppyy_kit
37+
2438
- name: Set up pixi
2539
uses: prefix-dev/setup-pixi@v0.10.0
2640
with:

.github/workflows/release.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ jobs:
3838
# Only the packaging env; it doesn't pull the ROS/cppyy stack.
3939
environments: pkg
4040

41-
# rattler-build also runs the recipe's import smoke test in a fresh env.
41+
# rattler-build also runs the recipe's import smoke test in a fresh env, which
42+
# now resolves the 0.2.0 suite run-deps (ros-jazzy-rclcpp-kit, cppyy-kit) — so
43+
# the build must see the awesomebytes channel. RELEASE CHOREOGRAPHY: the suite
44+
# is published to awesomebytes BEFORE this rclcppyy release runs (RELEASING.md).
45+
# (Local dev uses `pixi run -e pkg pkg-build`, which points at the local
46+
# rattler-build channel instead of awesomebytes.)
4247
- name: Build conda package
43-
run: pixi run -e pkg pkg-build
48+
run: |
49+
pixi run -e pkg rattler-build build --recipe recipe/recipe.yaml \
50+
-c https://repo.prefix.dev/awesomebytes -c robostack-jazzy -c conda-forge \
51+
--output-dir output
4452
4553
# The point of releasing: a user with no clone gets a working install from
4654
# the channel alone. Reproduce that in a throwaway pixi workspace whose
@@ -53,7 +61,10 @@ jobs:
5361
cat > "$workdir/pixi.toml" <<EOF
5462
[workspace]
5563
name = "rclcppyy-artifact-test"
56-
channels = ["file://$GITHUB_WORKSPACE/output", "robostack-jazzy", "conda-forge"]
64+
# The freshly built rclcppyy is in output/; its 0.2.0 run-deps
65+
# (ros-jazzy-rclcpp-kit, cppyy-kit) come from awesomebytes (published
66+
# first, per RELEASING.md).
67+
channels = ["file://$GITHUB_WORKSPACE/output", "https://repo.prefix.dev/awesomebytes", "robostack-jazzy", "conda-forge"]
5768
platforms = ["linux-64"]
5869
version = "0.0.0"
5970

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ output/
1818
# build/ is already ignored above (DBoW2 lands in build/vendor/); data/ holds the
1919
# downloaded TUM RGB-D sequence and the ORBvoc vocabulary.
2020
data/
21+
22+
# M3 pre-release PYTHONPATH bridge (generated symlinks to the sibling cppyy_kit checkout)
23+
.suite_bridge/
24+
25+
# Local Claude agent state / worktrees
26+
.claude/

README.md

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,38 @@ no `LD_LIBRARY_PATH` or activation setup required. Message packages you publish
100100
or subscribe (e.g. `ros-jazzy-std-msgs`) are separate dependencies, as in any
101101
ROS 2 project.
102102

103+
## Architecture (0.2.0): rclcppyy on top of the cppyy_kit suite
104+
105+
As of **0.2.0**, rclcppyy is the **drop-in rclpy accelerator product** in a larger
106+
family. The reusable machinery it pioneered was extracted into the
107+
**[cppyy_kit suite](https://github.com/awesomebytes/cppyy_kit)**:
108+
109+
- **`cppyy_kit`** — the ROS-free base (load/keep-alive/callback/teardown friction
110+
primitives, the `freeze` PCH tooling).
111+
- **`rclcpp_kit`** — the ROS 2 core capability layer (rclcpp bringup, C++ message
112+
resolution/conversion, serialization, rosbag2, **tf**).
113+
- the domain **kits** (`bt_kit`, `pcl_kit`, `ompl_kit`, `nav2_kit`, `moveit_kit`,
114+
`control_kit`, `cv_kit`, `dbow_kit`).
115+
116+
rclcppyy keeps the brand and the one-line monkeypatch (`enable_cpp_acceleration`)
117+
and re-exports the moved pieces through **deprecation shims** — existing
118+
`from rclcppyy.bringup_rclcpp import ...`, `rclcppyy.tf`, `from rclcppyy.kits import
119+
bt_kit`, etc. keep working (with a `DeprecationWarning` pointing at the new home).
120+
New code should import `rclcpp_kit.*` and the standalone kit packages directly. See
121+
[`RELEASING.md`](RELEASING.md) for the suite/product publish order.
122+
103123
## Kits
104124

105-
Beyond `rclcpp` itself, this repo uses the same `cppyy` approach to drive other
106-
C++ robotics libraries from Python: a "kit" is a thin layer that mirrors the
107-
library's own API and hides only the `cppyy` friction (bringup, lifetime,
108-
crossing callbacks, teardown), rather than inventing a new one. Six kits exist
109-
today — [BehaviorTree.CPP](https://www.behaviortree.dev/) (no other Python binding
110-
of it exists), [PCL](https://pointclouds.org/), [OMPL](https://ompl.kavrakilab.org/),
111-
[Nav2](https://docs.nav2.org/), [MoveIt 2](https://moveit.ai/), and
112-
[ros2_control](https://control.ros.org/) — plus a vision loop-closure **tutorial**
113-
composing OpenCV + DBoW2 + GTSAM. The patterns common to all live in
114-
[`rclcppyy/kits/cppyy_kit.py`](rclcppyy/kits/cppyy_kit.py).
125+
The cppyy "kits" — a "kit" is a thin layer that mirrors a C++ library's own API and
126+
hides only the `cppyy` friction (bringup, lifetime, crossing callbacks, teardown) —
127+
now live in the **[cppyy_kit repo](https://github.com/awesomebytes/cppyy_kit)**:
128+
[BehaviorTree.CPP](https://www.behaviortree.dev/) (no other Python binding of it
129+
exists), [PCL](https://pointclouds.org/), [OMPL](https://ompl.kavrakilab.org/),
130+
[Nav2](https://docs.nav2.org/), [MoveIt 2](https://moveit.ai/),
131+
[ros2_control](https://control.ros.org/), plus a vision loop-closure tutorial
132+
composing OpenCV + DBoW2 + GTSAM. `rclcppyy.kits.*` remains as compatibility shims.
115133

116-
Measured results:
134+
Measured results (from the suite):
117135

118136
| Kit | What it shows | Number |
119137
|---|---|---|
@@ -127,24 +145,12 @@ Measured results:
127145
| L1 "freeze" (Cling PCH) | header parse eliminated | 890 ms → 6 ms (~140×); rclcpp 1.71 s → 6 ms |
128146
| L2 lowering | Python leaf → native `.so` | ~2.8× tick rate, identical output |
129147

130-
Quick run (each kit has its own opt-in pixi env):
131-
132-
```bash
133-
pixi run -e bt demo-bt-t01 # + demo-bt-t03 (mixed Python/C++/ROS tree)
134-
pixi run -e pcl bench-pcl
135-
pixi run -e ompl demo-ompl-plan
136-
pixi run -e nav2 demo-nav2-stack
137-
pixi run -e moveit demo-moveit-plan
138-
pixi run -e control demo-control-python
139-
pixi run -e vision demo-vision-loop
140-
```
141-
142-
More detail: [docs/kits/COMMON_PATTERNS.md](docs/kits/COMMON_PATTERNS.md) and
143-
[docs/kits/FREEZE.md](docs/kits/FREEZE.md); the vision walkthrough in
144-
[docs/tutorials/vision_loop_closure.md](docs/tutorials/vision_loop_closure.md);
145-
per-kit "why" docs [bt](docs/bt_kit/WHY.md), [pcl](docs/pcl_kit/WHY.md),
146-
[ompl](docs/ompl_kit/WHY.md), [nav2](docs/nav2_kit/WHY.md),
147-
[moveit](docs/moveit_kit/WHY.md), [control](docs/control_kit/WHY.md).
148+
Run the kit demos/benchmarks and read the per-kit `SKILL.md` / `WHY.md` / `REPORT.md`
149+
in the **[cppyy_kit repo](https://github.com/awesomebytes/cppyy_kit)** (each kit has
150+
its own opt-in pixi env there, e.g. `pixi run -e bt demo-bt-t01`,
151+
`pixi run -e pcl bench-pcl`, `pixi run -e vision demo-vision-loop`). The common-pattern
152+
playbook, the L0→L1→L2 freeze ladder, and the vision loop-closure walkthrough live
153+
there too.
148154

149155
## Setup
150156

RELEASING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Releasing rclcppyy (0.2.0+)
2+
3+
As of 0.2.0, rclcppyy is the **drop-in rclpy accelerator product built on top of the
4+
cppyy_kit suite**. Its rclcpp core was carved into the standalone `rclcpp_kit`
5+
package, and the cppyy kits into their own packages (the
6+
[cppyy_kit](https://github.com/awesomebytes/cppyy_kit) repo). rclcppyy re-exports the
7+
moved pieces through deprecation shims, so it now **depends on the suite at runtime**:
8+
9+
- `rclcppyy.bringup_rclcpp` / `serialization` / `rosbag2_cpp` / `rosbag2_py_compat` /
10+
`tf` → re-export `rclcpp_kit.*` (conda: `ros-jazzy-rclcpp-kit`).
11+
- `rclcppyy.kits.cppyy_kit` / `.freeze` → re-export `cppyy_kit` (conda: `cppyy-kit`).
12+
- `rclcppyy.kits.{bt,pcl,ompl,nav2,moveit,control,cv,dbow}_kit` → re-export the
13+
standalone kit packages, which the user installs separately if wanted.
14+
15+
This creates a **publish order**: the suite must be on the prefix.dev `awesomebytes`
16+
channel before an rclcppyy release can build, prove, and upload.
17+
18+
## Pre-release dev/test wiring (current state, suite unpublished)
19+
20+
The suite is not on `awesomebytes` yet (that needs Sam's prefix.dev authorization).
21+
Until then:
22+
23+
- **Dev + CI import** rclcpp_kit / cppyy_kit from a **sibling `cppyy_kit` source
24+
checkout** via a PYTHONPATH bridge — `workspace_activation.sh` puts exactly those
25+
two packages on `PYTHONPATH` (default `../cppyy_kit`; override with `CPPYY_KIT_SRC`).
26+
CI (`.github/workflows/ci.yml`) checks out `awesomebytes/cppyy_kit` and sets
27+
`CPPYY_KIT_SRC`. No file:// channel is committed to `pixi.lock` (it would not
28+
resolve on other machines / CI).
29+
- **Local recipe validation** uses a **local rattler-build channel**: `pixi run -e
30+
pkg pkg-build` passes `-c file://.../cppyy_kit/output` so the recipe's import-smoke
31+
test env can resolve the suite run-deps. (Build the suite's local channel first in
32+
the cppyy_kit repo: `pixi run -e pkg <suite pkg-build>`.)
33+
34+
## Release choreography (do these in order)
35+
36+
**Do not tag rclcppyy until step 1 is done.**
37+
38+
1. **Publish the suite** from the cppyy_kit repo to `awesomebytes` (needs Sam's
39+
prefix.dev auth): `cppyy-kit`, `ros-jazzy-rclcpp-kit`, and the domain kits, all
40+
artifact-proven from a fresh env first (the suite's own release discipline).
41+
42+
2. **Swap rclcppyy from the pre-release bridge to the published channel:**
43+
- `pixi.toml`: add channel `https://repo.prefix.dev/awesomebytes`; add deps
44+
`ros-jazzy-rclcpp-kit` and `cppyy-kit` (pin to the published version); re-lock
45+
(`pixi lock`).
46+
- Remove the pre-release bridge: the `# M3 PYTHONPATH bridge` block in
47+
`workspace_activation.sh`, and the `_cppyy_kit` checkout + `CPPYY_KIT_SRC` env in
48+
`.github/workflows/ci.yml`. (Real conda deps replace them.)
49+
- Optional: point the `pkg-build` task's `-c` at `awesomebytes` instead of the
50+
local path (or leave it for local dev; the release workflow already uses
51+
`awesomebytes` directly).
52+
53+
3. **Verify** on a clean checkout: `pixi run build`, `pixi run lint`, `pixi run test`
54+
(core suite + kit-shim smokes), `pixi run bench --variants rclcppyy --rate 1000
55+
--duration 3 --json` (≈3000 msgs, 0 dropped). Push; CI must be green.
56+
57+
4. **Tag `v0.2.0`.** `.github/workflows/release.yml` then: builds the
58+
`ros-jazzy-rclcppyy` conda package (recipe run-deps resolve from `awesomebytes`),
59+
proves it installs + runs a pub/sub roundtrip in a throwaway workspace whose
60+
channels include `awesomebytes`, and uploads via OIDC. `recipe/recipe.yaml` and
61+
`release.yml` are already prepared for this (they reference `awesomebytes`); step 2
62+
only touches the dev/CI wiring.
63+
64+
## Deprecation timeline
65+
66+
The `rclcppyy.*` re-export shims and `rclcppyy.kits.*` shims emit `DeprecationWarning`
67+
(except `rclcppyy.bringup_rclcpp`, which the product itself uses internally). They
68+
keep existing imports working across 0.2.x; plan removal for a later major bump once
69+
downstreams have moved to `rclcpp_kit.*` / the standalone kit packages.

package.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>rclcppyy</name>
5-
<version>0.1.0</version>
5+
<version>0.2.0</version>
66
<description>rclcpp bindings via cppyy and examples on how to use cppyy in ROS2</description>
77
<maintainer email="sammypfeiffer@gmail.com">Sam Pfeiffer</maintainer>
88
<license>BSD</license>
@@ -13,8 +13,11 @@
1313
<depend>rclpy</depend>
1414
<depend>rclcpp</depend>
1515

16-
<!-- cppyy is required (rclcppyy/bringup_rclcpp.py, node.py, serialization.py, etc.)
17-
but has no rosdep key; it is installed via conda-forge/pip. -->
16+
<!-- cppyy is required (node.py, monkeypatch, and transitively via rclcpp_kit) but
17+
has no rosdep key; it is installed via conda-forge/pip. Likewise the carved
18+
core now lives in rclcpp_kit (conda: ros-jazzy-rclcpp-kit) and the cppyy kit
19+
shims re-export cppyy_kit (conda: cppyy-kit); these have no rosdep keys and are
20+
declared as conda run-deps in recipe/recipe.yaml (0.2.0). -->
1821
<exec_depend>ament_index_python</exec_depend>
1922
<exec_depend>rosidl_runtime_py</exec_depend>
2023
<exec_depend>rosbag2_py</exec_depend>

0 commit comments

Comments
 (0)