warp-lang 0.11.0__py3-none-manylinux2014_x86_64.whl → 1.0.0__py3-none-manylinux2014_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of warp-lang might be problematic. Click here for more details.

Files changed (170) hide show
  1. warp/__init__.py +8 -0
  2. warp/bin/warp-clang.so +0 -0
  3. warp/bin/warp.so +0 -0
  4. warp/build.py +7 -6
  5. warp/build_dll.py +70 -79
  6. warp/builtins.py +10 -6
  7. warp/codegen.py +51 -19
  8. warp/config.py +7 -8
  9. warp/constants.py +3 -0
  10. warp/context.py +948 -245
  11. warp/dlpack.py +198 -113
  12. warp/examples/assets/bunny.usd +0 -0
  13. warp/examples/assets/cartpole.urdf +110 -0
  14. warp/examples/assets/crazyflie.usd +0 -0
  15. warp/examples/assets/cube.usda +42 -0
  16. warp/examples/assets/nv_ant.xml +92 -0
  17. warp/examples/assets/nv_humanoid.xml +183 -0
  18. warp/examples/assets/quadruped.urdf +268 -0
  19. warp/examples/assets/rocks.nvdb +0 -0
  20. warp/examples/assets/rocks.usd +0 -0
  21. warp/examples/assets/sphere.usda +56 -0
  22. warp/examples/assets/torus.usda +105 -0
  23. warp/examples/benchmarks/benchmark_api.py +383 -0
  24. warp/examples/benchmarks/benchmark_cloth.py +279 -0
  25. warp/examples/benchmarks/benchmark_cloth_cupy.py +88 -0
  26. warp/examples/benchmarks/benchmark_cloth_jax.py +100 -0
  27. warp/examples/benchmarks/benchmark_cloth_numba.py +142 -0
  28. warp/examples/benchmarks/benchmark_cloth_numpy.py +77 -0
  29. warp/examples/benchmarks/benchmark_cloth_pytorch.py +86 -0
  30. warp/examples/benchmarks/benchmark_cloth_taichi.py +112 -0
  31. warp/examples/benchmarks/benchmark_cloth_warp.py +146 -0
  32. warp/examples/benchmarks/benchmark_launches.py +295 -0
  33. warp/examples/core/example_dem.py +221 -0
  34. warp/examples/core/example_fluid.py +267 -0
  35. warp/examples/core/example_graph_capture.py +129 -0
  36. warp/examples/core/example_marching_cubes.py +177 -0
  37. warp/examples/core/example_mesh.py +154 -0
  38. warp/examples/core/example_mesh_intersect.py +193 -0
  39. warp/examples/core/example_nvdb.py +169 -0
  40. warp/examples/core/example_raycast.py +89 -0
  41. warp/examples/core/example_raymarch.py +178 -0
  42. warp/examples/core/example_render_opengl.py +141 -0
  43. warp/examples/core/example_sph.py +389 -0
  44. warp/examples/core/example_torch.py +181 -0
  45. warp/examples/core/example_wave.py +249 -0
  46. warp/examples/fem/bsr_utils.py +380 -0
  47. warp/examples/fem/example_apic_fluid.py +391 -0
  48. warp/examples/fem/example_convection_diffusion.py +168 -0
  49. warp/examples/fem/example_convection_diffusion_dg.py +209 -0
  50. warp/examples/fem/example_convection_diffusion_dg0.py +194 -0
  51. warp/examples/fem/example_deformed_geometry.py +159 -0
  52. warp/examples/fem/example_diffusion.py +173 -0
  53. warp/examples/fem/example_diffusion_3d.py +152 -0
  54. warp/examples/fem/example_diffusion_mgpu.py +214 -0
  55. warp/examples/fem/example_mixed_elasticity.py +222 -0
  56. warp/examples/fem/example_navier_stokes.py +243 -0
  57. warp/examples/fem/example_stokes.py +192 -0
  58. warp/examples/fem/example_stokes_transfer.py +249 -0
  59. warp/examples/fem/mesh_utils.py +109 -0
  60. warp/examples/fem/plot_utils.py +287 -0
  61. warp/examples/optim/example_bounce.py +248 -0
  62. warp/examples/optim/example_cloth_throw.py +210 -0
  63. warp/examples/optim/example_diffray.py +535 -0
  64. warp/examples/optim/example_drone.py +850 -0
  65. warp/examples/optim/example_inverse_kinematics.py +169 -0
  66. warp/examples/optim/example_inverse_kinematics_torch.py +170 -0
  67. warp/examples/optim/example_spring_cage.py +234 -0
  68. warp/examples/optim/example_trajectory.py +201 -0
  69. warp/examples/sim/example_cartpole.py +128 -0
  70. warp/examples/sim/example_cloth.py +184 -0
  71. warp/examples/sim/example_granular.py +113 -0
  72. warp/examples/sim/example_granular_collision_sdf.py +185 -0
  73. warp/examples/sim/example_jacobian_ik.py +213 -0
  74. warp/examples/sim/example_particle_chain.py +106 -0
  75. warp/examples/sim/example_quadruped.py +179 -0
  76. warp/examples/sim/example_rigid_chain.py +191 -0
  77. warp/examples/sim/example_rigid_contact.py +176 -0
  78. warp/examples/sim/example_rigid_force.py +126 -0
  79. warp/examples/sim/example_rigid_gyroscopic.py +97 -0
  80. warp/examples/sim/example_rigid_soft_contact.py +124 -0
  81. warp/examples/sim/example_soft_body.py +178 -0
  82. warp/fabric.py +29 -20
  83. warp/fem/cache.py +0 -1
  84. warp/fem/dirichlet.py +0 -2
  85. warp/fem/integrate.py +0 -1
  86. warp/jax.py +45 -0
  87. warp/jax_experimental.py +339 -0
  88. warp/native/builtin.h +12 -0
  89. warp/native/bvh.cu +18 -18
  90. warp/native/clang/clang.cpp +8 -3
  91. warp/native/cuda_util.cpp +94 -5
  92. warp/native/cuda_util.h +35 -6
  93. warp/native/cutlass_gemm.cpp +1 -1
  94. warp/native/cutlass_gemm.cu +4 -1
  95. warp/native/error.cpp +66 -0
  96. warp/native/error.h +27 -0
  97. warp/native/mesh.cu +2 -2
  98. warp/native/reduce.cu +4 -4
  99. warp/native/runlength_encode.cu +2 -2
  100. warp/native/scan.cu +2 -2
  101. warp/native/sparse.cu +0 -1
  102. warp/native/temp_buffer.h +2 -2
  103. warp/native/warp.cpp +95 -60
  104. warp/native/warp.cu +1053 -218
  105. warp/native/warp.h +49 -32
  106. warp/optim/linear.py +33 -16
  107. warp/render/render_opengl.py +202 -101
  108. warp/render/render_usd.py +82 -40
  109. warp/sim/__init__.py +13 -4
  110. warp/sim/articulation.py +4 -5
  111. warp/sim/collide.py +320 -175
  112. warp/sim/import_mjcf.py +25 -30
  113. warp/sim/import_urdf.py +94 -63
  114. warp/sim/import_usd.py +51 -36
  115. warp/sim/inertia.py +3 -2
  116. warp/sim/integrator.py +233 -0
  117. warp/sim/integrator_euler.py +447 -469
  118. warp/sim/integrator_featherstone.py +1991 -0
  119. warp/sim/integrator_xpbd.py +1420 -640
  120. warp/sim/model.py +765 -487
  121. warp/sim/particles.py +2 -1
  122. warp/sim/render.py +35 -13
  123. warp/sim/utils.py +222 -11
  124. warp/stubs.py +8 -0
  125. warp/tape.py +16 -1
  126. warp/tests/aux_test_grad_customs.py +23 -0
  127. warp/tests/test_array.py +190 -1
  128. warp/tests/test_async.py +656 -0
  129. warp/tests/test_bool.py +50 -0
  130. warp/tests/test_dlpack.py +164 -11
  131. warp/tests/test_examples.py +166 -74
  132. warp/tests/test_fem.py +8 -1
  133. warp/tests/test_generics.py +15 -5
  134. warp/tests/test_grad.py +1 -1
  135. warp/tests/test_grad_customs.py +172 -12
  136. warp/tests/test_jax.py +254 -0
  137. warp/tests/test_large.py +29 -6
  138. warp/tests/test_launch.py +25 -0
  139. warp/tests/test_linear_solvers.py +20 -3
  140. warp/tests/test_matmul.py +61 -16
  141. warp/tests/test_matmul_lite.py +13 -13
  142. warp/tests/test_mempool.py +186 -0
  143. warp/tests/test_multigpu.py +3 -0
  144. warp/tests/test_options.py +16 -2
  145. warp/tests/test_peer.py +137 -0
  146. warp/tests/test_print.py +3 -1
  147. warp/tests/test_quat.py +23 -0
  148. warp/tests/test_sim_kinematics.py +97 -0
  149. warp/tests/test_snippet.py +126 -3
  150. warp/tests/test_streams.py +108 -79
  151. warp/tests/test_torch.py +16 -8
  152. warp/tests/test_utils.py +32 -27
  153. warp/tests/test_verify_fp.py +65 -0
  154. warp/tests/test_volume.py +1 -1
  155. warp/tests/unittest_serial.py +2 -0
  156. warp/tests/unittest_suites.py +12 -0
  157. warp/tests/unittest_utils.py +14 -7
  158. warp/thirdparty/unittest_parallel.py +15 -3
  159. warp/torch.py +10 -8
  160. warp/types.py +363 -246
  161. warp/utils.py +143 -19
  162. warp_lang-1.0.0.dist-info/LICENSE.md +126 -0
  163. warp_lang-1.0.0.dist-info/METADATA +394 -0
  164. {warp_lang-0.11.0.dist-info → warp_lang-1.0.0.dist-info}/RECORD +167 -86
  165. warp/sim/optimizer.py +0 -138
  166. warp_lang-0.11.0.dist-info/LICENSE.md +0 -36
  167. warp_lang-0.11.0.dist-info/METADATA +0 -238
  168. /warp/tests/{walkthough_debug.py → walkthrough_debug.py} +0 -0
  169. {warp_lang-0.11.0.dist-info → warp_lang-1.0.0.dist-info}/WHEEL +0 -0
  170. {warp_lang-0.11.0.dist-info → warp_lang-1.0.0.dist-info}/top_level.txt +0 -0
