MCPcopy Create free account
hub / github.com/RoboVerseOrg/RoboVerse / __init__

Method __init__

scripts/advanced/replay_state.py:110–188  ·  view source on GitHub ↗
(self, handler, scenario, args)

Source from the content-addressed store, hash-verified

108 """Manages scene randomization across multiple variants without environment restart."""
109
110 def __init__(self, handler, scenario, args):
111 self.handler = handler
112 self.scenario = scenario
113 self.args = args
114 self.scene_randomizer = None
115 self.light_randomizers = []
116
117 if not args.enable_scene:
118 log.info("Scene randomization disabled")
119 return
120
121 # Create scene configuration
122 log.info("=" * 70)
123 log.info("SCENE RANDOMIZATION SETUP")
124 log.info("=" * 70)
125 log.info(f" Scene type: {args.scene_type}")
126 log.info(f" Room size: {args.room_size}m x {args.room_size}m")
127 log.info(f" Wall height: {args.wall_height}m")
128 log.info(f" Material randomization: {'Enabled' if args.randomize_materials else 'Disabled'}")
129 log.info(f" Light randomization: {'Enabled' if args.randomize_lights else 'Disabled'}")
130 log.info(f" Base seed: {args.base_seed}")
131 log.info(f" Number of variants: {args.num_variants}")
132
133 # Create scene preset
134 if args.scene_type == "empty_room":
135 scene_cfg = ScenePresets.empty_room(
136 room_size=args.room_size,
137 wall_height=args.wall_height,
138 wall_thickness=0.1,
139 )
140 elif args.scene_type == "tabletop_workspace":
141 scene_cfg = ScenePresets.tabletop_workspace(
142 room_size=args.room_size,
143 wall_height=args.wall_height,
144 table_size=(1.8, 1.8, 0.1),
145 table_height=args.table_height,
146 )
147 elif args.scene_type == "floor_only":
148 scene_cfg = ScenePresets.floor_only(
149 floor_size=args.room_size,
150 floor_thickness=0.1,
151 )
152 else:
153 log.error(f"Unknown scene type: {args.scene_type}")
154 return
155
156 # Override material settings
157 if not args.randomize_materials:
158 log.info("\nUsing fixed materials")
159 scene_cfg.floor_materials = SceneMaterialPoolCfg(
160 material_paths=["roboverse_data/materials/arnold/Carpet/Carpet_Beige.mdl"],
161 selection_strategy="sequential",
162 )
163 scene_cfg.wall_materials = SceneMaterialPoolCfg(
164 material_paths=["roboverse_data/materials/arnold/Masonry/Stucco.mdl"],
165 selection_strategy="sequential",
166 )
167 scene_cfg.ceiling_materials = SceneMaterialPoolCfg(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected