Skip to content

Fix logically missing pieces in simulation and validation - #214

Merged
MRiabov merged 1 commit into
mainfrom
fix-missing-logic-simulation-9186077024790278615
Feb 20, 2026
Merged

MRiabov merged 1 commit into
mainfrom
fix-missing-logic-simulation-9186077024790278615

Conversation

@MRiabov

@MRiabov MRiabov commented Feb 20, 2026

Copy link
Copy Markdown
Owner

This PR addresses several areas of logically missing or incorrect functionality in the simulation and validation logic:

  1. to_mjcf Utility: Previously hardcoded to use the Genesis backend, which returned JSON instead of the MuJoCo XML format implied by its name and docstring. It now correctly uses the MuJoCo backend.
  2. Wire Failure Gating: Wire tension checks were incorrectly nested inside the FEM-only logic block in SimulationLoop. They have been moved outside to ensure electronics are validated regardless of whether FEM is enabled for the parts.
  3. ON_OFF Motor Control: The ON_OFF control mode (present in the enum) was unhandled in the simulation loop. It now uses a frequency-based square-wave toggle logic.
  4. MuJoCo Jitter Application: apply_jitter used hardcoded indices qpos[0:3], which only worked if the target object was the first moving body. It now dynamically resolves the correct joint index for any body.
  5. Configurable Actuators: MuJoCoSimulationBuilder previously hardcoded all actuators as "position" (servos). It now selects between "position", "velocity", and "motor" based on the part's control mode.
  6. Infrastructure Filtering: Added a filter to SimulationLoop to exclude bodies starting with zone_ from monitored collisions, preventing "forbid_zone_hit" failures caused by checking a site against its own parent body.
  7. Test Fixes: Updated tests/worker_heavy/test_node_validation.py to include assembly_definition.yaml, which is now a required file for the planner node.

Verified with custom tests and the existing test suite.


PR created automatically by Jules for task 9186077024790278615 started by @MRiabov

- Fixed `to_mjcf` bug in `worker_heavy/utils/validation.py` to use MuJoCo backend and return XML.
- Moved wire failure checks outside of `fem_enabled` block in `SimulationLoop`.
- Implemented `MotorControlMode.ON_OFF` in `worker_heavy/utils/validation.py`.
- Fixed `MuJoCoBackend.apply_jitter` to robustly find the free joint.
- Made actuator types configurable in `MuJoCoSimulationBuilder`.
- Added missing `zone_` body filtering in `SimulationLoop` to prevent unintended collision failures.
- Fixed an unrelated failure in `tests/worker_heavy/test_node_validation.py` by adding required file to test data.

Co-authored-by: MRiabov <108194191+MRiabov@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@MRiabov
MRiabov merged commit cc4c2b5 into main Feb 20, 2026
1 check passed
@MRiabov
MRiabov deleted the fix-missing-logic-simulation-9186077024790278615 branch February 20, 2026 10:39
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