warp/render/render_usd.py CHANGED
@@ -28,9 +28,12 @@ def _usd_set_xform(xform, pos: tuple, rot: tuple, scale: tuple, time):
28
28
 
29
29
  xform_ops = xform.GetOrderedXformOps()
30
30
 
31
- xform_ops[0].Set(Gf.Vec3d(float(pos[0]), float(pos[1]), float(pos[2])), time)
32
- xform_ops[1].Set(Gf.Quatf(float(rot[3]), float(rot[0]), float(rot[1]), float(rot[2])), time)
33
- xform_ops[2].Set(Gf.Vec3d(float(scale[0]), float(scale[1]), float(scale[2])), time)
31
+ if pos is not None:
32
+ xform_ops[0].Set(Gf.Vec3d(float(pos[0]), float(pos[1]), float(pos[2])), time)
33
+ if rot is not None:
34
+ xform_ops[1].Set(Gf.Quatf(float(rot[3]), float(rot[0]), float(rot[1]), float(rot[2])), time)
35
+ if scale is not None:
36
+ xform_ops[2].Set(Gf.Vec3d(float(scale[0]), float(scale[1]), float(scale[2])), time)
34
37
 
35
38
 
36
39
  # transforms a cylinder such that it connects the two points pos0, pos1
@@ -104,24 +107,20 @@ class UsdRenderer:
104
107
  elif up_axis == "Z":
105
108
  UsdGeom.SetStageUpAxis(self.stage, UsdGeom.Tokens.z)
106
109
 
107
- # add default lights
108
- light_0 = UsdLux.DistantLight.Define(stage, "/light_0")
109
- light_0.GetPrim().CreateAttribute("intensity", Sdf.ValueTypeNames.Float, custom=False).Set(2500.0)
110
- light_0.GetPrim().CreateAttribute("color", Sdf.ValueTypeNames.Color3f, custom=False).Set(
111
- Gf.Vec3f(0.98, 0.85, 0.7)
112
- )
113
-
114
- UsdGeom.Xform(light_0.GetPrim()).AddRotateYOp().Set(value=(70.0))
115
- UsdGeom.Xform(light_0.GetPrim()).AddRotateXOp().Set(value=(-45.0))
116
-
117
- light_1 = UsdLux.DistantLight.Define(stage, "/light_1")
118
- light_1.GetPrim().CreateAttribute("intensity", Sdf.ValueTypeNames.Float, custom=False).Set(2500.0)
119
- light_1.GetPrim().CreateAttribute("color", Sdf.ValueTypeNames.Color3f, custom=False).Set(
120
- Gf.Vec3f(0.62, 0.82, 0.98)
121
- )
122
-
123
- UsdGeom.Xform(light_1.GetPrim()).AddRotateYOp().Set(value=(-70.0))
124
- UsdGeom.Xform(light_1.GetPrim()).AddRotateXOp().Set(value=(-45.0))
110
+ dome_light = UsdLux.DomeLight.Define(stage, "/dome_light")
111
+ dome_light.AddRotateXYZOp().Set((-90.0, -30.0, 0.0))
112
+ dome_light.GetEnableColorTemperatureAttr().Set(True)
113
+ dome_light.GetColorTemperatureAttr().Set(6150.0)
114
+ dome_light.GetIntensityAttr().Set(1.0)
115
+ dome_light.GetExposureAttr().Set(9.0)
116
+ dome_light.GetPrim().CreateAttribute("visibleInPrimaryRay", Sdf.ValueTypeNames.Bool).Set(False)
117
+
118
+ distant_light = UsdLux.DistantLight.Define(stage, "/distant_light")
119
+ distant_light.AddRotateXYZOp().Set((-35.0, 45.0, 0.0))
120
+ distant_light.GetEnableColorTemperatureAttr().Set(True)
121
+ distant_light.GetColorTemperatureAttr().Set(7250.0)
122
+ distant_light.GetIntensityAttr().Set(1.0)
123
+ distant_light.GetExposureAttr().Set(10.0)
125
124
 
126
125
  def begin_frame(self, time):
127
126
  self.time = round(time * self.fps)
@@ -155,7 +154,11 @@ class UsdRenderer:
155
154
  rot: tuple,
156
155
  scale: tuple = (1.0, 1.0, 1.0),
157
156
  color: tuple = (1.0, 1.0, 1.0),
157
+ custom_index: int = -1,
158
+ visible: bool = True,
158
159
  ):
160
+ if not visible:
161
+ return
159
162
  sdf_path = self._resolve_path(name, body)
160
163
  instance = self._shape_constructors[shape.name].Define(self.stage, sdf_path)
161
164
  instance.GetPrim().GetReferences().AddInternalReference(shape)
@@ -228,7 +231,7 @@ class UsdRenderer:
228
231
 
229
232
  return prim_path
230
233
 
231
- def render_ground(self, size: float = 100.0):
234
+ def render_ground(self, size: float = 100.0, plane=None):
232
235
  from pxr import UsdGeom
233
236
 
234
237
  mesh = UsdGeom.Mesh.Define(self.stage, self.root.GetPath().AppendChild("ground"))
@@ -243,6 +246,23 @@ class UsdRenderer:
243
246
  elif self.up_axis == "Z":
244
247
  points = ((-size, -size, 0.0), (size, -size, 0.0), (size, size, 0.0), (-size, size, 0.0))
245
248
  normals = ((0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0))
249
+ if plane is not None:
250
+ normal = np.array(plane[:3])
251
+ normal /= np.linalg.norm(normal)
252
+ pos = plane[3] * normal
253
+ axis_up = [0.0, 0.0, 0.0]
254
+ axis_up["XYZ".index(self.up_axis)] = 1.0
255
+ if np.allclose(normal, axis_up):
256
+ # no rotation necessary
257
+ q = (0.0, 0.0, 0.0, 1.0)
258
+ else:
259
+ c = np.cross(normal, axis_up)
260
+ angle = np.arcsin(np.linalg.norm(c))
261
+ axis = np.abs(c) / np.linalg.norm(c)
262
+ q = wp.quat_from_axis_angle(axis, angle)
263
+ tf = wp.transform(pos, q)
264
+ points = [wp.transform_point(tf, p) for p in points]
265
+ normals = [wp.transform_vector(tf, n) for n in normals]
246
266
  counts = (4,)
247
267
  indices = [0, 1, 2, 3]
248
268
 
@@ -252,7 +272,7 @@ class UsdRenderer:
252
272
  mesh.GetFaceVertexIndicesAttr().Set(indices)
253
273
 
254
274
  def render_sphere(
255
- self, name: str, pos: tuple, rot: tuple, radius: float, parent_body: str = None, is_template: bool = False
275
+ self, name: str, pos: tuple, rot: tuple, radius: float, parent_body: str = None, is_template: bool = False, color: tuple = None
256
276
  ):
257
277
  """Debug helper to add a sphere for visualization
258
278
 
@@ -260,9 +280,10 @@ class UsdRenderer:
260
280
  pos: The position of the sphere
261
281
  radius: The radius of the sphere
262
282
  name: A name for the USD prim on the stage
283
+ color: The color of the sphere
263
284
  """
264
285
 
265
- from pxr import UsdGeom, Sdf
286
+ from pxr import Gf, UsdGeom, Sdf
266
287
 
267
288
  if is_template:
268
289
  prim_path = self._resolve_path(name, parent_body, is_template)
@@ -282,6 +303,9 @@ class UsdRenderer:
282
303
 
283
304
  sphere.GetRadiusAttr().Set(radius, self.time)
284
305
 
306
+ if color is not None:
307
+ sphere.GetDisplayColorAttr().Set([Gf.Vec3f(color)], self.time)
308
+
285
309
  self._shape_constructors[name] = UsdGeom.Sphere
286
310
 
287
311
  if not is_template:
@@ -298,6 +322,7 @@ class UsdRenderer:
298
322
  half_height: float,
299
323
  parent_body: str = None,
300
324
  is_template: bool = False,
325
+ color: tuple = None,
301
326
  ):
302
327
  """
303
328
  Debug helper to add a capsule for visualization
@@ -307,9 +332,10 @@ class UsdRenderer:
307
332
  radius: The radius of the capsule
308
333
  half_height: The half height of the capsule
309
334
  name: A name for the USD prim on the stage
335
+ color: The color of the capsule
310
336
  """
311
337
 
312
- from pxr import UsdGeom, Sdf
338
+ from pxr import Gf, UsdGeom, Sdf
313
339
 
314
340
  if is_template:
315
341
  prim_path = self._resolve_path(name, parent_body, is_template)
@@ -331,10 +357,13 @@ class UsdRenderer:
331
357
  capsule.GetHeightAttr().Set(float(half_height * 2.0))
332
358
  capsule.GetAxisAttr().Set("Y")
333
359
 
360
+ if color is not None:
361
+ capsule.GetDisplayColorAttr().Set([Gf.Vec3f(color)], self.time)
362
+
334
363
  self._shape_constructors[name] = UsdGeom.Capsule
335
364
 
336
365
  if not is_template:
337
- _usd_set_xform(capsule, pos, rot, (1.0, 1.0, 1.0), 0.0)
366
+ _usd_set_xform(capsule, pos, rot, (1.0, 1.0, 1.0), self.time)
338
367
 
339
368
  return prim_path
340
369
 
@@ -347,6 +376,7 @@ class UsdRenderer:
347
376
  half_height: float,
348
377
  parent_body: str = None,
349
378
  is_template: bool = False,
379
+ color: tuple = None,
350
380
  ):
351
381
  """
352
382
  Debug helper to add a cylinder for visualization
@@ -356,9 +386,10 @@ class UsdRenderer:
356
386
  radius: The radius of the cylinder
357
387
  half_height: The half height of the cylinder
358
388
  name: A name for the USD prim on the stage
389
+ color: The color of the cylinder
359
390
  """
360
391
 
361
- from pxr import UsdGeom, Sdf
392
+ from pxr import Gf, UsdGeom, Sdf
362
393
 
363
394
  if is_template:
364
395
  prim_path = self._resolve_path(name, parent_body, is_template)
@@ -380,10 +411,13 @@ class UsdRenderer:
380
411
  cylinder.GetHeightAttr().Set(float(half_height * 2.0))
381
412
  cylinder.GetAxisAttr().Set("Y")
382
413
 
