imt-ring 1.5.0__py3-none-any.whl → 1.5.1__py3-none-any.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.
- {imt_ring-1.5.0.dist-info → imt_ring-1.5.1.dist-info}/METADATA +1 -1
- {imt_ring-1.5.0.dist-info → imt_ring-1.5.1.dist-info}/RECORD +6 -6
- ring/algorithms/generator/base.py +13 -10
- ring/algorithms/generator/motion_artifacts.py +14 -0
- {imt_ring-1.5.0.dist-info → imt_ring-1.5.1.dist-info}/WHEEL +0 -0
- {imt_ring-1.5.0.dist-info → imt_ring-1.5.1.dist-info}/top_level.txt +0 -0
@@ -14,10 +14,10 @@ ring/algorithms/custom_joints/rr_imp_joint.py,sha256=a3JT0w7pB94kZ95eBR8ZO853eSe
|
|
14
14
|
ring/algorithms/custom_joints/rr_joint.py,sha256=jnRtjtOCALMaq2_0bcu2d7qgfQ6etXpoh43MioRaDmY,1000
|
15
15
|
ring/algorithms/custom_joints/suntay.py,sha256=7-kym1kMDwqYD_2um1roGcBeB8BlTCPe1wljuNGNARA,16676
|
16
16
|
ring/algorithms/generator/__init__.py,sha256=bF-CW3x2x-o6KWESKy-DuxzZPh3UNSjJb_MaAcSHGsQ,277
|
17
|
-
ring/algorithms/generator/base.py,sha256=
|
17
|
+
ring/algorithms/generator/base.py,sha256=LOckKDehObDwgOSu_uBhlqkxdztJ0NHTP2mbxwtEcwQ,13335
|
18
18
|
ring/algorithms/generator/batch.py,sha256=Hwh5jYZQEmkx73YaXjWd6sZdikmj43spE7DCzGDHXtE,6637
|
19
19
|
ring/algorithms/generator/finalize_fns.py,sha256=0fbtwQw89_w0ytQ_aJ877CZGY5fbtb8sbsRO0O8pT34,9081
|
20
|
-
ring/algorithms/generator/motion_artifacts.py,sha256=
|
20
|
+
ring/algorithms/generator/motion_artifacts.py,sha256=2VJbldVDbI3PSyboshIbtYvSAKzBBwGV7cQfYjqvluM,9167
|
21
21
|
ring/algorithms/generator/pd_control.py,sha256=XJ_Gd5AkIRh-jBrMfQyMXjVwhx2gCNHznjzFbmAwhZs,5767
|
22
22
|
ring/algorithms/generator/setup_fns.py,sha256=MFz3czHBeWs1Zk1A8O02CyQpQ-NCyW9PMpbqmKit6es,1455
|
23
23
|
ring/algorithms/generator/types.py,sha256=HjNyATFSLfHkXlzdJhvUkiqnhzpXFDDXmWS3LYBlOtU,721
|
@@ -81,7 +81,7 @@ ring/utils/normalizer.py,sha256=67L2BU1MRsMT4pD41ta3JJMppLN0ozFmnwrmXDtnqrQ,1698
|
|
81
81
|
ring/utils/path.py,sha256=hAfSlqRi-ew536RnjDDM7IKapdMJc-EvhrR0Y-BCFWc,1265
|
82
82
|
ring/utils/randomize_sys.py,sha256=G_vBIo0OwQkXL2u0djwbaoaeb02C4LQCTNNloOYIU2M,3699
|
83
83
|
ring/utils/utils.py,sha256=VkB0Gvmlaz2MZdntgjWA0rOpRkvIRpLWRFgIofoY7hs,5441
|
84
|
-
imt_ring-1.5.
|
85
|
-
imt_ring-1.5.
|
86
|
-
imt_ring-1.5.
|
87
|
-
imt_ring-1.5.
|
84
|
+
imt_ring-1.5.1.dist-info/METADATA,sha256=C4QFyeh8L1nslQdrwJ6tBtL_dqDRGsUl7W8ZExZA2hc,3104
|
85
|
+
imt_ring-1.5.1.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
86
|
+
imt_ring-1.5.1.dist-info/top_level.txt,sha256=EiT790-lAyi8iwTzJArH3f2k77rwhDn00q-4PlmvDQo,5
|
87
|
+
imt_ring-1.5.1.dist-info/RECORD,,
|
@@ -34,7 +34,7 @@ class RCMG:
|
|
34
34
|
randomize_motion_artifacts: bool = False,
|
35
35
|
randomize_joint_params: bool = False,
|
36
36
|
imu_motion_artifacts: bool = False,
|
37
|
-
imu_motion_artifacts_kwargs: dict = dict(
|
37
|
+
imu_motion_artifacts_kwargs: dict = dict(),
|
38
38
|
dynamic_simulation: bool = False,
|
39
39
|
dynamic_simulation_kwargs: dict = dict(),
|
40
40
|
output_transform: Optional[Callable] = None,
|
@@ -50,9 +50,6 @@ class RCMG:
|
|
50
50
|
for c in config:
|
51
51
|
assert c.is_feasible()
|
52
52
|
|
53
|
-
if cor:
|
54
|
-
sys = [s._replace_free_with_cor() for s in sys]
|
55
|
-
|
56
53
|
self.gens = []
|
57
54
|
for _sys in sys:
|
58
55
|
self.gens.append(
|
@@ -78,6 +75,7 @@ class RCMG:
|
|
78
75
|
output_transform=output_transform,
|
79
76
|
keep_output_extras=keep_output_extras,
|
80
77
|
use_link_number_in_Xy=use_link_number_in_Xy,
|
78
|
+
cor=cor,
|
81
79
|
)
|
82
80
|
)
|
83
81
|
|
@@ -238,6 +236,7 @@ def _build_mconfig_batched_generator(
|
|
238
236
|
output_transform: Callable | None,
|
239
237
|
keep_output_extras: bool,
|
240
238
|
use_link_number_in_Xy: bool,
|
239
|
+
cor: bool,
|
241
240
|
) -> types.BatchedGenerator:
|
242
241
|
|
243
242
|
if add_X_jointaxes or add_y_relpose or add_y_rootincl:
|
@@ -284,13 +283,17 @@ def _build_mconfig_batched_generator(
|
|
284
283
|
for f in pipe:
|
285
284
|
key, consume = jax.random.split(key)
|
286
285
|
sys = f(consume, sys)
|
286
|
+
if cor:
|
287
|
+
sys = sys._replace_free_with_cor()
|
287
288
|
return sys
|
288
289
|
|
289
290
|
def _finalize_fn(Xy: types.Xy, extras: types.OutputExtras):
|
290
291
|
pipe = []
|
291
292
|
if dynamic_simulation:
|
292
293
|
pipe.append(finalize_fns.DynamicalSimulation(**dynamic_simulation_kwargs))
|
293
|
-
if imu_motion_artifacts and imu_motion_artifacts_kwargs
|
294
|
+
if imu_motion_artifacts and imu_motion_artifacts_kwargs.get(
|
295
|
+
"hide_injected_bodies", True
|
296
|
+
):
|
294
297
|
pipe.append(motion_artifacts.HideInjectedBodies())
|
295
298
|
if finalize_fn is not None:
|
296
299
|
pipe.append(finalize_fns.FinalizeFn(finalize_fn))
|
@@ -312,15 +315,15 @@ def _build_mconfig_batched_generator(
|
|
312
315
|
return Xy, extras
|
313
316
|
|
314
317
|
def _gen(key: types.PRNGKey):
|
318
|
+
key, *consume = jax.random.split(key, len(config) + 1)
|
319
|
+
syss = jax.vmap(_setup_fn, (0, None))(jnp.array(consume), sys)
|
320
|
+
|
315
321
|
qs = []
|
316
|
-
for _config in config:
|
317
|
-
key, _q = draw_random_q(key,
|
322
|
+
for i, _config in enumerate(config):
|
323
|
+
key, _q = draw_random_q(key, syss[i], _config)
|
318
324
|
qs.append(_q)
|
319
325
|
qs = jnp.stack(qs)
|
320
326
|
|
321
|
-
key, *consume = jax.random.split(key, len(config) + 1)
|
322
|
-
syss = jax.vmap(_setup_fn, (0, None))(jnp.array(consume), sys)
|
323
|
-
|
324
327
|
@jax.vmap
|
325
328
|
def _vmapped_context(key, q, sys):
|
326
329
|
x, _ = jax.vmap(kinematics.forward_kinematics_transforms, (None, 0))(sys, q)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import inspect
|
1
2
|
import warnings
|
2
3
|
|
3
4
|
import jax
|
@@ -127,6 +128,7 @@ def setup_fn_randomize_damping_stiffness_factory(
|
|
127
128
|
prob_rigid: float = 0.0,
|
128
129
|
all_imus_either_rigid_or_flex: bool = False,
|
129
130
|
imus_surely_rigid: list[str] = [],
|
131
|
+
**kwargs,
|
130
132
|
):
|
131
133
|
assert 0 <= prob_rigid <= 1
|
132
134
|
assert prob_rigid != 1, "Use `imu_motion_artifacts`=False instead."
|
@@ -198,6 +200,18 @@ def setup_fn_randomize_damping_stiffness_factory(
|
|
198
200
|
return setup_fn_randomize_damping_stiffness
|
199
201
|
|
200
202
|
|
203
|
+
# assert that there exists no keyword arg duplicate which would induce ambiguity
|
204
|
+
kwargs = lambda f: set(inspect.signature(f).parameters.keys())
|
205
|
+
assert (
|
206
|
+
len(
|
207
|
+
kwargs(inject_subsystems).intersection(
|
208
|
+
kwargs(setup_fn_randomize_damping_stiffness_factory)
|
209
|
+
)
|
210
|
+
)
|
211
|
+
== 1
|
212
|
+
)
|
213
|
+
|
214
|
+
|
201
215
|
def _match_q_x_between_sys(
|
202
216
|
sys_small: base.System,
|
203
217
|
q_large: jax.Array,
|
File without changes
|
File without changes
|