feat(checker): add BodyContactChecker matching Hub usage - #7
Open
keyneszeng wants to merge 1 commit into
Open
Conversation
Adds a new success-condition checker that detects when two MuJoCo bodies are in (or near) contact. This matches the BodyContactChecker type already used in production Hub task JSON (e.g. task 4694). Mirrors the Python implementation added in the companion PR to AxisDataCleaning, so JS and Python checks agree on the success condition for offline trajectory validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new success-condition checker that detects when two MuJoCo bodies are in (or near) contact. This matches the
BodyContactCheckertype already used in production Hub task JSON (e.g. task 4694, whosechecker_configis published via the public Hub API).Why
The Hub backend,
AxisDataCleaning(Python), and thisAxisWebInfra(JS) MUST agree on what counts as a successful task attempt. Until now, the JS side was missing 3 checkers that Hub already uses in production.This PR is part 1 of 3 to restore JS / Python / Hub parity.
Changes
src/components/mujoco-framework-next/checkers/BodyContactChecker.js(~270 lines incl. docstring)src/components/mujoco-framework-next/checkers/index.js— registered the new class and added thebody_contactaliasTask config schema (matches Hub)
{ "type": "BodyContactChecker", "body_a": "akita_black_bowl_1_main", "body_b": "plate_1_main", "max_contact_distance": 0.02, // meters; default 0 "min_contact_count": 1 // default 1 }Cross-repo coordination
data.contactarray and counts pairs(geom1, geom2)where one geom belongs tobody_aand the other tobody_b, withdist <= max_contact_distance.AxisDataCleaning): same semantics, but using AABB intersection + inflation (offline validation, no live MuJoCo).Verification
CheckerManagerwith mock data — constructor succeeds,check()returns the expected boolean,getStatus()produces the expected progress object.JS testing in real
mujoco-jsrequires Node + mujoco-js (I don't have it locally); happy to add a vitest harness if maintainers want.Checklist
snake_caseandcamelCase(Hub uses both)getStatus()/getProgress()/reset()/updateModelData()implemented