414
+ if color is not None:
415
+ cylinder.GetDisplayColorAttr().Set([Gf.Vec3f(color)], self.time)
416
+
383
417
  self._shape_constructors[name] = UsdGeom.Cylinder
384
418
 
385
419
  if not is_template:
386
- _usd_set_xform(cylinder, pos, rot, (1.0, 1.0, 1.0), 0.0)
420
+ _usd_set_xform(cylinder, pos, rot, (1.0, 1.0, 1.0), self.time)
387
421
 
388
422
  return prim_path
389
423
 
@@ -396,6 +430,7 @@ class UsdRenderer:
396
430
  half_height: float,
397
431
  parent_body: str = None,
398
432
  is_template: bool = False,
433
+ color: tuple = None,
399
434
  ):
400
435
  """
401
436
  Debug helper to add a cone for visualization
@@ -405,9 +440,10 @@ class UsdRenderer:
405
440
  radius: The radius of the cone
406
441
  half_height: The half height of the cone
407
442
  name: A name for the USD prim on the stage
443
+ color: The color of the cone
408
444
  """
409
445
 
410
- from pxr import UsdGeom, Sdf
446
+ from pxr import Gf, UsdGeom, Sdf
411
447
 
412
448
  if is_template:
413
449
  prim_path = self._resolve_path(name, parent_body, is_template)
@@ -429,25 +465,29 @@ class UsdRenderer:
429
465
  cone.GetHeightAttr().Set(float(half_height * 2.0))
430
466
  cone.GetAxisAttr().Set("Y")
431
467
 
468
+ if color is not None:
469
+ cone.GetDisplayColorAttr().Set([Gf.Vec3f(color)], self.time)
470
+
432
471
  self._shape_constructors[name] = UsdGeom.Cone
433
472
 
434
473
  if not is_template:
435
- _usd_set_xform(cone, pos, rot, (1.0, 1.0, 1.0), 0.0)
474
+ _usd_set_xform(cone, pos, rot, (1.0, 1.0, 1.0), self.time)
436
475
 
437
476
  return prim_path
438
477
 
439
478
  def render_box(
440
- self, name: str, pos: tuple, rot: tuple, extents: tuple, parent_body: str = None, is_template: bool = False
479
+ self, name: str, pos: tuple, rot: tuple, extents: tuple, parent_body: str = None, is_template: bool = False, color: tuple = None
441
480
  ):
442
481
  """Debug helper to add a box for visualization
443
482
 
444
483
  Args:
445
- pos: The position of the sphere
446
- extents: The radius of the sphere
484
+ pos: The position of the box
485
+ extents: The radius of the box
447
486
  name: A name for the USD prim on the stage
487
+ color: The color of the box
448
488
  """
449
489
 
450
- from pxr import UsdGeom, Sdf, Gf, Vt
490
+ from pxr import UsdGeom, Sdf, Gf
451
491
 
452
492
  if is_template:
453
493
  prim_path = self._resolve_path(name, parent_body, is_template)
@@ -465,11 +505,14 @@ class UsdRenderer:
465
505
  cube = UsdGeom.Cube.Define(self.stage, cube_path)
466
506
  _usd_add_xform(cube)
467
507
 
508
+ if color is not None:
509
+ cube.GetDisplayColorAttr().Set([Gf.Vec3f(color)], self.time)
510
+
468
511
  self._shape_constructors[name] = UsdGeom.Cube
469
512
  self._shape_custom_scale[name] = extents
470
513
 
471
514
  if not is_template:
472
- _usd_set_xform(cube, pos, rot, extents, 0.0)
515
+ _usd_set_xform(cube, pos, rot, extents, self.time)
473
516
 
474
517
  return prim_path
475
518
 
@@ -662,11 +705,10 @@ class UsdRenderer:
662
705
 
663
706
  instancer = UsdGeom.Points.Define(self.stage, instancer_path)
664
707
 
665
- instancer.CreatePrimvar("displayColor", Sdf.ValueTypeNames.Float3Array, "vertex", 1)
666
708
  if radius_is_scalar:
667
- instancer.GetWidthsAttr().Set([radius] * len(points))
709
+ instancer.GetWidthsAttr().Set([radius * 2.0] * len(points))
668
710
  else:
669
- instancer.GetWidthsAttr().Set(radius)
711
+ instancer.GetWidthsAttr().Set(radius * 2.0)
670
712
 
