Migrate CuroboPolicy to cuRobo main API (MotionPlanner / DeviceCfg / GoalToolPose)
## Background
PR #306 introduced `CuroboPolicy` targeting cuRobo's `0.7.x` API surface
(`MotionGen` / `MotionGenConfig` / `WorldConfig`). Validation by
@cagataycali on NVIDIA Thor (sm_110, CUDA 13) — see
[PR #306 comment](https://github.com/strands-labs/robots/pull/306#issuecomment-4700020819)
— confirms the stub-based unit tests (42/42) pass and the policy
architecture is solid, but flags that cuRobo's public Python API has
been restructured on `main` and the live code paths in
`strands_robots/policies/curobo/policy.py` will not import against a
fresh install of cuRobo from `NVlabs/curobo` source today.
## API mapping (per Thor validation)
| Current code (PR #306) | New cuRobo API on `main` |
|---|---|
| `curobo.types.base.TensorDeviceType` | `curobo.types.DeviceCfg` |
| `curobo.types.state.JointState` | `curobo.types.JointState` |
| `curobo.types.math.Pose` | `curobo.types.Pose` (planning needs `GoalToolPose`) |
| `curobo.wrap.reacher.motion_gen.MotionGen` | `curobo.motion_planner.MotionPlanner` |
| `curobo.wrap.reacher.motion_gen.MotionGenConfig` | `curobo.motion_planner.MotionPlannerCfg` |
| `curobo.geom.types.WorldConfig` | Removed — scene goes via `MotionPlannerCfg.create(scene_model=...)` |
Shape changes:
- `MotionGen.plan_single(start, goal_pose)` -> `MotionPlanner.plan_pose(GoalToolPose, JointState)`
- `GoalToolPose` requires 5D tensors `[B,H,L,G,3]` and explicit `tool_frames`
- `MotionGenConfig.load_from_robot_config(...)` -> `MotionPlannerCfg.create(robot=...)`
- `TensorDeviceType()` -> `DeviceCfg(device=torch.device('cuda:0'))`
## Scope
Update the following internal helpers in `strands_robots/policies/curobo/policy.py`
to the restructured API while keeping the public surface (`get_actions`,
`reset`, `set_robot_state_keys`, the well-known `target_pose` /
`target_joints` / `world_update` kwargs) backwards-compatible:
- `_build_motion_gen` — switch to `MotionPlannerCfg.create` + `MotionPlanner`
- `_build_start_state` — replace `TensorDeviceType` with `DeviceCfg`
- `_build_goal_pose` — emit `GoalToolPose` 5D tensors; resolve `tool_frames` from `planner.kinematics`
- `_build_goal_joint_state` — same `DeviceCfg` swap; verify `JointState.from_position` import path
- `_apply_world_update` — re-route through `MotionPlannerCfg.create(scene_model=...)` since `WorldConfig` is removed
## Validation requirements
This is GPU-bound work. Acceptance:
1. Existing 42 stub-based smoke tests still pass (no regressions in the
test seam that lets unit tests inject a stub planner without CUDA).
2. The 3 integration tests in `tests_integ/policies/curobo/test_curobo_live.py`
pass against current cuRobo `main` on a real CUDA device. Reuse the
Franka-7DOF reach-to-pose sanity-check from the Thor validation
report as a fourth sanity test.
3. README + module docstring updated with any new install-version
guidance once cuRobo cuts a stable release / publishes wheels.
4. Module-level `[curobo]` extra in `pyproject.toml` re-pinned at the
first stable cuRobo PyPI release if/when it ships; otherwise leave
the extra empty and keep the source-install recipe in the README
(current state on PR #306 head).
## Out of scope
- The cuRobo `main` API may continue to shift; pin the integration test
to a specific cuRobo commit if necessary, with the commit SHA noted
in the test docstring.
- Goal-set / batched planning (`plan_goalset`, `plan_batch`) was already
marked as a separate follow-up in PR #306's "Out-of-scope follow-ups"
section.
## Linked
- PR #306 — initial CuroboPolicy implementation (closes #301)
- #299 — umbrella for non-VLA Policy providers
- [Thor validation comment](https://github.com/strands-labs/robots/pull/306#issuecomment-4700020819) by @cagataycali
0 条评论