Skip to content

Add per-articulation SimOptions priority and conflict resolver#43

Open
jonathanembleyriches wants to merge 1 commit intomainfrom
feat/simoptions_priority_resolution
Open

Add per-articulation SimOptions priority and conflict resolver#43
jonathanembleyriches wants to merge 1 commit intomainfrom
feat/simoptions_priority_resolution

Conversation

@jonathanembleyriches
Copy link
Copy Markdown
Contributor

Summary

  • New FMuJoCoOptions::Resolve runs between every articulation's mjs_attach and mj_compile. Per-field, bOverride_* gated, priority based. Articulations that don't fight over a field all contribute; genuine disagreements go to the highest SimOptionsPriority with a WARNING per conflicting field and an editor modal listing them.
  • New int32 SimOptionsPriority UPROPERTY on AMjArticulation. Default 0, ties break on actor iteration order (second warning when that happens).
  • New docs/guides/sim_options_priority.md guide, referenced from the Getting Started troubleshooting section, the home-page guides table, and the mkdocs nav.

Motivation

Related to the closed PR #34. MuJoCo's mjs_attach silently drops each child spec's <option> block during compile, so per-articulation option authoring was a no-op in any scene with multiple robots. The resolver fills that gap while keeping per-articulation authoring honest: every robot's settings apply where they don't fight, conflicts are resolved deterministically, and the user sees a loud dialog and log entry summarising any real disagreement. The Manager's Options post-compile override is unchanged and continues to act as a full override on top.

Linked issue

Related to the closed PR #34.

Build + test evidence

=== URLab build+test summary ===
Timestamp : 2026-04-22 21:48:29 UTC
Host      : buzz-main
Git HEAD  : 7417660c (feat/simoptions_priority_resolution)
Engine    : C:\Program Files\Epic Games\UE_5.7
Build     : Succeeded
Tests     : 182 / 182 passed (0 failed)  [182 tests performed]
Log sha256: 148849b7e36197af
================================

Five new tests under URLab.SimOptions.*: single articulation applies cleanly, two articulations agreeing are silent, disagreement with different priorities picks the higher, same priority ties resolve on actor order, Manager override wins over resolver. 177 prior tests unaffected.

Manual verification

  1. Place two MjArticulation actors in a level.
  2. On both, tick SimOptions.bOverride_Timestep and set different values (e.g. 0.002 vs 0.005).
  3. Give them different SimOptionsPriority (e.g. 5 vs 0).
  4. Hit Play.
  5. A modal "SimOptions Conflict" dialog appears with a Timestep bullet, an APPLIED: line showing the winner, a clickable "Open SimOptions Priority guide in browser" hyperlink, and a Dismiss button. Output Log shows the per-field conflict entry plus a tail line pointing at the guide URL.
  6. Tick bOverride_Timestep on the MjManager's Options with another value, Play again. No dialog (Manager is a full override and bypasses the resolver); m_model->opt.timestep matches the Manager's value.

Checklist

  • Builds locally against UE 5.7+
  • 182 / 182 URLab automation tests pass (177 prior + 5 new)
  • Docs added (new guide + troubleshooting entry + nav refs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant