Skip to content

Commit a8f5c73

Browse files
vreutskyyclaude
andauthored
Fix overlapping humanoids in recording example (newton-physics#1865)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9f0df46 commit a8f5c73

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

newton/examples/basic/example_recording.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, viewer):
4545
self.sim_dt = self.frame_dt / self.sim_substeps
4646

4747
self.viewer = viewer
48-
self.world_count = 1000
48+
self.world_count = 100
4949

5050
# Set numpy random seed for reproducibility
5151
self.seed = 123
@@ -65,16 +65,12 @@ def __init__(self, viewer):
6565
# Joint initial positions
6666
articulation_builder.joint_q[:7] = [0.0, 0.0, 1.5, *start_rot]
6767

68-
spacing = 3.0
69-
sqn = int(wp.ceil(wp.sqrt(float(self.world_count))))
70-
7168
builder = newton.ModelBuilder()
72-
for i in range(self.world_count):
73-
pos = wp.vec3((i % sqn) * spacing, (i // sqn) * spacing, 0.0)
69+
for _i in range(self.world_count):
7470
articulation_builder.joint_q[7:] = self.rng.uniform(
7571
-1.0, 1.0, size=(len(articulation_builder.joint_q) - 7,)
7672
).tolist()
77-
builder.add_world(articulation_builder, xform=wp.transform(pos, wp.quat_identity()))
73+
builder.add_world(articulation_builder)
7874
builder.add_ground_plane()
7975

8076
# Finalize model

0 commit comments

Comments
 (0)