imt-ring 1.5.0__tar.gz → 1.5.1__tar.gz

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.
Files changed (114) hide show
  1. {imt_ring-1.5.0 → imt_ring-1.5.1}/PKG-INFO +1 -1
  2. {imt_ring-1.5.0 → imt_ring-1.5.1}/pyproject.toml +1 -1
  3. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/imt_ring.egg-info/PKG-INFO +1 -1
  4. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/generator/base.py +13 -10
  5. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/generator/motion_artifacts.py +14 -0
  6. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_custom_joints.py +9 -9
  7. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_pd_control.py +1 -1
  8. {imt_ring-1.5.0 → imt_ring-1.5.1}/readme.md +0 -0
  9. {imt_ring-1.5.0 → imt_ring-1.5.1}/setup.cfg +0 -0
  10. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/imt_ring.egg-info/SOURCES.txt +0 -0
  11. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/imt_ring.egg-info/dependency_links.txt +0 -0
  12. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/imt_ring.egg-info/requires.txt +0 -0
  13. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/imt_ring.egg-info/top_level.txt +0 -0
  14. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/__init__.py +0 -0
  15. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algebra.py +0 -0
  16. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/__init__.py +0 -0
  17. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/_random.py +0 -0
  18. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/custom_joints/__init__.py +0 -0
  19. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/custom_joints/rr_imp_joint.py +0 -0
  20. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/custom_joints/rr_joint.py +0 -0
  21. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/custom_joints/suntay.py +0 -0
  22. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/dynamics.py +0 -0
  23. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/generator/__init__.py +0 -0
  24. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/generator/batch.py +0 -0
  25. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/generator/finalize_fns.py +0 -0
  26. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/generator/pd_control.py +0 -0
  27. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/generator/setup_fns.py +0 -0
  28. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/generator/types.py +0 -0
  29. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/jcalc.py +0 -0
  30. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/kinematics.py +0 -0
  31. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/algorithms/sensors.py +0 -0
  32. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/base.py +0 -0
  33. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/__init__.py +0 -0
  34. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/branched.xml +0 -0
  35. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/exclude/knee_trans_dof.xml +0 -0
  36. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/exclude/standard_sys.xml +0 -0
  37. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/exclude/standard_sys_rr_imp.xml +0 -0
  38. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/inv_pendulum.xml +0 -0
  39. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/knee_flexible_imus.xml +0 -0
  40. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/spherical_stiff.xml +0 -0
  41. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/symmetric.xml +0 -0
  42. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_all_1.xml +0 -0
  43. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_all_2.xml +0 -0
  44. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_ang0_pos0.xml +0 -0
  45. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_control.xml +0 -0
  46. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_double_pendulum.xml +0 -0
  47. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_free.xml +0 -0
  48. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_kinematics.xml +0 -0
  49. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_morph_system/four_seg_seg1.xml +0 -0
  50. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_morph_system/four_seg_seg3.xml +0 -0
  51. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_randomize_position.xml +0 -0
  52. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_sensors.xml +0 -0
  53. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples/test_three_seg_seg2.xml +0 -0
  54. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/examples.py +0 -0
  55. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/test_examples.py +0 -0
  56. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/xml/__init__.py +0 -0
  57. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/xml/abstract.py +0 -0
  58. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/xml/from_xml.py +0 -0
  59. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/xml/test_from_xml.py +0 -0
  60. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/xml/test_to_xml.py +0 -0
  61. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/io/xml/to_xml.py +0 -0
  62. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/maths.py +0 -0
  63. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/__init__.py +0 -0
  64. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/base.py +0 -0
  65. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/callbacks.py +0 -0
  66. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/ml_utils.py +0 -0
  67. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/optimizer.py +0 -0
  68. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/params/0x13e3518065c21cd8.pickle +0 -0
  69. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/params/0x1d76628065a71e0f.pickle +0 -0
  70. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/ringnet.py +0 -0
  71. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/rnno_v1.py +0 -0
  72. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/train.py +0 -0
  73. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/ml/training_loop.py +0 -0
  74. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/rendering/__init__.py +0 -0
  75. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/rendering/base_render.py +0 -0
  76. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/rendering/mujoco_render.py +0 -0
  77. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/rendering/vispy_render.py +0 -0
  78. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/rendering/vispy_visuals.py +0 -0
  79. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/sim2real/__init__.py +0 -0
  80. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/sim2real/sim2real.py +0 -0
  81. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/spatial.py +0 -0
  82. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/sys_composer/__init__.py +0 -0
  83. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/sys_composer/delete_sys.py +0 -0
  84. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/sys_composer/inject_sys.py +0 -0
  85. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/sys_composer/morph_sys.py +0 -0
  86. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/__init__.py +0 -0
  87. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/backend.py +0 -0
  88. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/batchsize.py +0 -0
  89. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/colab.py +0 -0
  90. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/hdf5.py +0 -0
  91. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/normalizer.py +0 -0
  92. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/path.py +0 -0
  93. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/randomize_sys.py +0 -0
  94. {imt_ring-1.5.0 → imt_ring-1.5.1}/src/ring/utils/utils.py +0 -0
  95. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_algebra.py +0 -0
  96. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_base.py +0 -0
  97. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_dynamics.py +0 -0
  98. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_generator.py +0 -0
  99. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_jcalc.py +0 -0
  100. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_jit.py +0 -0
  101. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_kinematics.py +0 -0
  102. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_maths.py +0 -0
  103. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_ml_utils.py +0 -0
  104. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_motion_artifacts.py +0 -0
  105. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_quickstart_example.py +0 -0
  106. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_random.py +0 -0
  107. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_randomize.py +0 -0
  108. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_rcmg.py +0 -0
  109. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_render.py +0 -0
  110. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_sensors.py +0 -0
  111. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_sim2real.py +0 -0
  112. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_sys_composer.py +0 -0
  113. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_train.py +0 -0
  114. {imt_ring-1.5.0 → imt_ring-1.5.1}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imt-ring
