Skip to content

Add lab_sim joint and object-pose end-state checks#706

Open
shaur-k wants to merge 2 commits into
v9.4from
claude/lab-sim-end-state-checks
Open

Add lab_sim joint and object-pose end-state checks#706
shaur-k wants to merge 2 commits into
v9.4from
claude/lab-sim-end-state-checks

Conversation

@shaur-k

@shaur-k shaur-k commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

needs: moveit_pro/#19732

Motivation

Extends end-state correctness coverage (#698 added the first joint check) with a lab_sim joint check and the first manipulated-object pose check, so a pick/place that reports SUCCESS while dropping or misplacing the object is caught.

Brief description

  • "Look at Table" — joint end-state check against the saved waypoint, resolved at runtime from /get_saved_waypoints. Unlike hangar_sim, the full stored joint set (arm + rail + gripper) holds at its stored values, so no per-joint filtering (validated live: worst error 2.6e-3 rad across 8 joints).
  • "Move Flasks to Burners" — object-pose check on flask_1/flask_2 against MuJoCo TF ground truth (mj_world → <body> frames added by moveit_pro #19732). Landing repeatability measured < 3 mm across runs; the burners sit 0.11 m apart, so the default 0.05 m tolerance absorbs physics noise yet fails a flask on the wrong burner. Position-only — the flask is radially symmetric so final yaw is not deterministic.

Stacked on moveit_pro #19732 via the needs: token above: the object check reads TF frames that only exist with that PR's backend image.

How it was tested

Live against a lab_sim backend running this branch's moveit_pro counterpart: both objectives SUCCESS; real targets pass (joint worst 2.6e-3 rad; flask position error 0.8–3 mm); perturbed targets (+0.5 rad elbow / +0.10 m x) correctly fail — anti-no-op gate holds for both checks.


Note: temporarily carries the cuda13.2 needs:-suffix fix so this PR can run green before that fix merges. Once it lands on main, rebase and the commit drops.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fb742f8-6d57-43df-a73e-a007628e4109

📥 Commits

Reviewing files that changed from the base of the PR and between 2cc8f85 and b4f44f3.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • src/lab_sim/test/objectives_integration_test.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/ci.yaml
  • src/lab_sim/test/objectives_integration_test.py

📝 Walkthrough

Summary by CodeRabbit

  • Chores

    • Updated the default GPU CUDA variant for the Jazzy ROS distribution in CI to CUDA 13.2 with cuDNN 9 (replacing CUDA 12.6).
  • Tests

    • Strengthened objective integration tests by adding deterministic end-state correctness checks for selected objectives, improving simulation verification and objective execution validation.

Walkthrough

Updates CI to construct Jazzy GPU images with CUDA 13.2/cuDNN9 and adds deterministic end-state assertions for two objectives in the objectives integration test, with helper/data and injection into the test runner.

Changes

CI CUDA Suffix Update

Layer / File(s) Summary
Update Jazzy CUDA suffix
.github/workflows/ci.yaml
Updated the default gpu_image_suffixes mapping for jazzy from -cuda12.6-cudnn9 to -cuda13.2-cudnn9 in the resolve job's github-script.

End-state Assertions for Objectives

Layer / File(s) Summary
End-state types, data structures, and helper function
src/lab_sim/test/objectives_integration_test.py
Added imports for EndStateSpec, JointTarget, and ObjectPoseTarget; introduced constants and fixed world-frame pose targets for flask_1/flask_2; implemented _expected_end_state_by_id which returns joint-hold or object-pose EndStateSpec for the two selected objectives.
Integrate end-state assertions into test
src/lab_sim/test/objectives_integration_test.py
Modified test_all_objectives to compute expected_end_state_by_id for each objective and pass it into run_objective so only those objectives undergo end-state validation beyond success/cancel handling.

Possibly related PRs

Suggested reviewers

  • JWhitleyWork
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, detailing end-state correctness checks added to lab_sim integration tests and a temporary CI change for CUDA versioning.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Human Review Check ✅ Passed PR adds lab_sim integration test assertions and a temporary CUDA image tag update; changes are isolated to tests and documentation, with no public API, behavior, infra, or cost impacts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

MoveIt Pro Example WS - Objectives Integration Test Report

  • lab_sim
    • jazzy: no report produced — see run logs
  • hangar_sim
    • jazzy: no report produced — see run logs

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ This PR modifies 1 file(s) that also exist in PickNikRobotics/moveit_pro_empty_ws.

Consider whether the change should land upstream in moveit_pro_empty_ws first so downstream forks pick it up on the next sync.

Overlapping files
  • .github/workflows/ci.yaml

@github-actions

Copy link
Copy Markdown

MoveIt Pro Example WS - Objectives Integration Test Report

  • lab_sim
    • jazzy: no report produced — see run logs
  • hangar_sim
    • jazzy: no report produced — see run logs

@github-actions

Copy link
Copy Markdown

MoveIt Pro Example WS - Objectives Integration Test Report

@shaur-k shaur-k marked this pull request as ready for review June 11, 2026 16:33
@coderabbitai coderabbitai Bot requested a review from JWhitleyWork June 11, 2026 16:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/lab_sim/test/objectives_integration_test.py (1)

364-379: 💤 Low value

Consider modernizing the type annotation for consistency.

The return type uses Optional[dict[str, EndStateSpec]] while the hangar_sim equivalent (Context snippet 1) uses the PEP 604 union syntax dict[str, EndStateSpec] | None. For consistency across similar test files and alignment with modern Python practices, consider updating to the union syntax.

♻️ Proposed change
 def _expected_end_state_by_id(
     objective_id: str,
     resource: ExecuteObjectiveResource,
-) -> Optional[dict[str, EndStateSpec]]:
+) -> dict[str, EndStateSpec] | None:
     """Build the end-state spec for objectives we assert on; None otherwise.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lab_sim/test/objectives_integration_test.py` around lines 364 - 379,
Update the return type annotation of _expected_end_state_by_id from
Optional[dict[str, EndStateSpec]] to the modern PEP 604 union form dict[str,
EndStateSpec] | None; adjust imports accordingly (remove typing.Optional if it
becomes unused) and ensure the annotation appears exactly on the
_expected_end_state_by_id function signature so it matches the hangar_sim style.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yaml:
- Around line 111-120: The inline comment near the gpu_image_suffixes definition
incorrectly states that the old jazzy -cuda12.6 variant is “no longer built”;
update the comment to accurately reflect current Docker Hub state and/or clarify
intent: verify that gpu_image_suffixes = { jazzy: '-cuda13.2-cudnn9' } is the
default used by CI, then edit the comment to state that the CI/matrix now
defaults to -cuda13.2-cudnn9 (and that -cuda12.6 tags still exist on Docker Hub
but are intentionally not used by the matrix), or remove the categorical “no
longer built” phrase and replace it with a clear note that moveit_pro’s payload
overrides this value on repository_dispatch.

---

Nitpick comments:
In `@src/lab_sim/test/objectives_integration_test.py`:
- Around line 364-379: Update the return type annotation of
_expected_end_state_by_id from Optional[dict[str, EndStateSpec]] to the modern
PEP 604 union form dict[str, EndStateSpec] | None; adjust imports accordingly
(remove typing.Optional if it becomes unused) and ensure the annotation appears
exactly on the _expected_end_state_by_id function signature so it matches the
hangar_sim style.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c3da937f-f8c3-43ab-ac85-3d2faf3fd93a

📥 Commits

Reviewing files that changed from the base of the PR and between 816f95e and 2cc8f85.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • src/lab_sim/test/objectives_integration_test.py

Comment thread .github/workflows/ci.yaml
shaur-k and others added 2 commits June 11, 2026 10:42
Wire expected_end_state_by_id into the lab_sim integration suite for two
deterministic objectives: 'Look at Table' asserts the final joint state
against the saved waypoint (resolved at runtime via /get_saved_waypoints;
full joint set validated live at worst 2.6e-3 rad), and 'Move Flasks to
Burners' asserts flask_1/flask_2 landing positions against MuJoCo TF ground
truth (new mj_world -> <body> frames; repeatability measured < 3 mm,
burners 0.11 m apart so the 0.05 m default tolerance catches a wrong-burner
landing). Position-only for the flasks: final yaw is not deterministic.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Since the CUDA 13.2 migration, moveit_pro publishes jazzy images with the
-cuda13.2-cudnn9 suffix only; the conservative -cuda12.6 default made every
pull_request needs: run 404 on a tag that is no longer built. The
repository_dispatch path is unaffected (payload overrides).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@shaur-k shaur-k force-pushed the claude/lab-sim-end-state-checks branch from 2cc8f85 to b4f44f3 Compare June 11, 2026 16:42
@shaur-k shaur-k changed the base branch from main to v9.4 June 11, 2026 16:42
@shaur-k shaur-k added this to the 9.4.0 milestone Jun 11, 2026
@github-actions

Copy link
Copy Markdown

MoveIt Pro Example WS - Objectives Integration Test Report

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.

1 participant