Skip to content

Commit 5e36037

Browse files
committed
Merge remote-tracking branch 'origin/main' into ipc-coupling-squashed
2 parents 23442d1 + f7a45a1 commit 5e36037

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1308
-978
lines changed

.github/workflows/alarm.yml

Lines changed: 200 additions & 85 deletions
Large diffs are not rendered by default.

.github/workflows/generic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
PY_COLORS: "1"
6969
GS_CACHE_FILE_PATH: ".cache/genesis"
7070
GS_ENABLE_NDARRAY: ${{ matrix.GS_ENABLE_NDARRAY }}
71+
# FIXME: Disabling fastcache because it causes crashes for some reason...
72+
GS_ENABLE_FASTCACHE: "0"
7173
GS_TORCH_FORCE_CPU_DEVICE: ${{ startsWith(matrix.OS, 'macos-') && '1' || '0' }}
7274
TI_OFFLINE_CACHE: "1"
7375
TI_OFFLINE_CACHE_CLEANING_POLICY: "never"

.github/workflows/production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
pip install --no-input --extra-index-url https://pypi.nvidia.com/ omniverse-kit
7979
pip install --no-input ".[dev,render,usd]"
8080
81-
pytest -v -rs --backend gpu --dev --forked ./tests
81+
pytest -v -ra --backend gpu --dev --forked ./tests
8282
EOF
8383
- name: Kill srun job systematically
8484
if: always()

examples/collision/pyramid.py

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,42 @@
55

66
def main():
77
parser = argparse.ArgumentParser()
8-
parser.add_argument("--pile_type", type=str, default="falling", choices=["static", "falling"])
9-
parser.add_argument("--num_cubes", type=int, default=5, choices=range(5, 11))
10-
parser.add_argument("--cpu", action="store_true", help="Use CPU backend instead of GPU")
11-
parser.add_argument("--steps", type=int, default=100)
8+
parser.add_argument("--pile_type", type=str, default="falling", choices=("static", "falling"))
9+
parser.add_argument("--num_cubes", type=int, default=5, choices=(5, 6, 7, 8, 9, 10))
10+
parser.add_argument("--cpu", action="store_true", help="Use CPU backend instead of GPU", default=True)
11+
parser.add_argument("--steps", type=int, default=150)
1212
parser.add_argument("-v", "--vis", action="store_true", default=False)
13-
1413
args = parser.parse_args()
1514

16-
pile_type = args.pile_type
17-
num_cubes = args.num_cubes
18-
cpu = args.cpu
19-
backend = gs.cpu if cpu else gs.gpu
20-
21-
gs.init(backend=backend, precision="32")
15+
gs.init(backend=gs.cpu if args.cpu else gs.gpu, precision="32")
2216

2317
scene = gs.Scene(
2418
sim_options=gs.options.SimOptions(
2519
dt=0.01,
2620
),
27-
rigid_options=gs.options.RigidOptions(
28-
box_box_detection=False,
29-
max_collision_pairs=1000,
30-
use_gjk_collision=True,
31-
enable_mujoco_compatibility=False,
32-
),
3321
viewer_options=gs.options.ViewerOptions(
3422
camera_pos=(0, -5.5, 2.5),
3523
camera_lookat=(0, 0.0, 1.5),
36-
camera_fov=30,
3724
max_FPS=60,
3825
),
3926
show_viewer=args.vis,
4027
)
4128

42-
plane = scene.add_entity(gs.morphs.Plane(pos=(0, 0, 0)))
29+
plane = scene.add_entity(gs.morphs.Plane())
4330

