MCPcopy Create free account
hub / github.com/BeingBeyond/BeTTER / _render_startup

Function _render_startup

tools/render/render_episode.py:1117–1153  ·  view source on GitHub ↗
(
    *,
    args: argparse.Namespace,
    world: Any,
    stage: Any,
    episode: Any,
    robot: Any,
    cameras: Mapping[str, Any],
    states: list[dict[str, Any]],
)

Source from the content-addressed store, hash-verified

1115
1116
1117def _render_startup(
1118 *,
1119 args: argparse.Namespace,
1120 world: Any,
1121 stage: Any,
1122 episode: Any,
1123 robot: Any,
1124 cameras: Mapping[str, Any],
1125 states: list[dict[str, Any]],
1126) -> list[int]:
1127 frame_count = max(0, int(args.startup_frames))
1128 if frame_count <= 0:
1129 return []
1130
1131 sampled_indices = _startup_state_indices(
1132 state_count=len(states),
1133 frame_count=frame_count,
1134 sampling=str(args.startup_state_sampling),
1135 seed=int(args.startup_seed),
1136 )
1137 for frame_index in range(frame_count):
1138 if sampled_indices:
1139 state_row = states[sampled_indices[frame_index]]
1140 _restore_state_row(
1141 args=args,
1142 stage=stage,
1143 episode=episode,
1144 robot=robot,
1145 state_row=state_row,
1146 )
1147 _render_frame(
1148 world,
1149 step_physics=bool(args.step_physics),
1150 physics_steps_per_render=1,
1151 )
1152 _prime_camera_buffers(cameras)
1153 return sampled_indices
1154
1155
1156def _startup_state_indices(

Callers 1

mainFunction · 0.85

Calls 4

_startup_state_indicesFunction · 0.85
_restore_state_rowFunction · 0.85
_render_frameFunction · 0.85
_prime_camera_buffersFunction · 0.85

Tested by

no test coverage detected