3
- Version: 1.5.0
3
+ Version: 1.5.1
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "imt-ring"
7
- version = "1.5.0"
7
+ version = "1.5.1"
8
8
  authors = [
9
9
  { name="Simon Bachhuber", email="simon.bachhuber@fau.de" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imt-ring
3
- Version: 1.5.0
3
+ Version: 1.5.1
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
@@ -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(hide_injected_bodies=True),
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["hide_injected_bodies"]:
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, sys, _config)
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,
@@ -41,13 +41,13 @@ def test_virtual_input_joint_axes_rr_joint():
41
41
  X = pipeline_load_data_X(sys)
42
42
 
43
43
  np.testing.assert_allclose(
44
- X["seg1"]["joint_axes"],
44
+ -X["seg1"]["joint_axes"],
45
45
  np.repeat(np.array([[0.0, 1, 0]]), 1000, axis=0),
46
46
  atol=4e-7,
47
47
  )
48
48
  np.testing.assert_allclose(
49
- X["seg3"]["joint_axes"],
50
- np.repeat(-np.array([[0.0, 0, 1]]), 1000, axis=0),
49
+ -X["seg3"]["joint_axes"],
50
+ np.repeat(np.array([[0.0, 0, 1]]), 1000, axis=0),
51
51
  atol=5e-7,
52
52
  )
53
53
 
@@ -56,13 +56,13 @@ def test_virtual_input_joint_axes_rr_joint():
56
56
 
57
57
  np.testing.assert_allclose(
58
58
  X["seg1"]["joint_axes"],
59
- np.repeat(joint_axes[1:2], 1000, axis=0),
59
+ np.repeat(-joint_axes[1:2], 1000, axis=0),
60
60
  atol=4e-7,
61
61
  rtol=2e-4,
62
62
  )
63
63
  np.testing.assert_allclose(
64
- X["seg3"]["joint_axes"],
65
- np.repeat(-joint_axes[3:4], 1000, axis=0),
64
+ -X["seg3"]["joint_axes"],
65
+ np.repeat(joint_axes[3:4], 1000, axis=0),
66
66
  atol=3e-7,
67
67
  rtol=2e-6,
68
68
  )
@@ -83,13 +83,13 @@ def test_virtual_input_joint_axes_rr_imp_joint():
83
83
  X = pipeline_load_data_X(sys_rr_imp)
84
84
 
85
85
  np.testing.assert_allclose(
86
- X["seg1"]["joint_axes"],
86
+ -X["seg1"]["joint_axes"],
87
87
  np.repeat(joint_axes[1:2], 1000, axis=0),
88
88
  atol=0.01,
89
89
  rtol=0.02,
90
90
  )
91
91
  np.testing.assert_allclose(
92
- X["seg3"]["joint_axes"],
92
+ -X["seg3"]["joint_axes"],
93
93
  np.repeat(joint_axes[3:4], 1000, axis=0),
94
94
  atol=0.01,
95
95
  rtol=0.032,
@@ -101,7 +101,7 @@ def test_virtual_input_joint_axes_rr_imp_joint():
101
101
  X = pipeline_load_data_X(sys)
102
102
 
103
103
  np.testing.assert_allclose(
104
- X["seg1"]["joint_axes"],
104
+ -X["seg1"]["joint_axes"],
105
105
  np.repeat(np.array([[0.0, 1, 0]]), 1000, axis=0),
106
106
  atol=4e-7,
107
107
  )
@@ -58,7 +58,7 @@ def test_pd_control():
58
58
  controller = _pd_control(gains, gains)
59
59
  q, q_reconst = evaluate(controller, "test_free")
60
60
  error = jnp.sqrt(jnp.mean((q - q_reconst) ** 2))
61
- assert error <= 0.5
61
+ assert error <= 0.502
62
62
 
63
63
  gains = jnp.array([50.0, 50.0])
64
64
  controller = _pd_control(gains, gains * 0.1)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes