imt-ring 1.2.1__py3-none-any.whl → 1.2.2__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.2.1.dist-info → imt_ring-1.2.2.dist-info}/METADATA +1 -1
- {imt_ring-1.2.1.dist-info → imt_ring-1.2.2.dist-info}/RECORD +8 -8
- ring/algorithms/custom_joints/suntay.py +17 -1
- ring/algorithms/generator/motion_artifacts.py +27 -7
- ring/algorithms/generator/transforms.py +1 -0
- ring/ml/callbacks.py +1 -1
- {imt_ring-1.2.1.dist-info → imt_ring-1.2.2.dist-info}/WHEEL +0 -0
- {imt_ring-1.2.1.dist-info → imt_ring-1.2.2.dist-info}/top_level.txt +0 -0
@@ -12,14 +12,14 @@ ring/algorithms/sensors.py,sha256=Y3Wo9qj3BWKoIHB0V04QwyD-Z5m4BrAjfBX8Pn6y9Lg,18
|
|
12
12
|
ring/algorithms/custom_joints/__init__.py,sha256=33WBnaBJMtq3vVcpMm7zmyeMrLY9PyV_8-wk5oSF65g,227
|
13
13
|
ring/algorithms/custom_joints/rr_imp_joint.py,sha256=a3JT0w7pB94kZ95eBR8ZO853eSeyjFoiXmhYlaXoHDE,2392
|
14
14
|
ring/algorithms/custom_joints/rr_joint.py,sha256=jnRtjtOCALMaq2_0bcu2d7qgfQ6etXpoh43MioRaDmY,1000
|
15
|
-
ring/algorithms/custom_joints/suntay.py,sha256=
|
15
|
+
ring/algorithms/custom_joints/suntay.py,sha256=d0Z54tIXiepMixE40W5H8JKxrT5U6VskPm2L2kKnQPw,13680
|
16
16
|
ring/algorithms/generator/__init__.py,sha256=p4ucl0zQtp5NwNoXIRjmTzGGRu2WOAWFfNmYRPwQles,912
|
17
17
|
ring/algorithms/generator/base.py,sha256=QDmzMAgtaK5M9WDl39qjXYfBa99d83vCPWEkYYmsplk,14952
|
18
18
|
ring/algorithms/generator/batch.py,sha256=MZurZmQDH1vncoNbCspVNGNlfP0R87J6_HC7MMIqQ6A,8478
|
19
|
-
ring/algorithms/generator/motion_artifacts.py,sha256
|
19
|
+
ring/algorithms/generator/motion_artifacts.py,sha256=aKdkZU5OF4_aKyL4Yo-ftZRwrDCve1LuuREGAUlTqtI,8551
|
20
20
|
ring/algorithms/generator/pd_control.py,sha256=3pOaYig26vmp8gippDfy2KNJRZO3kr0rGd_PBIuEROM,5759
|
21
21
|
ring/algorithms/generator/randomize.py,sha256=G_vBIo0OwQkXL2u0djwbaoaeb02C4LQCTNNloOYIU2M,3699
|
22
|
-
ring/algorithms/generator/transforms.py,sha256=
|
22
|
+
ring/algorithms/generator/transforms.py,sha256=nvNDvM20tEw9Zd0ra0TxA25uf01L40Y2UKvtQmOrlGo,12782
|
23
23
|
ring/algorithms/generator/types.py,sha256=CAhvDK5qiHnrGtkCVccB07doiz_D6lHJ35B7sW0pyZA,1110
|
24
24
|
ring/io/__init__.py,sha256=1gEJdyDCbldbbm8QeZbLmhzSKmaQ-UqTmQgu4DBH2Z4,328
|
25
25
|
ring/io/examples.py,sha256=KLf2iCagvRfjs9MCnQsLUlfGBjrQKrD-Qv8U0TtX6Ek,1114
|
@@ -52,7 +52,7 @@ ring/io/xml/test_to_xml.py,sha256=NGn4VSiFdwhYN5YTBduWMiY9B5dwtxZhCQAR_PXeqKU,94
|
|
52
52
|
ring/io/xml/to_xml.py,sha256=fohb-jWMf2cxVdT5dmknsGyrNMseICSbKEz_urbaWbQ,3407
|
53
53
|
ring/ml/__init__.py,sha256=669ueX_IMTmhAE-4xCjjp90mTlj28u8voq5_5KE0ZY0,944
|
54
54
|
ring/ml/base.py,sha256=5TpJtdfmlAv2j_f8yDW1U_wY4jZ2lA74pNR524JQTts,8905
|
55
|
-
ring/ml/callbacks.py,sha256=
|
55
|
+
ring/ml/callbacks.py,sha256=yrh9YWdEATEJq3fi9lQR0OU3hFENPpPO2UD4cyTRlIk,13109
|
56
56
|
ring/ml/ml_utils.py,sha256=hQEmeZoahdJyFrz0NZXYi1Yijl7GvPBdqwzZBzlUIUM,7638
|
57
57
|
ring/ml/optimizer.py,sha256=OP70P70YcX-2Z-cuoMluFk-L5Vhh_MmqiHdM9OZqyhI,4703
|
58
58
|
ring/ml/ringnet.py,sha256=OWRDu2COmptzbpJWlRLbPIn_ioKZCAd_iu-eiY_aPjk,8521
|
@@ -77,7 +77,7 @@ ring/utils/hdf5.py,sha256=BzXwVypZmEZeHVgeGZ78YYdi10NEQtnPhdrb8dQAXo0,5856
|
|
77
77
|
ring/utils/normalizer.py,sha256=67L2BU1MRsMT4pD41ta3JJMppLN0ozFmnwrmXDtnqrQ,1698
|
78
78
|
ring/utils/path.py,sha256=hAfSlqRi-ew536RnjDDM7IKapdMJc-EvhrR0Y-BCFWc,1265
|
79
79
|
ring/utils/utils.py,sha256=AzOzR95oOyfdtJhjt5iIb35u611NlTb1Ds4QDKrGMOM,4967
|
80
|
-
imt_ring-1.2.
|
81
|
-
imt_ring-1.2.
|
82
|
-
imt_ring-1.2.
|
83
|
-
imt_ring-1.2.
|
80
|
+
imt_ring-1.2.2.dist-info/METADATA,sha256=rGaRlA9bTJH-N8QLbO4tokVge6UMnx-2Pddy5QwMvXA,3104
|
81
|
+
imt_ring-1.2.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
82
|
+
imt_ring-1.2.2.dist-info/top_level.txt,sha256=EiT790-lAyi8iwTzJArH3f2k77rwhDn00q-4PlmvDQo,5
|
83
|
+
imt_ring-1.2.2.dist-info/RECORD,,
|
@@ -8,6 +8,7 @@ from tree_utils import PyTree
|
|
8
8
|
|
9
9
|
import ring
|
10
10
|
from ring import maths
|
11
|
+
from ring.algorithms import jcalc
|
11
12
|
from ring.algorithms._random import random_angle_over_time
|
12
13
|
|
13
14
|
Params = PyTree
|
@@ -258,6 +259,9 @@ def register_suntay(sconfig: SuntayConfig, name: str = "suntay"):
|
|
258
259
|
mconfig.cdf_bins_max,
|
259
260
|
mconfig.interpolation_method,
|
260
261
|
)
|
262
|
+
return _apply_rom(qs_flexion)
|
263
|
+
|
264
|
+
def _apply_rom(qs_flexion):
|
261
265
|
return restrict(
|
262
266
|
qs_flexion,
|
263
267
|
sconfig.flexion_rot_min,
|
@@ -267,16 +271,26 @@ def register_suntay(sconfig: SuntayConfig, name: str = "suntay"):
|
|
267
271
|
method=sconfig.flexion_rot_restrict_method,
|
268
272
|
)
|
269
273
|
|
274
|
+
def coordinate_vector_to_q_suntay(q_flexion):
|
275
|
+
q_flexion = ring.maths.wrap_to_pi(q_flexion)
|
276
|
+
return _apply_rom(q_flexion)
|
277
|
+
|
270
278
|
joint_model = ring.JointModel(
|
271
279
|
transform=_transform_suntay,
|
280
|
+
motion=[jcalc.mrx],
|
272
281
|
rcmg_draw_fn=_draw_flexion_angle,
|
282
|
+
p_control_term=jcalc._p_control_term_rxyz,
|
283
|
+
qd_from_q=jcalc._qd_from_q_cartesian,
|
284
|
+
coordinate_vector_to_q=coordinate_vector_to_q_suntay,
|
285
|
+
inv_kin=None,
|
273
286
|
init_joint_params=_init_joint_params_suntay,
|
274
287
|
utilities=dict(
|
275
288
|
Q_S_H_alpha_beta_gamma=_utils_Q_S_H_alpha_beta_gamma,
|
276
289
|
find_suntay_joint=_utils_find_suntay_joint,
|
290
|
+
sconfig=sconfig,
|
277
291
|
),
|
278
292
|
)
|
279
|
-
ring.register_new_joint_type(name, joint_model, 1,
|
293
|
+
ring.register_new_joint_type(name, joint_model, 1, overwrite=True)
|
280
294
|
|
281
295
|
|
282
296
|
def MLP_DrawnFnPair(
|
@@ -291,6 +305,8 @@ def MLP_DrawnFnPair(
|
|
291
305
|
|
292
306
|
if flexion_center is None:
|
293
307
|
flexion_center = (flexion_mn + flexion_mx) / 2
|
308
|
+
else:
|
309
|
+
flexion_center = jnp.array(flexion_center)
|
294
310
|
|
295
311
|
@hk.without_apply_rng
|
296
312
|
@hk.transform
|
@@ -2,9 +2,10 @@ import warnings
|
|
2
2
|
|
3
3
|
import jax
|
4
4
|
import jax.numpy as jnp
|
5
|
+
import tree_utils
|
6
|
+
|
5
7
|
from ring import base
|
6
8
|
from ring import io
|
7
|
-
import tree_utils
|
8
9
|
|
9
10
|
|
10
11
|
def imu_reference_link_name(imu_link_name: str) -> str:
|
@@ -15,11 +16,21 @@ def unactuated_subsystem(sys) -> list[str]:
|
|
15
16
|
return [imu_reference_link_name(name) for name in sys.findall_imus()]
|
16
17
|
|
17
18
|
|
18
|
-
def _subsystem_factory(
|
19
|
+
def _subsystem_factory(
|
20
|
+
imu_name: str,
|
21
|
+
pos_min_max: float,
|
22
|
+
translational_stif: float,
|
23
|
+
translational_damp: float,
|
24
|
+
) -> base.System:
|
19
25
|
assert pos_min_max >= 0
|
20
26
|
pos = f'pos_min="-{pos_min_max} -{pos_min_max} -{pos_min_max}" pos_max="{pos_min_max} {pos_min_max} {pos_min_max}"' # noqa: E501
|
21
|
-
stiff =
|
22
|
-
|
27
|
+
stiff = (
|
28
|
+
f'spring_stiff="{translational_stif} {translational_stif} {translational_stif}"'
|
29
|
+
)
|
30
|
+
translational_damp = translational_stif * translational_damp
|
31
|
+
damping = (
|
32
|
+
f'damping="{translational_damp} {translational_damp} {translational_damp}"'
|
33
|
+
)
|
23
34
|
return io.load_sys_from_str(
|
24
35
|
f"""
|
25
36
|
<x_xy>
|
@@ -34,12 +45,16 @@ def _subsystem_factory(imu_name: str, pos_min_max: float) -> base.System:
|
|
34
45
|
def inject_subsystems(
|
35
46
|
sys: base.System,
|
36
47
|
pos_min_max: float = 0.0,
|
48
|
+
rotational_stif: float = 0.3,
|
49
|
+
rotational_damp: float = 0.1,
|
50
|
+
translational_stif: float = 50.0,
|
51
|
+
translational_damp: float = 0.1,
|
37
52
|
**kwargs,
|
38
53
|
) -> base.System:
|
39
54
|
imu_idx_to_name_map = {sys.name_to_idx(imu): imu for imu in sys.findall_imus()}
|
40
55
|
|
41
|
-
default_spher_stif = jnp.ones((3,)) *
|
42
|
-
default_spher_damp = default_spher_stif *
|
56
|
+
default_spher_stif = jnp.ones((3,)) * rotational_stif
|
57
|
+
default_spher_damp = default_spher_stif * rotational_damp
|
43
58
|
for imu in sys.findall_imus():
|
44
59
|
sys = sys.unfreeze(imu, "spherical")
|
45
60
|
# set default stiffness and damping of spherical joint
|
@@ -51,7 +66,12 @@ def inject_subsystems(
|
|
51
66
|
|
52
67
|
_imu = imu_reference_link_name(imu)
|
53
68
|
sys = sys.change_link_name(imu, _imu)
|
54
|
-
sys = sys.inject_system(
|
69
|
+
sys = sys.inject_system(
|
70
|
+
_subsystem_factory(
|
71
|
+
imu, pos_min_max, translational_stif, translational_damp
|
72
|
+
),
|
73
|
+
_imu,
|
74
|
+
)
|
55
75
|
|
56
76
|
# attach geoms to newly injected link
|
57
77
|
new_geoms = []
|
ring/ml/callbacks.py
CHANGED
@@ -245,7 +245,7 @@ class SaveParamsTrainingLoopCallback(training_loop.TrainingLoopCallback):
|
|
245
245
|
extension="pickle",
|
246
246
|
)
|
247
247
|
|
248
|
-
pickle_save(ele.params, filename, overwrite=
|
248
|
+
pickle_save(ele.params, filename, overwrite=False)
|
249
249
|
if self.upload:
|
250
250
|
success = False
|
251
251
|
for logger in self._loggers:
|
File without changes
|
File without changes
|