imt-ring 1.6.39__py3-none-any.whl → 1.6.42__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.39.dist-info → imt_ring-1.6.42.dist-info}/METADATA +1 -1
- {imt_ring-1.6.39.dist-info → imt_ring-1.6.42.dist-info}/RECORD +6 -6
- ring/ml/base.py +6 -2
- ring/sim2real/sim2real.py +29 -5
- {imt_ring-1.6.39.dist-info → imt_ring-1.6.42.dist-info}/WHEEL +0 -0
- {imt_ring-1.6.39.dist-info → imt_ring-1.6.42.dist-info}/top_level.txt +0 -0
@@ -52,7 +52,7 @@ ring/io/xml/test_from_xml.py,sha256=bckVrVVmEhCwujd_OF9FGYnX3zU3BgztpqGxxmd0htM,
|
|
52
52
|
ring/io/xml/test_to_xml.py,sha256=NGn4VSiFdwhYN5YTBduWMiY9B5dwtxZhCQAR_PXeqKU,946
|
53
53
|
ring/io/xml/to_xml.py,sha256=Wo4iySLw9nM-iVW42AGvMRqjtU2qRc2FD_Zlc7w1IrE,3438
|
54
54
|
ring/ml/__init__.py,sha256=nbh48gaswWeY4S4vT1sply_3ROj2DQ7agjoLR4Ho3T8,1517
|
55
|
-
ring/ml/base.py,sha256=
|
55
|
+
ring/ml/base.py,sha256=HAAM6ehXiyV53cvh1bLvPHIrlM7S4pgN-xcGTI8Mvsw,10238
|
56
56
|
ring/ml/callbacks.py,sha256=oCPXl4_Zcw3g0KRgyyUDmdiGxV0phnDVc_t8rEG4Lls,13737
|
57
57
|
ring/ml/ml_utils.py,sha256=hu189AnHcmkhkpEPZZ19O0gWz3T-YKpWQW9buqDTMow,10915
|
58
58
|
ring/ml/optimizer.py,sha256=TZF0_LmnewzmGVso-zIQJtpWguUW0fW3HeRpIdG_qoI,4763
|
@@ -68,7 +68,7 @@ ring/rendering/mujoco_render.py,sha256=HMvZc04I0-lXPBL3hcnBzV2bNiXQAQM7QcHlG_Obm
|
|
68
68
|
ring/rendering/vispy_render.py,sha256=6Z6S5LNZ7iy9BN1GVb9EDe-Tix5N_SQ1s7ZsfiTSDEA,10261
|
69
69
|
ring/rendering/vispy_visuals.py,sha256=ooBZqppnebeL0ANe6V6zUgnNTtDcdkOsa4vZuM4sx-I,7873
|
70
70
|
ring/sim2real/__init__.py,sha256=gCLYg8IoMdzUagzhCFcfjZ5GavtIU772L7HR0G5hUtM,251
|
71
|
-
ring/sim2real/sim2real.py,sha256=
|
71
|
+
ring/sim2real/sim2real.py,sha256=4MtxsyQmfnSi9llzL0ZB5wmJ5zfAXBv705RbSpI26gY,10373
|
72
72
|
ring/sys_composer/__init__.py,sha256=5J_JJJIHfTPcpxh0v4FqiOs81V1REPUd7pgiw2nAN5E,193
|
73
73
|
ring/sys_composer/delete_sys.py,sha256=cIM9KbyLfg7B9121g7yjzuFbjeNu9cil1dPavAYEgzk,3408
|
74
74
|
ring/sys_composer/inject_sys.py,sha256=PLuxLbXU7hPtAsqvpsEim9hkoVE26ddrg3OipZNvnhU,3504
|
@@ -86,7 +86,7 @@ ring/utils/randomize_sys.py,sha256=G_vBIo0OwQkXL2u0djwbaoaeb02C4LQCTNNloOYIU2M,3
|
|
86
86
|
ring/utils/utils.py,sha256=gKwOXLxWraeZfX6EbBcg3hkq30DcXN0mcRUeOSTNiMo,7336
|
87
87
|
ring/utils/register_gym_envs/__init__.py,sha256=PtPIRBQJ16339xZ9G9VpvqrvcGbQ_Pk_SUz4tQPa9nQ,94
|
88
88
|
ring/utils/register_gym_envs/saddle.py,sha256=tA5CyW_akSXyDm0xJ83CtOrUMVElH0f9vZtEDDJQalI,4422
|
89
|
-
imt_ring-1.6.
|
90
|
-
imt_ring-1.6.
|
91
|
-
imt_ring-1.6.
|
92
|
-
imt_ring-1.6.
|
89
|
+
imt_ring-1.6.42.dist-info/METADATA,sha256=xpcG74pMBIr3v0CQkG9zNZ0BCefDZAVhrOPu31Pb4Uk,4251
|
90
|
+
imt_ring-1.6.42.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
91
|
+
imt_ring-1.6.42.dist-info/top_level.txt,sha256=EiT790-lAyi8iwTzJArH3f2k77rwhDn00q-4PlmvDQo,5
|
92
|
+
imt_ring-1.6.42.dist-info/RECORD,,
|
ring/ml/base.py
CHANGED
@@ -297,8 +297,12 @@ class NoGraph_FilterWrapper(AbstractFilterWrapper):
|
|
297
297
|
|
298
298
|
if self._quat_normalize:
|
299
299
|
assert yhat.shape[-1] == 4, f"yhat.shape={yhat.shape}"
|
300
|
-
|
301
|
-
|
300
|
+
|
301
|
+
# for exporting neural networks to ONNX format, you will have to use
|
302
|
+
# the first version, but for neural network training the second version
|
303
|
+
# is required
|
304
|
+
# yhat = yhat / jnp.linalg.norm(yhat, axis=-1, keepdims=True)
|
305
|
+
yhat = ring.maths.safe_normalize(yhat)
|
302
306
|
|
303
307
|
return yhat, state
|
304
308
|
|
ring/sim2real/sim2real.py
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
from typing import Optional, Tuple
|
2
2
|
|
3
3
|
import jax
|
4
|
+
import tree_utils
|
5
|
+
|
4
6
|
from ring import algebra
|
5
7
|
from ring import base
|
6
8
|
from ring import io
|
7
9
|
from ring import maths
|
8
10
|
from ring.algorithms import generator
|
9
11
|
from ring.algorithms import jcalc
|
10
|
-
import tree_utils
|
11
12
|
|
12
13
|
|
13
14
|
def xs_from_raw(
|
@@ -189,7 +190,14 @@ def delete_to_world_pos_rot(sys: base.System, xs: base.Transform) -> base.Transf
|
|
189
190
|
|
190
191
|
|
191
192
|
def randomize_to_world_pos_rot(
|
192
|
-
key: jax.Array,
|
193
|
+
key: jax.Array,
|
194
|
+
sys: base.System,
|
195
|
+
xs: base.Transform,
|
196
|
+
config: jcalc.MotionConfig,
|
197
|
+
world_joint: str = "free",
|
198
|
+
cor: bool = False,
|
199
|
+
overwrite_q_ref: jax.Array = None,
|
200
|
+
damping=None,
|
193
201
|
) -> base.Transform:
|
194
202
|
"""Replace the transforms of all links that connect to the worldbody
|
195
203
|
by randomize transforms.
|
@@ -210,14 +218,30 @@ def randomize_to_world_pos_rot(
|
|
210
218
|
<x_xy>
|
211
219
|
<options dt="0.01"/>
|
212
220
|
<worldbody>
|
213
|
-
<body name="free" joint="free"
|
221
|
+
<body name="free" joint="free" damping="15.0 15.0 15.0 25.0 25.0 25.0">
|
222
|
+
<geom type="box" mass="1" dim="0.1 0.1 0.1"/>
|
223
|
+
</body>
|
214
224
|
</worldbody>
|
215
225
|
</x_xy>
|
216
226
|
"""
|
217
|
-
|
218
227
|
free_sys = io.load_sys_from_str(free_sys_str)
|
228
|
+
|
229
|
+
dynamic_simulation = True if overwrite_q_ref is not None else False
|
230
|
+
|
231
|
+
if world_joint != "free":
|
232
|
+
if dynamic_simulation:
|
233
|
+
assert damping is not None
|
234
|
+
free_sys = free_sys.change_joint_type("free", world_joint, new_damp=damping)
|
235
|
+
|
219
236
|
_, xs_free = generator.RCMG(
|
220
|
-
free_sys,
|
237
|
+
free_sys,
|
238
|
+
config,
|
239
|
+
finalize_fn=lambda key, q, x, sys: (q, x),
|
240
|
+
cor=cor,
|
241
|
+
dynamic_simulation=dynamic_simulation,
|
242
|
+
dynamic_simulation_kwargs=dict(
|
243
|
+
overwrite_q_ref=(overwrite_q_ref, free_sys.idx_map("q"))
|
244
|
+
),
|
221
245
|
).to_lazy_gen()(key)
|
222
246
|
xs_free = xs_free.take(0, axis=0)
|
223
247
|
xs_free = xs_free.take(free_sys.name_to_idx("free"), axis=1)
|
File without changes
|
File without changes
|