warp-lang 0.15.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.
- warp/__init__.py +1 -0
- warp/codegen.py +7 -3
- warp/config.py +2 -1
- warp/constants.py +3 -0
- warp/context.py +44 -21
- warp/examples/assets/bunny.usd +0 -0
- warp/examples/assets/cartpole.urdf +110 -0
- warp/examples/assets/crazyflie.usd +0 -0
- warp/examples/assets/cube.usda +42 -0
- warp/examples/assets/nv_ant.xml +92 -0
- warp/examples/assets/nv_humanoid.xml +183 -0
- warp/examples/assets/quadruped.urdf +268 -0
- warp/examples/assets/rocks.nvdb +0 -0
- warp/examples/assets/rocks.usd +0 -0
- warp/examples/assets/sphere.usda +56 -0
- warp/examples/assets/torus.usda +105 -0
- warp/examples/core/example_dem.py +6 -6
- warp/examples/core/example_fluid.py +3 -3
- warp/examples/core/example_graph_capture.py +3 -6
- warp/examples/optim/example_bounce.py +9 -8
- warp/examples/optim/example_cloth_throw.py +12 -8
- warp/examples/optim/example_diffray.py +10 -12
- warp/examples/optim/example_drone.py +31 -14
- warp/examples/optim/example_spring_cage.py +10 -15
- warp/examples/optim/example_trajectory.py +7 -24
- warp/examples/sim/example_cartpole.py +3 -9
- warp/examples/sim/example_cloth.py +10 -10
- warp/examples/sim/example_granular.py +3 -3
- warp/examples/sim/example_granular_collision_sdf.py +9 -4
- warp/examples/sim/example_jacobian_ik.py +0 -10
- warp/examples/sim/example_particle_chain.py +4 -4
- warp/examples/sim/example_quadruped.py +15 -11
- warp/examples/sim/example_rigid_chain.py +13 -8
- warp/examples/sim/example_rigid_contact.py +4 -4
- warp/examples/sim/example_rigid_force.py +7 -7
- warp/examples/sim/example_rigid_soft_contact.py +4 -4
- warp/examples/sim/example_soft_body.py +3 -3
- warp/jax.py +45 -0
- warp/jax_experimental.py +339 -0
- warp/render/render_opengl.py +188 -95
- warp/render/render_usd.py +34 -10
- warp/sim/__init__.py +13 -4
- warp/sim/articulation.py +4 -5
- warp/sim/collide.py +320 -175
- warp/sim/import_mjcf.py +25 -30
- warp/sim/import_urdf.py +94 -63
- warp/sim/import_usd.py +51 -36
- warp/sim/inertia.py +3 -2
- warp/sim/integrator.py +233 -0
- warp/sim/integrator_euler.py +447 -469
- warp/sim/integrator_featherstone.py +1991 -0
- warp/sim/integrator_xpbd.py +1420 -640
- warp/sim/model.py +741 -487
- warp/sim/particles.py +2 -1
- warp/sim/render.py +18 -2
- warp/sim/utils.py +222 -11
- warp/stubs.py +1 -0
- warp/tape.py +6 -9
- warp/tests/test_examples.py +87 -20
- warp/tests/test_grad_customs.py +122 -0
- warp/tests/test_jax.py +254 -0
- warp/tests/test_options.py +13 -53
- warp/tests/test_quat.py +23 -0
- warp/tests/test_snippet.py +2 -0
- warp/tests/test_utils.py +31 -26
- warp/tests/test_verify_fp.py +65 -0
- warp/tests/unittest_suites.py +4 -0
- warp/utils.py +50 -1
- {warp_lang-0.15.0.dist-info → warp_lang-1.0.0.dist-info}/METADATA +1 -1
- {warp_lang-0.15.0.dist-info → warp_lang-1.0.0.dist-info}/RECORD +73 -64
- warp/examples/env/__init__.py +0 -0
- warp/examples/env/env_ant.py +0 -61
- warp/examples/env/env_cartpole.py +0 -63
- warp/examples/env/env_humanoid.py +0 -65
- warp/examples/env/env_usd.py +0 -97
- warp/examples/env/environment.py +0 -526
- warp/sim/optimizer.py +0 -138
- {warp_lang-0.15.0.dist-info → warp_lang-1.0.0.dist-info}/LICENSE.md +0 -0
- {warp_lang-0.15.0.dist-info → warp_lang-1.0.0.dist-info}/WHEEL +0 -0
- {warp_lang-0.15.0.dist-info → warp_lang-1.0.0.dist-info}/top_level.txt +0 -0
warp/__init__.py
CHANGED
|
@@ -73,6 +73,7 @@ from warp.context import is_peer_access_supported, is_peer_access_enabled, set_p
|
|
|
73
73
|
from warp.tape import Tape
|
|
74
74
|
from warp.utils import ScopedTimer, ScopedDevice, ScopedStream
|
|
75
75
|
from warp.utils import ScopedMempool, ScopedMempoolAccess, ScopedPeerAccess
|
|
76
|
+
from warp.utils import ScopedCapture
|
|
76
77
|
from warp.utils import transform_expand, quat_between_vectors
|
|
77
78
|
|
|
78
79
|
from warp.torch import from_torch, to_torch
|
warp/codegen.py
CHANGED
|
@@ -919,12 +919,16 @@ class Adjoint:
|
|
|
919
919
|
break
|
|
920
920
|
|
|
921
921
|
# if it is a user-function then build it recursively
|
|
922
|
-
if not func.is_builtin():
|
|
922
|
+
if not func.is_builtin() and func not in adj.builder.functions:
|
|
923
923
|
adj.builder.build_function(func)
|
|
924
|
+
# add custom grad, replay functions to the list of functions
|
|
925
|
+
# to be built later (invalid code could be generated if we built them now)
|
|
926
|
+
# so that they are not missed when only the forward function is imported
|
|
927
|
+
# from another module
|
|
924
928
|
if func.custom_grad_func:
|
|
925
|
-
adj.builder.
|
|
929
|
+
adj.builder.deferred_functions.append(func.custom_grad_func)
|
|
926
930
|
if func.custom_replay_func:
|
|
927
|
-
adj.builder.
|
|
931
|
+
adj.builder.deferred_functions.append(func.custom_replay_func)
|
|
928
932
|
|
|
929
933
|
# evaluate the function type based on inputs
|
|
930
934
|
arg_types = [strip_reference(a.type) for a in args if not isinstance(a, warp.context.Function)]
|
warp/config.py
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# distribution of this software and related documentation without an express
|
|
6
6
|
# license agreement from NVIDIA CORPORATION is strictly prohibited.
|
|
7
7
|
|
|
8
|
-
version = "0.
|
|
8
|
+
version = "1.0.0"
|
|
9
9
|
|
|
10
10
|
verify_fp = False # verify inputs and outputs are finite after each launch
|
|
11
11
|
verify_cuda = False # if true will check CUDA errors after each kernel launch / memory operation
|
|
@@ -13,6 +13,7 @@ print_launches = False # if true will print out launch information
|
|
|
13
13
|
|
|
14
14
|
mode = "release"
|
|
15
15
|
verbose = False # print extra informative messages
|
|
16
|
+
verbose_warnings = False # whether file and line info gets included in Warp warnings
|
|
16
17
|
quiet = False # suppress all output except errors and warnings
|
|
17
18
|
|
|
18
19
|
cache_kernels = True
|
warp/constants.py
CHANGED
|
@@ -26,6 +26,8 @@ __all__ = [
|
|
|
26
26
|
"phi",
|
|
27
27
|
"PI",
|
|
28
28
|
"pi",
|
|
29
|
+
"HALF_PI",
|
|
30
|
+
"half_pi",
|
|
29
31
|
"TAU",
|
|
30
32
|
"tau",
|
|
31
33
|
]
|
|
@@ -37,6 +39,7 @@ LN2 = ln2 = constant(0.69314718055994530942) # ln(2)
|
|
|
37
39
|
LN10 = ln10 = constant(2.30258509299404568402) # ln(10)
|
|
38
40
|
PHI = phi = constant(1.61803398874989484820) # golden constant
|
|
39
41
|
PI = pi = constant(3.14159265358979323846) # pi
|
|
42
|
+
HALF_PI = half_pi = constant(1.57079632679489661923) # half pi
|
|
40
43
|
TAU = tau = constant(6.28318530717958647692) # 2 * pi
|
|
41
44
|
|
|
42
45
|
INF = inf = constant(math.inf)
|
warp/context.py
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import ast
|
|
9
9
|
import ctypes
|
|
10
|
+
import functools
|
|
10
11
|
import gc
|
|
11
12
|
import hashlib
|
|
12
13
|
import inspect
|
|
@@ -643,8 +644,10 @@ def func(f):
|
|
|
643
644
|
func=f, key=name, namespace="", module=m, value_func=None
|
|
644
645
|
) # value_type not known yet, will be inferred during Adjoint.build()
|
|
645
646
|
|
|
646
|
-
#
|
|
647
|
-
|
|
647
|
+
# use the top of the list of overloads for this key
|
|
648
|
+
g = m.functions[name]
|
|
649
|
+
# copy over the function attributes, including docstring
|
|
650
|
+
return functools.update_wrapper(g, f)
|
|
648
651
|
|
|
649
652
|
|
|
650
653
|
def func_native(snippet, adj_snippet=None, replay_snippet=None):
|
|
@@ -665,8 +668,9 @@ def func_native(snippet, adj_snippet=None, replay_snippet=None):
|
|
|
665
668
|
adj_native_snippet=adj_snippet,
|
|
666
669
|
replay_snippet=replay_snippet,
|
|
667
670
|
) # cuda snippets do not have a return value_type
|
|
668
|
-
|
|
669
|
-
|
|
671
|
+
g = m.functions[name]
|
|
672
|
+
# copy over the function attributes, including docstring
|
|
673
|
+
return functools.update_wrapper(g, f)
|
|
670
674
|
|
|
671
675
|
return snippet_func
|
|
672
676
|
|
|
@@ -710,7 +714,11 @@ def func_grad(forward_fn):
|
|
|
710
714
|
def match_function(f):
|
|
711
715
|
# check whether the function overload f matches the signature of the provided gradient function
|
|
712
716
|
if not hasattr(f.adj, "return_var"):
|
|
713
|
-
|
|
717
|
+
# we have to temporarily build this function to figure out its return type(s);
|
|
718
|
+
# note that we do not have a ModuleBuilder instance here at this wrapping stage, hence we
|
|
719
|
+
# have to create a dummy builder
|
|
720
|
+
builder = ModuleBuilder(Module("dummy", None), f.module.options)
|
|
721
|
+
f.adj.build(builder)
|
|
714
722
|
expected_args = list(f.input_types.items())
|
|
715
723
|
if f.adj.return_var is not None:
|
|
716
724
|
expected_args += [(f"adj_ret_{var.label}", var.type) for var in f.adj.return_var]
|
|
@@ -745,7 +753,7 @@ def func_grad(forward_fn):
|
|
|
745
753
|
continue
|
|
746
754
|
if match_function(f):
|
|
747
755
|
add_custom_grad(f)
|
|
748
|
-
return
|
|
756
|
+
return grad_fn
|
|
749
757
|
raise RuntimeError(
|
|
750
758
|
f"No function overload found for gradient function {grad_fn.__qualname__} for function {forward_fn.key}"
|
|
751
759
|
)
|
|
@@ -767,6 +775,8 @@ def func_grad(forward_fn):
|
|
|
767
775
|
f"\n{', '.join(map(lambda nt: f'{nt[0]}: {nt[1].__name__}', expected_args))}"
|
|
768
776
|
)
|
|
769
777
|
|
|
778
|
+
return grad_fn
|
|
779
|
+
|
|
770
780
|
return wrapper
|
|
771
781
|
|
|
772
782
|
|
|
@@ -810,6 +820,7 @@ def func_replay(forward_fn):
|
|
|
810
820
|
skip_adding_overload=True,
|
|
811
821
|
code_transformers=f.adj.transformers,
|
|
812
822
|
)
|
|
823
|
+
return replay_fn
|
|
813
824
|
|
|
814
825
|
return wrapper
|
|
815
826
|
|
|
@@ -830,6 +841,7 @@ def kernel(f=None, *, enable_backward=None):
|
|
|
830
841
|
module=m,
|
|
831
842
|
options=options,
|
|
832
843
|
)
|
|
844
|
+
k = functools.update_wrapper(k, f)
|
|
833
845
|
return k
|
|
834
846
|
|
|
835
847
|
if f is None:
|
|
@@ -843,7 +855,7 @@ def kernel(f=None, *, enable_backward=None):
|
|
|
843
855
|
def struct(c):
|
|
844
856
|
m = get_module(c.__module__)
|
|
845
857
|
s = warp.codegen.Struct(cls=c, key=warp.codegen.make_full_qualified_name(c), module=m)
|
|
846
|
-
|
|
858
|
+
s = functools.update_wrapper(s, c)
|
|
847
859
|
return s
|
|
848
860
|
|
|
849
861
|
|
|
@@ -1159,6 +1171,7 @@ class ModuleBuilder:
|
|
|
1159
1171
|
self.structs = {}
|
|
1160
1172
|
self.options = options
|
|
1161
1173
|
self.module = module
|
|
1174
|
+
self.deferred_functions = []
|
|
1162
1175
|
|
|
1163
1176
|
# build all functions declared in the module
|
|
1164
1177
|
for func in module.functions.values():
|
|
@@ -1175,6 +1188,10 @@ class ModuleBuilder:
|
|
|
1175
1188
|
for k in kernel.overloads.values():
|
|
1176
1189
|
self.build_kernel(k)
|
|
1177
1190
|
|
|
1191
|
+
# build all functions outside this module which are called from functions or kernels in this module
|
|
1192
|
+
for func in self.deferred_functions:
|
|
1193
|
+
self.build_function(func)
|
|
1194
|
+
|
|
1178
1195
|
def build_struct_recursive(self, struct: warp.codegen.Struct):
|
|
1179
1196
|
structs = []
|
|
1180
1197
|
|
|
@@ -1667,7 +1684,7 @@ class Module:
|
|
|
1667
1684
|
if cuda_module is not None:
|
|
1668
1685
|
self.cuda_modules[device.context] = cuda_module
|
|
1669
1686
|
else:
|
|
1670
|
-
raise Exception("Failed to load CUDA module")
|
|
1687
|
+
raise Exception(f"Failed to load CUDA module '{self.name}'")
|
|
1671
1688
|
|
|
1672
1689
|
except Exception as e:
|
|
1673
1690
|
self.cuda_build_failed = True
|
|
@@ -2871,6 +2888,15 @@ class Runtime:
|
|
|
2871
2888
|
# initialize kernel cache
|
|
2872
2889
|
warp.build.init_kernel_cache(warp.config.kernel_cache_dir)
|
|
2873
2890
|
|
|
2891
|
+
devices_without_uva = []
|
|
2892
|
+
devices_without_mempool = []
|
|
2893
|
+
for cuda_device in self.cuda_devices:
|
|
2894
|
+
if cuda_device.is_primary:
|
|
2895
|
+
if not cuda_device.is_uva:
|
|
2896
|
+
devices_without_uva.append(cuda_device)
|
|
2897
|
+
if not cuda_device.is_mempool_supported:
|
|
2898
|
+
devices_without_mempool.append(cuda_device)
|
|
2899
|
+
|
|
2874
2900
|
# print device and version information
|
|
2875
2901
|
if not warp.config.quiet:
|
|
2876
2902
|
greeting = []
|
|
@@ -2893,16 +2919,12 @@ class Runtime:
|
|
|
2893
2919
|
alias_str = f'"{self.cpu_device.alias}"'
|
|
2894
2920
|
name_str = f'"{self.cpu_device.name}"'
|
|
2895
2921
|
greeting.append(f" {alias_str:10s} : {name_str}")
|
|
2896
|
-
devices_without_uva = []
|
|
2897
|
-
devices_without_mempool = []
|
|
2898
2922
|
for cuda_device in self.cuda_devices:
|
|
2899
2923
|
alias_str = f'"{cuda_device.alias}"'
|
|
2900
2924
|
if cuda_device.is_primary:
|
|
2901
2925
|
name_str = f'"{cuda_device.name}"'
|
|
2902
2926
|
arch_str = f"sm_{cuda_device.arch}"
|
|
2903
2927
|
mem_str = f"{cuda_device.total_memory / 1024 / 1024 / 1024:.0f} GiB"
|
|
2904
|
-
if not cuda_device.is_uva:
|
|
2905
|
-
devices_without_uva.append(cuda_device)
|
|
2906
2928
|
if cuda_device.is_mempool_supported:
|
|
2907
2929
|
if cuda_device.is_mempool_enabled:
|
|
2908
2930
|
mempool_str = "mempool enabled"
|
|
@@ -2910,7 +2932,6 @@ class Runtime:
|
|
|
2910
2932
|
mempool_str = "mempool supported"
|
|
2911
2933
|
else:
|
|
2912
2934
|
mempool_str = "mempool not supported"
|
|
2913
|
-
devices_without_mempool.append(cuda_device)
|
|
2914
2935
|
greeting.append(f" {alias_str:10s} : {name_str} ({mem_str}, {arch_str}, {mempool_str})")
|
|
2915
2936
|
else:
|
|
2916
2937
|
primary_alias_str = f'"{self.cuda_primary_devices[cuda_device.ordinal].alias}"'
|
|
@@ -2971,14 +2992,16 @@ class Runtime:
|
|
|
2971
2992
|
# --quick flag. The consequences of running with an older driver can be obscure and severe,
|
|
2972
2993
|
# so make sure we print a very visible warning.
|
|
2973
2994
|
if self.driver_version < self.toolkit_version and not self.core.is_cuda_compatibility_enabled():
|
|
2974
|
-
print(
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2995
|
+
print(
|
|
2996
|
+
"******************************************************************\n"
|
|
2997
|
+
"* WARNING: *\n"
|
|
2998
|
+
"* Warp was compiled without CUDA compatibility support *\n"
|
|
2999
|
+
"* (quick build). The CUDA Toolkit version used to build *\n"
|
|
3000
|
+
"* Warp is not fully supported by the current driver. *\n"
|
|
3001
|
+
"* Some CUDA functionality may not work correctly! *\n"
|
|
3002
|
+
"* Update the driver or rebuild Warp without the --quick flag. *\n"
|
|
3003
|
+
"******************************************************************\n"
|
|
3004
|
+
)
|
|
2982
3005
|
|
|
2983
3006
|
# ensure initialization did not change the initial context (e.g. querying available memory)
|
|
2984
3007
|
self.core.cuda_context_set_current(initial_context)
|
|
Binary file
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<robot name="cartpole">
|
|
3
|
+
|
|
4
|
+
<link name="slider">
|
|
5
|
+
<visual>
|
|
6
|
+
<geometry>
|
|
7
|
+
<box size="0.03 8 0.03"/>
|
|
8
|
+
</geometry>
|
|
9
|
+
<material name="slider_mat">
|
|
10
|
+
<color rgba="0.9 0.6 0.2 1"/>
|
|
11
|
+
</material>
|
|
12
|
+
</visual>
|
|
13
|
+
<collision>
|
|
14
|
+
<geometry>
|
|
15
|
+
<box size="0.03 8 0.03"/>
|
|
16
|
+
</geometry>
|
|
17
|
+
</collision>
|
|
18
|
+
</link>
|
|
19
|
+
|
|
20
|
+
<joint name="slider_to_cart" type="prismatic">
|
|
21
|
+
<axis xyz="0 1 0"/>
|
|
22
|
+
<origin xyz="0 0 0"/>
|
|
23
|
+
<parent link="slider"/>
|
|
24
|
+
<child link="cart"/>
|
|
25
|
+
<limit effort="1000.0" lower="-4" upper="4" velocity="100"/>
|
|
26
|
+
</joint>
|
|
27
|
+
|
|
28
|
+
<link name="cart">
|
|
29
|
+
<visual>
|
|
30
|
+
<geometry>
|
|
31
|
+
<box size="0.2 0.25 0.2"/>
|
|
32
|
+
</geometry>
|
|
33
|
+
<material name="cart_mat">
|
|
34
|
+
<color rgba="0.3 0.5 0.7 1"/>
|
|
35
|
+
</material>
|
|
36
|
+
</visual>
|
|
37
|
+
<collision>
|
|
38
|
+
<geometry>
|
|
39
|
+
<box size="0.2 0.25 0.2"/>
|
|
40
|
+
</geometry>
|
|
41
|
+
</collision>
|
|
42
|
+
<inertial>
|
|
43
|
+
<mass value="1"/>
|
|
44
|
+
<inertia ixx="0.1" ixy="0.0" ixz="0.0" iyy="0.1" iyz="0.0" izz="0.1"/>
|
|
45
|
+
</inertial>
|
|
46
|
+
</link>
|
|
47
|
+
|
|
48
|
+
<joint name="cart_to_pole1" type="continuous">
|
|
49
|
+
<axis xyz="1 0 0"/>
|
|
50
|
+
<origin xyz="0.12 0 0"/>
|
|
51
|
+
<parent link="cart"/>
|
|
52
|
+
<child link="pole1"/>
|
|
53
|
+
<limit effort="1000.0" velocity="8"/>
|
|
54
|
+
</joint>
|
|
55
|
+
|
|
56
|
+
<link name="pole1">
|
|
57
|
+
<visual>
|
|
58
|
+
<geometry>
|
|
59
|
+
<box size="0.04 0.06 1.0"/>
|
|
60
|
+
</geometry>
|
|
61
|
+
<origin xyz="0 0 0.47"/>
|
|
62
|
+
<material name="pole_mat">
|
|
63
|
+
<color rgba="0.1 0.1 0.3 1"/>
|
|
64
|
+
</material>
|
|
65
|
+
</visual>
|
|
66
|
+
<collision>
|
|
67
|
+
<geometry>
|
|
68
|
+
<box size="0.04 0.06 1.0"/>
|
|
69
|
+
</geometry>
|
|
70
|
+
<origin xyz="0 0 0.47"/>
|
|
71
|
+
</collision>
|
|
72
|
+
<inertial>
|
|
73
|
+
<origin xyz="0 0 0.47"/>
|
|
74
|
+
<mass value="0.25"/>
|
|
75
|
+
<inertia ixx="0.1" ixy="0.0" ixz="0.0" iyy="0.1" iyz="0.0" izz="0.1"/>
|
|
76
|
+
</inertial>
|
|
77
|
+
</link>
|
|
78
|
+
|
|
79
|
+
<link name="pole2">
|
|
80
|
+
<visual>
|
|
81
|
+
<geometry>
|
|
82
|
+
<box size="0.04 0.06 1.0"/>
|
|
83
|
+
</geometry>
|
|
84
|
+
<origin xyz="0 0 0.47"/>
|
|
85
|
+
<material name="pole_mat">
|
|
86
|
+
<color rgba="0.1 0.1 0.3 1"/>
|
|
87
|
+
</material>
|
|
88
|
+
</visual>
|
|
89
|
+
<collision>
|
|
90
|
+
<geometry>
|
|
91
|
+
<box size="0.04 0.06 1.0"/>
|
|
92
|
+
</geometry>
|
|
93
|
+
<origin xyz="0 0 0.47"/>
|
|
94
|
+
</collision>
|
|
95
|
+
<inertial>
|
|
96
|
+
<origin xyz="0 0 0.47"/>
|
|
97
|
+
<mass value="0.25"/>
|
|
98
|
+
<inertia ixx="0.1" ixy="0.0" ixz="0.0" iyy="0.1" iyz="0.0" izz="0.1"/>
|
|
99
|
+
</inertial>
|
|
100
|
+
</link>
|
|
101
|
+
|
|
102
|
+
<joint name="pole1_to_pole2" type="continuous">
|
|
103
|
+
<axis xyz="1 0 0"/>
|
|
104
|
+
<origin xyz="0.0 0 1.0"/>
|
|
105
|
+
<parent link="pole1"/>
|
|
106
|
+
<child link="pole2"/>
|
|
107
|
+
<limit effort="1000.0" velocity="8"/>
|
|
108
|
+
</joint>
|
|
109
|
+
|
|
110
|
+
</robot>
|
|
Binary file
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#usda 1.0
|
|
2
|
+
(
|
|
3
|
+
doc = "Blender v2.92.0"
|
|
4
|
+
metersPerUnit = 1
|
|
5
|
+
upAxis = "Z"
|
|
6
|
+
defaultPrim = "Cube"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
def Xform "Cube"
|
|
10
|
+
{
|
|
11
|
+
matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
|
|
12
|
+
uniform token[] xformOpOrder = ["xformOp:transform"]
|
|
13
|
+
|
|
14
|
+
def Mesh "Cube_001"
|
|
15
|
+
{
|
|
16
|
+
int[] faceVertexCounts = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
|
|
17
|
+
int[] faceVertexIndices = [1, 2, 0, 3, 6, 2, 7, 4, 6, 5, 0, 4, 6, 0, 2, 3, 5, 7, 1, 3, 2, 3, 7, 6, 7, 5, 4, 5, 1, 0, 6, 4, 0, 3, 1, 5]
|
|
18
|
+
normal3f[] normals = [(-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (0, 1, -0), (0, 1, -0), (0, 1, -0), (1, 0, -0), (1, 0, -0), (1, 0, -0), (0, -1, 0), (0, -1, 0), (0, -1, 0), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, 0, 1), (0, 0, 1), (0, 0, 1), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (0, 1, -0), (0, 1, -0), (0, 1, -0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (0, -1, 0), (0, -1, 0), (0, -1, 0), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, -0, 1), (0, -0, 1), (0, -0, 1)] (
|
|
19
|
+
interpolation = "faceVarying"
|
|
20
|
+
)
|
|
21
|
+
point3f[] points = [(-1, -1, -1), (-1, -1, 1), (-1, 1, -1), (-1, 1, 1), (1, -1, -1), (1, -1, 1), (1, 1, -1), (1, 1, 1)]
|
|
22
|
+
uniform token subdivisionScheme = "none"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
def Xform "Camera"
|
|
27
|
+
{
|
|
28
|
+
matrix4d xformOp:transform = ( (0.6859206557273865, 0.7276763319969177, 0, 0), (-0.32401347160339355, 0.305420845746994, 0.8953956365585327, 0), (0.6515582203865051, -0.6141703724861145, 0.44527140259742737, 0), (7.358891487121582, -6.925790786743164, 4.958309173583984, 1) )
|
|
29
|
+
uniform token[] xformOpOrder = ["xformOp:transform"]
|
|
30
|
+
|
|
31
|
+
def Camera "Camera"
|
|
32
|
+
{
|
|
33
|
+
float2 clippingRange = (0.1, 100)
|
|
34
|
+
float focalLength = 50
|
|
35
|
+
float horizontalAperture = 36
|
|
36
|
+
float horizontalApertureOffset = 0
|
|
37
|
+
token projection = "perspective"
|
|
38
|
+
float verticalAperture = 20.25
|
|
39
|
+
float verticalApertureOffset = 0
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<mujoco model="ant">
|
|
2
|
+
<custom>
|
|
3
|
+
<numeric data="0.0 0.0 0.55 1.0 0.0 0.0 0.0 0.0 1.0 0.0 -1.0 0.0 -1.0 0.0 1.0" name="init_qpos"/>
|
|
4
|
+
</custom>
|
|
5
|
+
|
|
6
|
+
<default>
|
|
7
|
+
<joint armature="0.01" damping="0.1" limited="true"/>
|
|
8
|
+
<geom condim="3" density="5.0" friction="1.5 0.1 0.1" margin="0.01" rgba="0.97 0.38 0.06 1"/>
|
|
9
|
+
</default>
|
|
10
|
+
|
|
11
|
+
<compiler inertiafromgeom="true" angle="degree"/>
|
|
12
|
+
|
|
13
|
+
<option timestep="0.016" iterations="50" tolerance="1e-10" solver="Newton" jacobian="dense" cone="pyramidal"/>
|
|
14
|
+
|
|
15
|
+
<size nconmax="50" njmax="200" nstack="10000"/>
|
|
16
|
+
<visual>
|
|
17
|
+
<map force="0.1" zfar="30"/>
|
|
18
|
+
<rgba haze="0.15 0.25 0.35 1"/>
|
|
19
|
+
<quality shadowsize="2048"/>
|
|
20
|
+
<global offwidth="800" offheight="800"/>
|
|
21
|
+
</visual>
|
|
22
|
+
|
|
23
|
+
<asset>
|
|
24
|
+
<texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="512"/>
|
|
25
|
+
<texture name="texplane" type="2d" builtin="checker" rgb1=".2 .3 .4" rgb2=".1 0.15 0.2" width="512" height="512" mark="cross" markrgb=".8 .8 .8"/>
|
|
26
|
+
<texture name="texgeom" type="cube" builtin="flat" mark="cross" width="127" height="1278"
|
|
27
|
+
rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" markrgb="1 1 1" random="0.01"/>
|
|
28
|
+
|
|
29
|
+
<material name="matplane" reflectance="0.3" texture="texplane" texrepeat="1 1" texuniform="true"/>
|
|
30
|
+
<material name="matgeom" texture="texgeom" texuniform="true" rgba="0.8 0.6 .4 1"/>
|
|
31
|
+
</asset>
|
|
32
|
+
|
|
33
|
+
<worldbody>
|
|
34
|
+
<geom name="floor" pos="0 0 0" size="0 0 .25" type="plane" material="matplane" condim="3"/>
|
|
35
|
+
|
|
36
|
+
<light directional="false" diffuse=".2 .2 .2" specular="0 0 0" pos="0 0 5" dir="0 0 -1" castshadow="false"/>
|
|
37
|
+
<light mode="targetbodycom" target="torso" directional="false" diffuse=".8 .8 .8" specular="0.3 0.3 0.3" pos="0 0 4.0" dir="0 0 -1"/>
|
|
38
|
+
|
|
39
|
+
<body name="torso" pos="0 0 0.75">
|
|
40
|
+
<geom name="torso_geom" pos="0 0 0" size="0.25" type="sphere"/>
|
|
41
|
+
<geom fromto="0.0 0.0 0.0 0.2 0.2 0.0" name="aux_1_geom" size="0.08" type="capsule" rgba=".999 .2 .1 1"/>
|
|
42
|
+
<geom fromto="0.0 0.0 0.0 -0.2 0.2 0.0" name="aux_2_geom" size="0.08" type="capsule"/>
|
|
43
|
+
<geom fromto="0.0 0.0 0.0 -0.2 -0.2 0.0" name="aux_3_geom" size="0.08" type="capsule"/>
|
|
44
|
+
<geom fromto="0.0 0.0 0.0 0.2 -0.2 0.0" name="aux_4_geom" size="0.08" type="capsule" rgba=".999 .2 .02 1"/>
|
|
45
|
+
|
|
46
|
+
<joint armature="0" damping="0" limited="false" margin="0.01" name="root" pos="0 0 0" type="free"/>
|
|
47
|
+
<body name="front_left_leg" pos="0.2 0.2 0">
|
|
48
|
+
<joint axis="0 0 1" name="hip_1" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>
|
|
49
|
+
<geom fromto="0.0 0.0 0.0 0.2 0.2 0.0" name="left_leg_geom" size="0.08" type="capsule" rgba=".999 .2 .1 1"/>
|
|
50
|
+
<body pos="0.2 0.2 0" name="front_left_foot">
|
|
51
|
+
<joint axis="-1 1 0" name="ankle_1" pos="0.0 0.0 0.0" range="30 100" type="hinge"/>
|
|
52
|
+
<geom fromto="0.0 0.0 0.0 0.4 0.4 0.0" name="left_ankle_geom" size="0.08" type="capsule" rgba=".999 .2 .1 1"/>
|
|
53
|
+
</body>
|
|
54
|
+
</body>
|
|
55
|
+
<body name="front_right_leg" pos="-0.2 0.2 0">
|
|
56
|
+
<joint axis="0 0 1" name="hip_2" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>
|
|
57
|
+
<geom fromto="0.0 0.0 0.0 -0.2 0.2 0.0" name="right_leg_geom" size="0.08" type="capsule"/>
|
|
58
|
+
<body pos="-0.2 0.2 0" name="front_right_foot">
|
|
59
|
+
<joint axis="1 1 0" name="ankle_2" pos="0.0 0.0 0.0" range="-100 -30" type="hinge"/>
|
|
60
|
+
<geom fromto="0.0 0.0 0.0 -0.4 0.4 0.0" name="right_ankle_geom" size="0.08" type="capsule"/>
|
|
61
|
+
</body>
|
|
62
|
+
</body>
|
|
63
|
+
<body name="left_back_leg" pos="-0.2 -0.2 0">
|
|
64
|
+
<joint axis="0 0 1" name="hip_3" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>
|
|
65
|
+
<geom fromto="0.0 0.0 0.0 -0.2 -0.2 0.0" name="back_leg_geom" size="0.08" type="capsule"/>
|
|
66
|
+
<body pos="-0.2 -0.2 0" name="left_back_foot">
|
|
67
|
+
<joint axis="-1 1 0" name="ankle_3" pos="0.0 0.0 0.0" range="-100 -30" type="hinge"/>
|
|
68
|
+
<geom fromto="0.0 0.0 0.0 -0.4 -0.4 0.0" name="third_ankle_geom" size="0.08" type="capsule"/>
|
|
69
|
+
</body>
|
|
70
|
+
</body>
|
|
71
|
+
<body name="right_back_leg" pos="0.2 -0.2 0">
|
|
72
|
+
<joint axis="0 0 1" name="hip_4" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>
|
|
73
|
+
<geom fromto="0.0 0.0 0.0 0.2 -0.2 0.0" name="rightback_leg_geom" size="0.08" type="capsule" rgba=".999 .2 .1 1"/>
|
|
74
|
+
<body pos="0.2 -0.2 0" name="right_back_foot">
|
|
75
|
+
<joint axis="1 1 0" name="ankle_4" pos="0.0 0.0 0.0" range="30 100" type="hinge"/>
|
|
76
|
+
<geom fromto="0.0 0.0 0.0 0.4 -0.4 0.0" name="fourth_ankle_geom" size="0.08" type="capsule" rgba=".999 .2 .1 1"/>
|
|
77
|
+
</body>
|
|
78
|
+
</body>
|
|
79
|
+
</body>
|
|
80
|
+
</worldbody>
|
|
81
|
+
|
|
82
|
+
<actuator>
|
|
83
|
+
<motor ctrllimited="true" ctrlrange="-1.0 1.0" joint="hip_4" gear="15"/>
|
|
84
|
+
<motor ctrllimited="true" ctrlrange="-1.0 1.0" joint="ankle_4" gear="15"/>
|
|
85
|
+
<motor ctrllimited="true" ctrlrange="-1.0 1.0" joint="hip_1" gear="15"/>
|
|
86
|
+
<motor ctrllimited="true" ctrlrange="-1.0 1.0" joint="ankle_1" gear="15"/>
|
|
87
|
+
<motor ctrllimited="true" ctrlrange="-1.0 1.0" joint="hip_2" gear="15"/>
|
|
88
|
+
<motor ctrllimited="true" ctrlrange="-1.0 1.0" joint="ankle_2" gear="15"/>
|
|
89
|
+
<motor ctrllimited="true" ctrlrange="-1.0 1.0" joint="hip_3" gear="15"/>
|
|
90
|
+
<motor ctrllimited="true" ctrlrange="-1.0 1.0" joint="ankle_3" gear="15"/>
|
|
91
|
+
</actuator>
|
|
92
|
+
</mujoco>
|