Add per-articulation SimOptions priority and conflict resolver#43
Open
jonathanembleyriches wants to merge 1 commit intomainfrom
Open
Add per-articulation SimOptions priority and conflict resolver#43jonathanembleyriches wants to merge 1 commit intomainfrom
jonathanembleyriches wants to merge 1 commit intomainfrom
Conversation
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
FMuJoCoOptions::Resolveruns between every articulation'smjs_attachandmj_compile. Per-field,bOverride_*gated, priority based. Articulations that don't fight over a field all contribute; genuine disagreements go to the highestSimOptionsPrioritywith a WARNING per conflicting field and an editor modal listing them.int32 SimOptionsPriorityUPROPERTY onAMjArticulation. Default 0, ties break on actor iteration order (second warning when that happens).docs/guides/sim_options_priority.mdguide, 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_attachsilently 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'sOptionspost-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
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
MjArticulationactors in a level.SimOptions.bOverride_Timestepand set different values (e.g.0.002vs0.005).SimOptionsPriority(e.g.5vs0).Timestepbullet, anAPPLIED: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.bOverride_Timestepon theMjManager'sOptionswith another value, Play again. No dialog (Manager is a full override and bypasses the resolver);m_model->opt.timestepmatches the Manager's value.Checklist