4431
# create pyramid of boxes
4532
box_size = 0.25
46-
if pile_type == "static":
47-
box_spacing = box_size
48-
else:
49-
box_spacing = 1.1 * box_size
50-
vec_one = np.array([1.0, 1.0, 1.0])
51-
box_pos_offset = (0 - 0.5, 1, 0.0) + 0.5 * box_size * vec_one
33+
box_spacing = (1.0 - 1e-3 + 0.1 * (args.pile_type == "static")) * box_size
34+
box_pos_offset = (-0.5, 1, 0.0) + 0.5 * np.array([box_size, box_size, box_size])
5235
boxes = {}
53-
for i in range(num_cubes):
54-
for j in range(num_cubes - i):
36+
for i in range(args.num_cubes):
37+
for j in range(args.num_cubes - i):
5538
box = scene.add_entity(
5639
gs.morphs.Box(
57-
size=box_size * vec_one, pos=box_pos_offset + box_spacing * np.array([i + 0.5 * j, 0, j])
40+
size=[box_size, box_size, box_size],
41+
pos=box_pos_offset + box_spacing * np.array([i + 0.5 * j, 0, j]),
5842
),
43+
# visualize_contact=True,
5944
)
6045

6146
scene.build()

examples/collision/tower.py

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
import numpy as np
2-
import genesis as gs
31
import argparse
42

3+
import genesis as gs
4+
55

66
def main():
77
parser = argparse.ArgumentParser()
8-
parser.add_argument(
9-
"--object",
10-
type=str,
11-
default="cylinder",
12-
choices=["sphere", "cylinder", "duck"],
13-
)
8+
parser.add_argument("--object", type=str, default="cylinder", choices=("sphere", "cylinder", "duck"))
149
parser.add_argument("-v", "--vis", action="store_true", default=False)
1510
args = parser.parse_args()
1611
object_type = args.object
@@ -22,46 +17,37 @@ def main():
2217
dt=0.005,
2318
),
2419
rigid_options=gs.options.RigidOptions(
25-
box_box_detection=False,
26-
max_collision_pairs=2000,
27-
use_gjk_collision=True,
28-
enable_mujoco_compatibility=False,
20+
max_collision_pairs=200,
2921
),
3022
viewer_options=gs.options.ViewerOptions(
3123
camera_pos=(20, -20, 20),
3224
camera_lookat=(0.0, 0.0, 5.0),
33-
camera_fov=30,
3425
max_FPS=60,
3526
),
3627
show_viewer=args.vis,
3728
)
3829

39-
plane = scene.add_entity(gs.morphs.Plane(pos=(0, 0, 0)))
30+
plane = scene.add_entity(gs.morphs.Plane())
4031

4132
# create pyramid of boxes
42-
box_width = 0.25
43-
box_length = 2.0
44-
box_height = 0.1
33+
box_width, box_length, box_height = 0.25, 2.0, 0.1
4534
num_stacks = 50
46-
height_offset = 0.0
4735
for i in range(num_stacks):
48-
horizontal = i % 2 == 0
49-
50-
if horizontal:
51-
box_size = np.array([box_width, box_length, box_height])
52-
box_pos_0 = (-0.4 * box_length, 0, i * (height_offset + box_size[2]) + 0.5 * box_size[2])
53-
box_pos_1 = (+0.4 * box_length, 0, i * (height_offset + box_size[2]) + 0.5 * box_size[2])
54-
else:
55-
box_size = np.array([box_length, box_width, box_height])
56-
box_pos_0 = (0, -0.4 * box_length, i * (height_offset + box_size[2]) + 0.5 * box_size[2])
57-
box_pos_1 = (0, +0.4 * box_length, i * (height_offset + box_size[2]) + 0.5 * box_size[2])
58-
59-
scene.add_entity(
60-
gs.morphs.Box(size=box_size, pos=box_pos_0),
61-
)
62-
scene.add_entity(
63-
gs.morphs.Box(size=box_size, pos=box_pos_1),
64-
)
36+
if i % 2 == 0: # horizontal stack
37+
box_size = (box_width, box_length, box_height)
38+
box_pos_0 = (-0.4 * box_length, 0, i * (box_height - 1e-3) + 0.5 * box_height)
39+
box_pos_1 = (+0.4 * box_length, 0, i * (box_height - 1e-3) + 0.5 * box_height)
40+
else: # vertical stack
41+
box_size = (box_length, box_width, box_height)
42+
box_pos_0 = (0, -0.4 * box_length, i * (box_height - 1e-3) + 0.5 * box_height)
43+
box_pos_1 = (0, +0.4 * box_length, i * (box_height - 1e-3) + 0.5 * box_height)
44+
for box_pos in (box_pos_0, box_pos_1):
45+
scene.add_entity(
46+
gs.morphs.Box(
47+
size=box_size,
48+
pos=box_pos,
49+
),
50+
)
6551

