imt-ring 1.6.1__py3-none-any.whl → 1.6.3__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {imt_ring-1.6.1.dist-info → imt_ring-1.6.3.dist-info}/METADATA +1 -1
- {imt_ring-1.6.1.dist-info → imt_ring-1.6.3.dist-info}/RECORD +9 -9
- {imt_ring-1.6.1.dist-info → imt_ring-1.6.3.dist-info}/WHEEL +1 -1
- ring/algorithms/generator/base.py +3 -0
- ring/algorithms/generator/finalize_fns.py +3 -2
- ring/algorithms/sensors.py +16 -4
- ring/maths.py +1 -1
- ring/rendering/mujoco_render.py +4 -1
- {imt_ring-1.6.1.dist-info → imt_ring-1.6.3.dist-info}/top_level.txt +0 -0
@@ -1,22 +1,22 @@
|
|
1
1
|
ring/__init__.py,sha256=2v6WHlNPucj1XGhDYw-3AlMQGTqH-e4KYK0IaMnBV5s,4760
|
2
2
|
ring/algebra.py,sha256=F0GwbP8LQP5qGVkoMUYJmkp9Hn2nKAVIkCVYDEjNjGU,3128
|
3
3
|
ring/base.py,sha256=kzBQ54V2xq4KsqRzflyMQ64V-jl8j7eIAsIPIE0gFDk,33127
|
4
|
-
ring/maths.py,sha256=
|
4
|
+
ring/maths.py,sha256=zGm5XagiKTaIJp310VcqVEVUuLhv3FPS-TJ-TFzIrwM,12207
|
5
5
|
ring/spatial.py,sha256=nmZ-UhRanhyM34bez8uCS4wMwaKqLkuEbgKGP5XNH60,2351
|
6
6
|
ring/algorithms/__init__.py,sha256=IiK9EN5Xgs3dB075-A-H-Yad0Z7vzvKIJF2g6X_-C_8,1224
|
7
7
|
ring/algorithms/_random.py,sha256=fc26yEQjSjtf0NluZ41CyeGIRci0ldrRlThueHR9H7U,14007
|
8
8
|
ring/algorithms/dynamics.py,sha256=_TwclBXe6vi5C5iJWAIeUIJEIMHQ_1QTmnHvCEpVO0M,10867
|
9
9
|
ring/algorithms/jcalc.py,sha256=bM8VARgqEiVPy7632geKYGk4MZddZfI8XHdW5kXF3HI,28594
|
10
10
|
ring/algorithms/kinematics.py,sha256=DOboHI517Vx0pRJUFZtZPmK_qFaiKiQe-37B-M0aC-c,7422
|
11
|
-
ring/algorithms/sensors.py,sha256=
|
11
|
+
ring/algorithms/sensors.py,sha256=06x7RfhoQ6dx1B_TAEuCKxNTiicQDDBxcmzRtsCAxsM,18125
|
12
12
|
ring/algorithms/custom_joints/__init__.py,sha256=fzeE7TdUhmGgbbFAyis1tKcyQ4Fo8LigDwD3hUVnH_w,316
|
13
13
|
ring/algorithms/custom_joints/rr_imp_joint.py,sha256=_YJK0p8_0MHFtr1NuGnNZoxTbwaMQyUjYv7EtsPiU3A,2402
|
14
14
|
ring/algorithms/custom_joints/rr_joint.py,sha256=jnRtjtOCALMaq2_0bcu2d7qgfQ6etXpoh43MioRaDmY,1000
|
15
15
|
ring/algorithms/custom_joints/suntay.py,sha256=tOEGM304XciHO4pmvxr4faA4xXVO4N2HlPdFmXKbcrw,16726
|
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=ZW6tJSUiNKtRCYIsbCf6e6kRBbmuCLzbZj4ppNLVwJY,14368
|
18
18
|
ring/algorithms/generator/batch.py,sha256=ylootnXmj-JyuB_f5OCknHst9wFKO3gkjQbMrFNXY2g,2513
|
19
|
-
ring/algorithms/generator/finalize_fns.py,sha256=
|
19
|
+
ring/algorithms/generator/finalize_fns.py,sha256=LUw1Wc2YrmMRRh4RF704ob3bZOXktAZAbbLoBm_p1yw,9131
|
20
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
|
@@ -63,7 +63,7 @@ ring/ml/params/0x13e3518065c21cd8.pickle,sha256=Zh2k1zK-TNxJl5F7nyTeQ9001qqRE_df
|
|
63
63
|
ring/ml/params/0x1d76628065a71e0f.pickle,sha256=YTNVuvfw-nCRD9BH1PZYcR9uCFpNWDhw8Lc50eDn_EE,9351038
|
64
64
|
ring/rendering/__init__.py,sha256=Zf7qOdzK3t2hljIrs5P4zFhzHljLSMRyDDZO2YlZk4k,75
|
65
65
|
ring/rendering/base_render.py,sha256=Mv9SRLEmuoPVhi46UIjb6xCkKmbWCwIyENGx7nu9REM,9617
|
66
|
-
ring/rendering/mujoco_render.py,sha256=
|
66
|
+
ring/rendering/mujoco_render.py,sha256=R8qxqItakBlptbQpCzsZoVfdWYhSMwZYQzaCKbUigYU,7987
|
67
67
|
ring/rendering/vispy_render.py,sha256=QmRyA7Hqk3uS1SKjcncwc4_vd1m4yWryW2X0i4jRvCw,10260
|
68
68
|
ring/rendering/vispy_visuals.py,sha256=ooBZqppnebeL0ANe6V6zUgnNTtDcdkOsa4vZuM4sx-I,7873
|
69
69
|
ring/sim2real/__init__.py,sha256=gCLYg8IoMdzUagzhCFcfjZ5GavtIU772L7HR0G5hUtM,251
|
@@ -83,7 +83,7 @@ ring/utils/randomize_sys.py,sha256=G_vBIo0OwQkXL2u0djwbaoaeb02C4LQCTNNloOYIU2M,3
|
|
83
83
|
ring/utils/utils.py,sha256=k7t-QxMWrNRnjfNB9rSobmLCmhJigE8__gkT-Il0Ee4,6492
|
84
84
|
ring/utils/register_gym_envs/__init__.py,sha256=PtPIRBQJ16339xZ9G9VpvqrvcGbQ_Pk_SUz4tQPa9nQ,94
|
85
85
|
ring/utils/register_gym_envs/saddle.py,sha256=tA5CyW_akSXyDm0xJ83CtOrUMVElH0f9vZtEDDJQalI,4422
|
86
|
-
imt_ring-1.6.
|
87
|
-
imt_ring-1.6.
|
88
|
-
imt_ring-1.6.
|
89
|
-
imt_ring-1.6.
|
86
|
+
imt_ring-1.6.3.dist-info/METADATA,sha256=uFTNWR0YQbQLE50Oby-D2H3NSpdycgCwzKaz_UxxSP8,3104
|
87
|
+
imt_ring-1.6.3.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
88
|
+
imt_ring-1.6.3.dist-info/top_level.txt,sha256=EiT790-lAyi8iwTzJArH3f2k77rwhDn00q-4PlmvDQo,5
|
89
|
+
imt_ring-1.6.3.dist-info/RECORD,,
|
@@ -30,6 +30,7 @@ class RCMG:
|
|
30
30
|
add_X_jointaxes_kwargs: dict = dict(),
|
31
31
|
add_y_relpose: bool = False,
|
32
32
|
add_y_rootincl: bool = False,
|
33
|
+
add_y_rootincl_kwargs: dict = dict(),
|
33
34
|
sys_ml: Optional[base.System] = None,
|
34
35
|
randomize_positions: bool = False,
|
35
36
|
randomize_motion_artifacts: bool = False,
|
@@ -67,6 +68,7 @@ class RCMG:
|
|
67
68
|
add_X_jointaxes_kwargs=add_X_jointaxes_kwargs,
|
68
69
|
add_y_relpose=add_y_relpose,
|
69
70
|
add_y_rootincl=add_y_rootincl,
|
71
|
+
add_y_rootincl_kwargs=add_y_rootincl_kwargs,
|
70
72
|
sys_ml=sys_ml,
|
71
73
|
randomize_positions=randomize_positions,
|
72
74
|
randomize_motion_artifacts=randomize_motion_artifacts,
|
@@ -232,6 +234,7 @@ def _build_mconfig_batched_generator(
|
|
232
234
|
add_X_jointaxes_kwargs: dict,
|
233
235
|
add_y_relpose: bool,
|
234
236
|
add_y_rootincl: bool,
|
237
|
+
add_y_rootincl_kwargs: dict,
|
235
238
|
sys_ml: base.System,
|
236
239
|
randomize_positions: bool,
|
237
240
|
randomize_motion_artifacts: bool,
|
@@ -77,12 +77,13 @@ class RelPose:
|
|
77
77
|
|
78
78
|
|
79
79
|
class RootIncl:
|
80
|
-
def __init__(self, sys: base.System):
|
80
|
+
def __init__(self, sys: base.System, **kwargs):
|
81
81
|
self.sys = sys
|
82
|
+
self.kwargs = kwargs
|
82
83
|
|
83
84
|
def __call__(self, Xy, extras):
|
84
85
|
(X, y), (key, q, x, sys_x) = Xy, extras
|
85
|
-
y_root_incl = sensors.root_incl(self.sys, x, sys_x)
|
86
|
+
y_root_incl = sensors.root_incl(self.sys, x, sys_x, **self.kwargs)
|
86
87
|
y = utils.dict_union(y, y_root_incl)
|
87
88
|
return (X, y), (key, q, x, sys_x)
|
88
89
|
|
ring/algorithms/sensors.py
CHANGED
@@ -330,7 +330,10 @@ def rel_pose(
|
|
330
330
|
|
331
331
|
|
332
332
|
def root_incl(
|
333
|
-
sys: base.System,
|
333
|
+
sys: base.System,
|
334
|
+
x: base.Transform,
|
335
|
+
sys_x: base.System,
|
336
|
+
child_to_parent: bool = False,
|
334
337
|
) -> dict[str, jax.Array]:
|
335
338
|
# (time, nlinks, 4) -> (nlinks, time, 4)
|
336
339
|
rots = x.rot.transpose((1, 0, 2))
|
@@ -341,7 +344,10 @@ def root_incl(
|
|
341
344
|
def f(_, __, name: str, parent: int):
|
342
345
|
if parent != -1:
|
343
346
|
return
|
344
|
-
|
347
|
+
q_i = maths.quat_project(rots[l_map[name]], jnp.array([0.0, 0, 1]))[1]
|
348
|
+
if child_to_parent:
|
349
|
+
q_i = maths.quat_inv(q_i)
|
350
|
+
y[name] = q_i
|
345
351
|
|
346
352
|
sys.scan(f, "ll", sys.link_names, sys.link_parents)
|
347
353
|
|
@@ -349,7 +355,10 @@ def root_incl(
|
|
349
355
|
|
350
356
|
|
351
357
|
def root_full(
|
352
|
-
sys: base.System,
|
358
|
+
sys: base.System,
|
359
|
+
x: base.Transform,
|
360
|
+
sys_x: base.System,
|
361
|
+
child_to_parent: bool = False,
|
353
362
|
) -> dict[str, jax.Array]:
|
354
363
|
# (time, nlinks, 4) -> (nlinks, time, 4)
|
355
364
|
rots = x.rot.transpose((1, 0, 2))
|
@@ -360,7 +369,10 @@ def root_full(
|
|
360
369
|
def f(_, __, name: str, parent: int):
|
361
370
|
if parent != -1:
|
362
371
|
return
|
363
|
-
|
372
|
+
q_i = rots[l_map[name]]
|
373
|
+
if child_to_parent:
|
374
|
+
q_i = maths.quat_inv(q_i)
|
375
|
+
y[name] = q_i
|
364
376
|
|
365
377
|
sys.scan(f, "ll", sys.link_names, sys.link_parents)
|
366
378
|
|
ring/maths.py
CHANGED
@@ -119,7 +119,7 @@ def quat_inv(q: jnp.ndarray) -> jnp.ndarray:
|
|
119
119
|
|
120
120
|
@partial(jnp.vectorize, signature="(3),(4)->(3)")
|
121
121
|
def rotate(vector: jnp.ndarray, quat: jnp.ndarray):
|
122
|
-
"""Rotates a vector `vector` by a *unit* quaternion `quat`."""
|
122
|
+
"""Rotates a vector `vector` by a *unit* quaternion `quat`. q x vec x q^*"""
|
123
123
|
qvec = jnp.array([0, *vector])
|
124
124
|
return rotate_quat(qvec, quat)[1:4]
|
125
125
|
|
ring/rendering/mujoco_render.py
CHANGED
@@ -157,13 +157,16 @@ def _array_to_str(arr: Sequence[float]) -> str:
|
|
157
157
|
return "".join(["{:.4f} ".format(np.round(value, 4)) for value in arr])[:-1]
|
158
158
|
|
159
159
|
|
160
|
+
_default_lights = {-1: '<light pos="0 0 4" dir="0 0 -1"/>'}
|
161
|
+
|
162
|
+
|
160
163
|
class MujocoScene:
|
161
164
|
def __init__(
|
162
165
|
self,
|
163
166
|
height: int = 240,
|
164
167
|
width: int = 320,
|
165
168
|
add_cameras: dict[int, str | Sequence[str]] = {},
|
166
|
-
add_lights: dict[int, str | Sequence[str]] =
|
169
|
+
add_lights: dict[int, str | Sequence[str]] = _default_lights,
|
167
170
|
show_stars: bool = True,
|
168
171
|
show_floor: bool = True,
|
169
172
|
debug: bool = False,
|
File without changes
|