Repository navigation
Conversation
Adds VisualRandomizer, which modifies an MjSpec before compilation: - background: attaches an external scene (e.g. a room) as static, collision-free visual geometry and strips ceilings and its lights - material: overwrites materials or assigns new ones to geoms, with optional mesh replacements that carry texture coordinates - lighting: replaces scene lights with sampled presets Each randomizer has an enabled flag that defaults to off. The randomizers never add joints, so the sim state layout stays compatible with recorded episodes. Also adds a helper that writes box-projected UVs for STL meshes.
SimEnvCreatorConfig gets a visual_randomization field. When set, the enabled randomizers are applied to the composed scene in create_model, seeded by the config seed. The sampled parameters are kept on the ModelComposer for inspection.
replay() accepts a list of ReplayVariants. Each variant names the randomizers applied together and a multiplier for the number of copies per episode, where a fractional part selects a deterministic subset of episodes. keep_original controls whether the unrandomized episodes are replayed as well, so e.g. background:1 and background+material:1 yield three times the source data. Each copy gets a seed derived from the base seed, episode uuid, variant and copy index. With variants, every recorded step stores the variant, seed and sampled parameters in info["visual_randomization"]. Without variants the replay behaves as before.
Example: rcs replay data out --variant background:1 --variant background+material:0.5
This branch has not been deployed
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.
VisualRandomizerfor background, material and lighting; each is off by default and doesn't break replay of recorded episodes.SimEnvCreatorConfig.visual_randomizationapplies the enabled randomizers when the env is created.replay()and the CLI gain--variant <randomizers>:<multiplier>,--keep-originaland--seed, e.g.--variant background+material:0.5.info["visual_randomization"].