6652
# Drop a huge mesh
6753
if object_type == "duck":
@@ -70,29 +56,29 @@ def main():
7056
morph=gs.morphs.Mesh(
7157
file="meshes/duck.obj",
7258
scale=duck_scale,
73-
pos=(0, 0, num_stacks * (height_offset + box_height) + 10 * duck_scale),
59+
pos=(0, 0, num_stacks * box_height + 10 * duck_scale),
7460
),
7561
)
7662
elif object_type == "sphere":
7763
sphere_radius = 2.0
7864
scene.add_entity(
7965
morph=gs.morphs.Sphere(
80-
radius=sphere_radius, pos=(0.0, 0.0, num_stacks * (height_offset + box_height) + 5 * sphere_radius)
66+
radius=sphere_radius,
67+
pos=(0.0, 0.0, num_stacks * box_height + 5 * sphere_radius),
8168
),
8269
)
8370
elif object_type == "cylinder":
84-
cylinder_radius = 2.0
85-
cylinder_height = 1.0
71+
cylinder_radius, cylinder_height = 2.0, 1.0
8672
scene.add_entity(
8773
morph=gs.morphs.Cylinder(
8874
radius=cylinder_radius,
8975
height=cylinder_height,
90-
pos=(0.0, 0.0, num_stacks * (height_offset + box_height) + 5 * cylinder_height),
76+
pos=(0.0, 0.0, num_stacks * box_height + 5 * cylinder_height),
9177
),
9278
)
9379

9480
scene.build()
95-
for i in range(500):
81+
for i in range(600):
9682
scene.step()
9783

9884

examples/manipulation/grasp_env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def __init__(
7575
size=env_cfg["box_size"],
7676
fixed=env_cfg["box_fixed"],
7777
collision=env_cfg["box_collision"],
78+
batch_fixed_verts=True,
7879
),
7980
# material=gs.materials.Rigid(gravity_compensation=1),
8081
surface=gs.surfaces.Rough(

examples/sensors/imu_franka.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def main():
5454
link_idx_local=end_effector.idx_local,
5555
pos_offset=(0.0, 0.0, 0.15),
5656
# noise parameters
57-
acc_axes_skew=(0.0, 0.01, 0.02),
58-
gyro_axes_skew=(0.03, 0.04, 0.05),
57+
acc_cross_axis_coupling=(0.0, 0.01, 0.02),
58+
gyro_cross_axis_coupling=(0.03, 0.04, 0.05),
5959
acc_noise=(0.01, 0.01, 0.01),
6060
gyro_noise=(0.01, 0.01, 0.01),
6161
acc_random_walk=(0.001, 0.001, 0.001),

examples/sensors/lidar_teleop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def main():
8787
max_FPS=60,
8888
),
8989
profiling_options=gs.options.ProfilingOptions(
90-
show_FPS=True,
90+
show_FPS=False,
9191
),
9292
show_viewer=True,
9393
)

examples/speed_benchmark/franka.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# with the following control: 43M FPS
3939
# without the following control (arm in collision with the floor): 32M FPS
4040
franka.control_dofs_position(
41-
torch.tile(torch.tensor([0, 0, 0, -1.0, 0, 0, 0, 0.02, 0.02], device=gs.device), (B, 1)),
41+
torch.tile(torch.tensor([0, 0, 0, -1.0, 0, 1.0, 0, 0.02, 0.02], device=gs.device), (B, 1)),
4242
)
4343

4444
for i in range(1000):

0 commit comments

Comments
 (0)