imt-ring 1.6.22__py3-none-any.whl → 1.6.24__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.22.dist-info → imt_ring-1.6.24.dist-info}/METADATA +9 -9
- {imt_ring-1.6.22.dist-info → imt_ring-1.6.24.dist-info}/RECORD +6 -6
- {imt_ring-1.6.22.dist-info → imt_ring-1.6.24.dist-info}/WHEEL +1 -1
- ring/algorithms/_random.py +47 -34
- ring/algorithms/jcalc.py +10 -1
- {imt_ring-1.6.22.dist-info → imt_ring-1.6.24.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: imt-ring
|
3
|
-
Version: 1.6.
|
3
|
+
Version: 1.6.24
|
4
4
|
Summary: RING: Recurrent Inertial Graph-based Estimator
|
5
5
|
Author-email: Simon Bachhuber <simon.bachhuber@fau.de>
|
6
6
|
Project-URL: Homepage, https://github.com/SimiPixel/ring
|
@@ -22,14 +22,14 @@ Requires-Dist: optax
|
|
22
22
|
Requires-Dist: dm-haiku
|
23
23
|
Requires-Dist: pyyaml
|
24
24
|
Provides-Extra: dev
|
25
|
-
Requires-Dist: mkdocs
|
26
|
-
Requires-Dist: mkdocs-material
|
27
|
-
Requires-Dist: mkdocstrings
|
28
|
-
Requires-Dist: mkdocstrings-python
|
29
|
-
Requires-Dist: mknotebooks
|
30
|
-
Requires-Dist: pytest
|
31
|
-
Requires-Dist: pytest-xdist
|
32
|
-
Requires-Dist: nbmake
|
25
|
+
Requires-Dist: mkdocs; extra == "dev"
|
26
|
+
Requires-Dist: mkdocs-material; extra == "dev"
|
27
|
+
Requires-Dist: mkdocstrings; extra == "dev"
|
28
|
+
Requires-Dist: mkdocstrings-python; extra == "dev"
|
29
|
+
Requires-Dist: mknotebooks; extra == "dev"
|
30
|
+
Requires-Dist: pytest; extra == "dev"
|
31
|
+
Requires-Dist: pytest-xdist; extra == "dev"
|
32
|
+
Requires-Dist: nbmake; extra == "dev"
|
33
33
|
|
34
34
|
<p align="center">
|
35
35
|
<img src="https://raw.githubusercontent.com/simon-bachhuber/ring/main/docs/img/icon.svg" height="200" />
|
@@ -4,9 +4,9 @@ ring/base.py,sha256=yPdbPywwDllCRsJEbnLW4s9Z-bBD8qdxpEDYV3pCLP8,35296
|
|
4
4
|
ring/maths.py,sha256=qPHH6TpHCK3TgExI98gNEySoSRKOwteN9McUlyUFipI,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
|
-
ring/algorithms/_random.py,sha256=
|
7
|
+
ring/algorithms/_random.py,sha256=UMyv-VPZLcErrKqs0XB83QJjs8GrmoNsv-zRSxGXvnI,14490
|
8
8
|
ring/algorithms/dynamics.py,sha256=dpe-F3Yq4sY2dY6DQW3v7TnPLRdxdkePtdbGPQIrijg,10997
|
9
|
-
ring/algorithms/jcalc.py,sha256=
|
9
|
+
ring/algorithms/jcalc.py,sha256=St4hjp8LZYQg6TFFTqh7psAp1W2DvZwNe6NhXe8vrf0,35490
|
10
10
|
ring/algorithms/kinematics.py,sha256=DOboHI517Vx0pRJUFZtZPmK_qFaiKiQe-37B-M0aC-c,7422
|
11
11
|
ring/algorithms/sensors.py,sha256=0xOzdQIc1kBF0CkoPXWWCx3MmV4SG3wj7knVnnMWq9M,18124
|
12
12
|
ring/algorithms/custom_joints/__init__.py,sha256=3pQ-Is_HBTQDkzESCNg9VfoP8wvseWmooryG8ERnu_A,366
|
@@ -86,7 +86,7 @@ ring/utils/randomize_sys.py,sha256=G_vBIo0OwQkXL2u0djwbaoaeb02C4LQCTNNloOYIU2M,3
|
|
86
86
|
ring/utils/utils.py,sha256=tJaWXLGOTwkxJQj2l23dX97wO3aZYhM2qd7eNuMRs84,6907
|
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.24.dist-info/METADATA,sha256=vaXarRf1r5xZeGK-av_regQ2LgaCTnb0Th43bDLXgN8,4089
|
90
|
+
imt_ring-1.6.24.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
91
|
+
imt_ring-1.6.24.dist-info/top_level.txt,sha256=EiT790-lAyi8iwTzJArH3f2k77rwhDn00q-4PlmvDQo,5
|
92
|
+
imt_ring-1.6.24.dist-info/RECORD,,
|
ring/algorithms/_random.py
CHANGED
@@ -35,6 +35,9 @@ def random_angle_over_time(
|
|
35
35
|
randomized_interpolation: bool = False,
|
36
36
|
range_of_motion: bool = False,
|
37
37
|
range_of_motion_method: str = "uniform",
|
38
|
+
# this value has nothing to do with `range_of_motion` flag
|
39
|
+
# this forces the value to stay within [ANG_0 - rom_halfsize, ANG_0 + rom_halfsize]
|
40
|
+
rom_halfsize: float | TimeDependentFloat = 2 * jnp.pi,
|
38
41
|
cdf_bins_min: int = 5,
|
39
42
|
cdf_bins_max: Optional[int] = None,
|
40
43
|
interpolation_method: str = "cosine",
|
@@ -44,9 +47,14 @@ def random_angle_over_time(
|
|
44
47
|
|
45
48
|
key_t, consume_t = random.split(key_t)
|
46
49
|
key_ang, consume_ang = random.split(key_ang)
|
50
|
+
rom_halfsize_float = _to_float(rom_halfsize, t)
|
51
|
+
rom_lower = ANG_0 - rom_halfsize_float
|
52
|
+
rom_upper = ANG_0 + rom_halfsize_float
|
47
53
|
dt, phi = _resolve_range_of_motion(
|
48
54
|
range_of_motion,
|
49
55
|
range_of_motion_method,
|
56
|
+
rom_lower,
|
57
|
+
rom_upper,
|
50
58
|
_to_float(dang_min, t),
|
51
59
|
_to_float(dang_max, t),
|
52
60
|
_to_float(delta_ang_min, t),
|
@@ -251,6 +259,8 @@ def _clip_to_pi(phi):
|
|
251
259
|
def _resolve_range_of_motion(
|
252
260
|
range_of_motion,
|
253
261
|
range_of_motion_method,
|
262
|
+
rom_lower: float,
|
263
|
+
rom_upper: float,
|
254
264
|
dang_min,
|
255
265
|
dang_max,
|
256
266
|
delta_ang_min,
|
@@ -262,47 +272,50 @@ def _resolve_range_of_motion(
|
|
262
272
|
key_ang,
|
263
273
|
max_iter,
|
264
274
|
):
|
275
|
+
# legacy reasons, without range of motion the `sign` value, so going
|
276
|
+
# left or right is 50-50 for free joints and spherical joints
|
277
|
+
if not range_of_motion:
|
278
|
+
range_of_motion_method = "coinflip"
|
279
|
+
|
265
280
|
def _next_phi(key, dt):
|
266
281
|
key, consume = random.split(key)
|
267
282
|
|
268
|
-
if
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
probs = jnp.array([p, (1 - p)])
|
288
|
-
else:
|
289
|
-
raise NotImplementedError
|
283
|
+
if range_of_motion_method == "coinflip":
|
284
|
+
probs = jnp.array([0.5, 0.5])
|
285
|
+
elif range_of_motion_method == "uniform":
|
286
|
+
p = 0.5 * (1 - prev_phi / jnp.pi)
|
287
|
+
probs = jnp.array([p, (1 - p)])
|
288
|
+
elif range_of_motion_method[:7] == "sigmoid":
|
289
|
+
scale = 1.5
|
290
|
+
provided_params = range_of_motion_method.split("-")
|
291
|
+
if len(provided_params) == 2:
|
292
|
+
scale = float(provided_params[-1])
|
293
|
+
hardcut = jnp.pi - 0.01
|
294
|
+
p = jnp.where(
|
295
|
+
prev_phi > hardcut,
|
296
|
+
0.0,
|
297
|
+
jnp.where(prev_phi < -hardcut, 1.0, jax.nn.sigmoid(-scale * prev_phi)),
|
298
|
+
)
|
299
|
+
probs = jnp.array([p, (1 - p)])
|
300
|
+
else:
|
301
|
+
raise NotImplementedError
|
290
302
|
|
291
|
-
|
292
|
-
|
293
|
-
|
303
|
+
sign = random.choice(consume, jnp.array([1.0, -1.0]), p=probs)
|
304
|
+
lower = prev_phi + sign * dang_min * dt
|
305
|
+
upper = prev_phi + sign * dang_max * dt
|
294
306
|
|
295
|
-
|
296
|
-
lower, upper =
|
307
|
+
if range_of_motion:
|
308
|
+
lower, upper = _clip_to_pi(lower), _clip_to_pi(upper)
|
297
309
|
|
298
|
-
|
299
|
-
|
310
|
+
# swap if lower > upper
|
311
|
+
lower, upper = jnp.sort(jnp.hstack((lower, upper)))
|
300
312
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
313
|
+
# clip bounds given by the angular velocity bounds to the rom bounds
|
314
|
+
lower = jnp.clip(lower, a_min=rom_lower)
|
315
|
+
upper = jnp.clip(upper, a_max=rom_upper)
|
316
|
+
|
317
|
+
key, consume = random.split(key)
|
318
|
+
return random.uniform(consume, minval=lower, maxval=upper)
|
306
319
|
|
307
320
|
def body_fn(val):
|
308
321
|
key_t, key_ang, _, _, i = val
|
ring/algorithms/jcalc.py
CHANGED
@@ -60,6 +60,11 @@ class MotionConfig:
|
|
60
60
|
range_of_motion_hinge: bool = True
|
61
61
|
range_of_motion_hinge_method: str = "uniform"
|
62
62
|
|
63
|
+
# this value has nothing to do with `range_of_motion` flag
|
64
|
+
# this forces the value to stay within [ANG_0 - rom_halfsize, ANG_0 + rom_halfsize]
|
65
|
+
# used only by the `_draw_rxyz` function
|
66
|
+
rom_halfsize: float | TimeDependentFloat = 2 * jnp.pi
|
67
|
+
|
63
68
|
# initial value of joints
|
64
69
|
ang0_min: float = -jnp.pi
|
65
70
|
ang0_max: float = jnp.pi
|
@@ -377,7 +382,10 @@ def _is_feasible_config1(c: MotionConfig) -> bool:
|
|
377
382
|
c.pos0_max_p3d_z,
|
378
383
|
)
|
379
384
|
|
380
|
-
|
385
|
+
# test that the delta_ang_min is smaller than 2*rom_halfsize
|
386
|
+
cond6 = _to_float(c.delta_ang_min, 0.0) < 2 * _to_float(c.rom_halfsize, 0.0)
|
387
|
+
|
388
|
+
return cond1 and cond2 and cond3 and cond4 and cond5 and cond6
|
381
389
|
|
382
390
|
|
383
391
|
def _find_interval(t: jax.Array, boundaries: jax.Array):
|
@@ -610,6 +618,7 @@ def _draw_rxyz(
|
|
610
618
|
config.randomized_interpolation_angle,
|
611
619
|
config.range_of_motion_hinge if enable_range_of_motion else False,
|
612
620
|
config.range_of_motion_hinge_method,
|
621
|
+
config.rom_halfsize,
|
613
622
|
config.cdf_bins_min,
|
614
623
|
config.cdf_bins_max,
|
615
624
|
config.interpolation_method,
|
File without changes
|