imt-ring 1.6.28__py3-none-any.whl → 1.6.29__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.28.dist-info → imt_ring-1.6.29.dist-info}/METADATA +1 -1
- {imt_ring-1.6.28.dist-info → imt_ring-1.6.29.dist-info}/RECORD +7 -7
- ring/base.py +4 -3
- ring/io/xml/to_xml.py +4 -3
- ring/maths.py +13 -0
- {imt_ring-1.6.28.dist-info → imt_ring-1.6.29.dist-info}/WHEEL +0 -0
- {imt_ring-1.6.28.dist-info → imt_ring-1.6.29.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
ring/__init__.py,sha256=H1Rd2uXVkux4Z792XyHIkQ8OpDSZBiPqFwyAFDWDU3E,5260
|
2
2
|
ring/algebra.py,sha256=F0GwbP8LQP5qGVkoMUYJmkp9Hn2nKAVIkCVYDEjNjGU,3128
|
3
|
-
ring/base.py,sha256=
|
4
|
-
ring/maths.py,sha256=
|
3
|
+
ring/base.py,sha256=_TgFrggsZfam0VPxvD4J5xp977vgiLnKTlDIJVzik5M,35362
|
4
|
+
ring/maths.py,sha256=R22SNQutkf9v7Hp9klo0wvJVIyBQz0O8_5oJaDQcFis,12652
|
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=UMyv-VPZLcErrKqs0XB83QJjs8GrmoNsv-zRSxGXvnI,14490
|
@@ -50,7 +50,7 @@ ring/io/xml/abstract.py,sha256=8Q2ebnUYLmuS9HJAQwDVrDTrRfD5z4G5RAB7MW8Oa60,9742
|
|
50
50
|
ring/io/xml/from_xml.py,sha256=E7JQl_scL5U4LK6mqLMr5qaiZCc6J1fInxD7uwgNCJY,9356
|
51
51
|
ring/io/xml/test_from_xml.py,sha256=bckVrVVmEhCwujd_OF9FGYnX3zU3BgztpqGxxmd0htM,1562
|
52
52
|
ring/io/xml/test_to_xml.py,sha256=NGn4VSiFdwhYN5YTBduWMiY9B5dwtxZhCQAR_PXeqKU,946
|
53
|
-
ring/io/xml/to_xml.py,sha256=
|
53
|
+
ring/io/xml/to_xml.py,sha256=Wo4iySLw9nM-iVW42AGvMRqjtU2qRc2FD_Zlc7w1IrE,3438
|
54
54
|
ring/ml/__init__.py,sha256=nbh48gaswWeY4S4vT1sply_3ROj2DQ7agjoLR4Ho3T8,1517
|
55
55
|
ring/ml/base.py,sha256=lfwEZLBDglOSRWChUHoH1kezefhttPV9TMEpNIqsMNw,9972
|
56
56
|
ring/ml/callbacks.py,sha256=W19QF6_uvaNCjs8ObsjNXD7mv9gFgJBixdRSbB_BynE,13301
|
@@ -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.29.dist-info/METADATA,sha256=2LQEbqA9aoAoMTJbVgd7MAWtdnHYWYv43M1-BhdW84o,4251
|
90
|
+
imt_ring-1.6.29.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
91
|
+
imt_ring-1.6.29.dist-info/top_level.txt,sha256=EiT790-lAyi8iwTzJArH3f2k77rwhDn00q-4PlmvDQo,5
|
92
|
+
imt_ring-1.6.29.dist-info/RECORD,,
|
ring/base.py
CHANGED
@@ -558,6 +558,7 @@ class System(_Base):
|
|
558
558
|
new_stif: Optional[jax.Array] = None,
|
559
559
|
new_zero: Optional[jax.Array] = None,
|
560
560
|
seed: int = 1,
|
561
|
+
warn: bool = True,
|
561
562
|
):
|
562
563
|
"By default damping, stiffness are set to zero."
|
563
564
|
from ring.algorithms import get_joint_model
|
@@ -587,7 +588,7 @@ class System(_Base):
|
|
587
588
|
|
588
589
|
jm = get_joint_model(new_joint_type)
|
589
590
|
if jm.init_joint_params is not None:
|
590
|
-
sys = sys.from_str(sys.to_str(), seed=seed)
|
591
|
+
sys = sys.from_str(sys.to_str(warn=warn), seed=seed)
|
591
592
|
|
592
593
|
return sys
|
593
594
|
|
@@ -786,8 +787,8 @@ class System(_Base):
|
|
786
787
|
def from_str(xml: str, seed: int = 1):
|
787
788
|
return ring.io.load_sys_from_str(xml, seed)
|
788
789
|
|
789
|
-
def to_str(self) -> str:
|
790
|
-
return ring.io.save_sys_to_str(self)
|
790
|
+
def to_str(self, warn: bool = True) -> str:
|
791
|
+
return ring.io.save_sys_to_str(self, warn=warn)
|
791
792
|
|
792
793
|
def to_xml(self, path: str) -> None:
|
793
794
|
ring.io.save_sys_to_xml(self, path)
|
ring/io/xml/to_xml.py
CHANGED
@@ -5,18 +5,19 @@ from xml.etree.ElementTree import SubElement
|
|
5
5
|
from xml.etree.ElementTree import tostring
|
6
6
|
|
7
7
|
import jax.numpy as jnp
|
8
|
-
from ring import base
|
9
8
|
from tree_utils import batch_concat
|
10
9
|
|
10
|
+
from ring import base
|
11
|
+
|
11
12
|
from . import abstract
|
12
13
|
from .abstract import _to_str
|
13
14
|
|
14
15
|
|
15
|
-
def save_sys_to_str(sys: base.System) -> str:
|
16
|
+
def save_sys_to_str(sys: base.System, warn: bool = True) -> str:
|
16
17
|
for joint_type in sys.links.joint_params:
|
17
18
|
for i, link_name in enumerate(sys.link_names):
|
18
19
|
joint_params_flat = batch_concat((sys.links[i]).joint_params[joint_type], 0)
|
19
|
-
if not jnp.all(joint_params_flat == 0.0):
|
20
|
+
if warn and (not jnp.all(joint_params_flat == 0.0)):
|
20
21
|
warnings.warn(
|
21
22
|
"The system has `sys.links.joint_params` unequal to the 'default'"
|
22
23
|
f" value (of zeros). In particular the link `{link_name}` has for"
|
ring/maths.py
CHANGED
@@ -90,6 +90,19 @@ def angle_error(q, qhat):
|
|
90
90
|
return jnp.abs(quat_angle(quat_mul(quat_inv(q), qhat)))
|
91
91
|
|
92
92
|
|
93
|
+
def inclination_loss(q, qhat):
|
94
|
+
"""Absolute inclination angle in radians. `q`'s are from body-to-eps.
|
95
|
+
This function fullfills
|
96
|
+
inclination_loss(q1, q2)
|
97
|
+
== inclination_loss(qmt.addHeading(q1, H), q2)
|
98
|
+
== inclination_loss(q1, qmt.addHeading(q2, H))`
|
99
|
+
for any q1, q2, H
|
100
|
+
"""
|
101
|
+
q_rel = quat_mul(q, quat_inv(qhat))
|
102
|
+
q_rel_incl = quat_project(q_rel, [0, 0, 1.0])[1]
|
103
|
+
return jnp.abs(quat_angle(q_rel_incl))
|
104
|
+
|
105
|
+
|
93
106
|
def unit_quats_like(array):
|
94
107
|
"Array of *unit* quaternions of identical shape."
|
95
108
|
if array.shape[-1] != 4:
|
File without changes
|
File without changes
|