671
713
  if colors is None:
672
714
  instancer.GetPositionsAttr().Set(points, self.time)
@@ -694,6 +736,6 @@ class UsdRenderer:
694
736
  try:
695
737
  self.stage.Save()
696
738
  return True
697
- except:
698
- print("Failed to save USD stage")
739
+ except Exception as e:
740
+ print("Failed to save USD stage:", e)
699
741
  return False
warp/sim/__init__.py CHANGED
@@ -6,7 +6,7 @@
6
6
  # license agreement from NVIDIA CORPORATION is strictly prohibited.
7
7
 
8
8
 
9
- from .model import State, Model, ModelBuilder, Mesh, SDF
9
+ from .model import State, Control, Model, ModelBuilder, Mesh, SDF
10
10
 
11
11
  from .model import GEO_SPHERE
12
12
  from .model import GEO_BOX
@@ -17,13 +17,13 @@ from .model import GEO_MESH
17
17
  from .model import GEO_SDF
18
18
  from .model import GEO_PLANE
19
19
  from .model import GEO_NONE
20
- from .model import ModelShapeGeometry
21
20
 
22
- from .model import JOINT_MODE_LIMIT
21
+ from .model import JOINT_MODE_FORCE
23
22
  from .model import JOINT_MODE_TARGET_POSITION
24
23
  from .model import JOINT_MODE_TARGET_VELOCITY
25
24
 
26
25
  from .model import JointAxis
26
+ from .model import ModelShapeGeometry
27
27
  from .model import ModelShapeMaterials
28
28
 
29
29
  from .model import JOINT_PRISMATIC
@@ -36,8 +36,10 @@ from .model import JOINT_UNIVERSAL
36
36
  from .model import JOINT_DISTANCE
37
37
  from .model import JOINT_D6
38
38
 
39
+ from .integrator import Integrator, integrate_particles, integrate_bodies
39
40
  from .integrator_euler import SemiImplicitIntegrator
40
- from .integrator_euler import VariationalImplicitIntegrator
41
+
42
+ from .integrator_featherstone import FeatherstoneIntegrator
41
43
 
42
44
  from .integrator_xpbd import XPBDIntegrator
43
45
 
@@ -48,3 +50,10 @@ from .import_mjcf import parse_mjcf
48
50
  from .import_urdf import parse_urdf
49
51
  from .import_snu import parse_snu
50
52
  from .import_usd import parse_usd, resolve_usd_from_url
53
+
54
+ from .utils import velocity_at_point
55
+ from .utils import quat_from_euler
56
+ from .utils import quat_to_euler
57
+ from .utils import load_mesh
58
+
59
+ from .inertia import transform_inertia
warp/sim/articulation.py CHANGED
@@ -105,7 +105,7 @@ def compute_3d_rotational_dofs(
105
105
  local_1 = wp.quat_rotate(q_off, wp.vec3(0.0, 1.0, 0.0))
106
106
  local_2 = wp.quat_rotate(q_off, wp.vec3(0.0, 0.0, 1.0))
107
107
 
108
- # reconstruct rotation axes, todo: can probably use fact that rz'*ry'*rx' == rx*ry*rz to avoid some work here
108
+ # reconstruct rotation axes
109
109
  axis_0 = local_0
110
110
  q_0 = wp.quat_from_axis_angle(axis_0, q0)
111
111
 
@@ -331,10 +331,9 @@ def eval_articulation_fk(
331
331
  iq = q_start + lin_axis_count
332
332
  iqd = qd_start + lin_axis_count
333
333
  if ang_axis_count == 1:
334
- axis = joint_axis[axis_start + lin_axis_count + 0]
335
- qi = wp.quat_from_axis_angle(axis, joint_q[q_start + lin_axis_count + 0])
336
- rot = qi * rot
337
- vel_w = joint_qd[qd_start + lin_axis_count + 0] * axis
334
+ axis = joint_axis[ia]
335
+ rot = wp.quat_from_axis_angle(axis, joint_q[iq])
336
+ vel_w = joint_qd[iqd] * axis
338
337
  if ang_axis_count == 2:
339
338
  rot, vel_w = compute_2d_rotational_dofs(
340
339
  joint_axis[ia + 0],