jaxsim 0.6.2.dev240__py3-none-any.whl → 0.6.2.dev253__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.
- jaxsim/_version.py +2 -2
- jaxsim/api/actuation_model.py +30 -1
- jaxsim/api/model.py +14 -0
- jaxsim/rbda/__init__.py +1 -1
- jaxsim/rbda/actuation/__init__.py +1 -0
- jaxsim/rbda/actuation/common.py +17 -0
- {jaxsim-0.6.2.dev240.dist-info → jaxsim-0.6.2.dev253.dist-info}/METADATA +2 -2
- {jaxsim-0.6.2.dev240.dist-info → jaxsim-0.6.2.dev253.dist-info}/RECORD +11 -9
- {jaxsim-0.6.2.dev240.dist-info → jaxsim-0.6.2.dev253.dist-info}/WHEEL +0 -0
- {jaxsim-0.6.2.dev240.dist-info → jaxsim-0.6.2.dev253.dist-info}/licenses/LICENSE +0 -0
- {jaxsim-0.6.2.dev240.dist-info → jaxsim-0.6.2.dev253.dist-info}/top_level.txt +0 -0
jaxsim/_version.py
CHANGED
@@ -17,5 +17,5 @@ __version__: str
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
18
18
|
version_tuple: VERSION_TUPLE
|
19
19
|
|
20
|
-
__version__ = version = '0.6.2.
|
21
|
-
__version_tuple__ = version_tuple = (0, 6, 2, '
|
20
|
+
__version__ = version = '0.6.2.dev253'
|
21
|
+
__version_tuple__ = version_tuple = (0, 6, 2, 'dev253')
|
jaxsim/api/actuation_model.py
CHANGED
@@ -92,5 +92,34 @@ def compute_resultant_torques(
|
|
92
92
|
# ===============================
|
93
93
|
|
94
94
|
τ_total = τ_references + τ_friction + τ_position_limit
|
95
|
-
|
95
|
+
τ_lim = tn_curve_fn(model=model, data=data)
|
96
|
+
τ_total = jnp.clip(τ_total, -τ_lim, τ_lim)
|
96
97
|
return τ_total
|
98
|
+
|
99
|
+
|
100
|
+
def tn_curve_fn(
|
101
|
+
model: js.model.JaxSimModel, data: js.data.JaxSimModelData
|
102
|
+
) -> jtp.Vector:
|
103
|
+
"""
|
104
|
+
Compute the torque limits using the tn curve.
|
105
|
+
|
106
|
+
Args:
|
107
|
+
model: The model to consider.
|
108
|
+
data: The data of the considered model.
|
109
|
+
|
110
|
+
Returns:
|
111
|
+
The torque limits.
|
112
|
+
"""
|
113
|
+
|
114
|
+
τ_max = model.actuation_params.torque_max # Max torque (Nm)
|
115
|
+
ω_th = model.actuation_params.omega_th # Threshold speed (rad/s)
|
116
|
+
ω_max = model.actuation_params.omega_max # Max speed for torque drop-off (rad/s)
|
117
|
+
abs_vel = jnp.abs(data.joint_velocities)
|
118
|
+
τ_lim = jnp.where(
|
119
|
+
abs_vel <= ω_th,
|
120
|
+
τ_max,
|
121
|
+
jnp.where(
|
122
|
+
abs_vel <= ω_max, τ_max * (1 - (abs_vel - ω_th) / (ω_max - ω_th)), 0.0
|
123
|
+
),
|
124
|
+
)
|
125
|
+
return τ_lim
|
jaxsim/api/model.py
CHANGED
@@ -57,6 +57,10 @@ class JaxSimModel(JaxsimDataclass):
|
|
57
57
|
default=None, repr=False
|
58
58
|
)
|
59
59
|
|
60
|
+
actuation_params: Static[jaxsim.rbda.actuation.ActuationParams] = dataclasses.field(
|
61
|
+
default=None, repr=False
|
62
|
+
)
|
63
|
+
|
60
64
|
kin_dyn_parameters: js.kin_dyn_parameters.KinDynParameters | None = (
|
61
65
|
dataclasses.field(default=None, repr=False)
|
62
66
|
)
|
@@ -121,6 +125,7 @@ class JaxSimModel(JaxsimDataclass):
|
|
121
125
|
terrain: jaxsim.terrain.Terrain | None = None,
|
122
126
|
contact_model: jaxsim.rbda.contacts.ContactModel | None = None,
|
123
127
|
contact_params: jaxsim.rbda.contacts.ContactsParams | None = None,
|
128
|
+
actuation_params: jaxsim.rbda.actuation.ActuationParams | None = None,
|
124
129
|
integrator: IntegratorType | None = None,
|
125
130
|
is_urdf: bool | None = None,
|
126
131
|
considered_joints: Sequence[str] | None = None,
|
@@ -143,6 +148,7 @@ class JaxSimModel(JaxsimDataclass):
|
|
143
148
|
The contact model to consider.
|
144
149
|
If not specified, a soft contacts model is used.
|
145
150
|
contact_params: The parameters of the contact model.
|
151
|
+
actuation_params: The parameters of the actuation model.
|
146
152
|
integrator: The integrator to use for the simulation.
|
147
153
|
is_urdf:
|
148
154
|
The optional flag to force the model description to be parsed as a URDF.
|
@@ -177,6 +183,7 @@ class JaxSimModel(JaxsimDataclass):
|
|
177
183
|
time_step=time_step,
|
178
184
|
terrain=terrain,
|
179
185
|
contact_model=contact_model,
|
186
|
+
actuation_params=actuation_params,
|
180
187
|
contact_params=contact_params,
|
181
188
|
integrator=integrator,
|
182
189
|
gravity=-gravity,
|
@@ -198,6 +205,7 @@ class JaxSimModel(JaxsimDataclass):
|
|
198
205
|
terrain: jaxsim.terrain.Terrain | None = None,
|
199
206
|
contact_model: jaxsim.rbda.contacts.ContactModel | None = None,
|
200
207
|
contact_params: jaxsim.rbda.contacts.ContactsParams | None = None,
|
208
|
+
actuation_params: jaxsim.rbda.actuation.ActuationParams | None = None,
|
201
209
|
integrator: IntegratorType | None = None,
|
202
210
|
gravity: jtp.FloatLike = jaxsim.math.STANDARD_GRAVITY,
|
203
211
|
) -> JaxSimModel:
|
@@ -219,6 +227,7 @@ class JaxSimModel(JaxsimDataclass):
|
|
219
227
|
The contact model to consider.
|
220
228
|
If not specified, a relaxed-constraints rigid contacts model is used.
|
221
229
|
contact_params: The parameters of the contact model.
|
230
|
+
actuation_params: The parameters of the actuation model.
|
222
231
|
integrator: The integrator to use for the simulation.
|
223
232
|
gravity: The gravity constant.
|
224
233
|
|
@@ -255,6 +264,9 @@ class JaxSimModel(JaxsimDataclass):
|
|
255
264
|
if contact_params is None:
|
256
265
|
contact_params = contact_model._parameters_class()
|
257
266
|
|
267
|
+
if actuation_params is None:
|
268
|
+
actuation_params = jaxsim.rbda.actuation.ActuationParams()
|
269
|
+
|
258
270
|
# Consider the default integrator if not specified.
|
259
271
|
integrator = (
|
260
272
|
integrator
|
@@ -272,6 +284,7 @@ class JaxSimModel(JaxsimDataclass):
|
|
272
284
|
terrain=terrain,
|
273
285
|
contact_model=contact_model,
|
274
286
|
contact_params=contact_params,
|
287
|
+
actuation_params=actuation_params,
|
275
288
|
integrator=integrator,
|
276
289
|
gravity=gravity,
|
277
290
|
# The following is wrapped as hashless since it's a static argument, and we
|
@@ -474,6 +487,7 @@ def reduce(
|
|
474
487
|
terrain=model.terrain,
|
475
488
|
contact_model=model.contact_model,
|
476
489
|
contact_params=model.contact_params,
|
490
|
+
actuation_params=model.actuation_params,
|
477
491
|
gravity=model.gravity,
|
478
492
|
integrator=model.integrator,
|
479
493
|
)
|
jaxsim/rbda/__init__.py
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
from .common import ActuationParams
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import dataclasses
|
2
|
+
|
3
|
+
import jax_dataclasses
|
4
|
+
|
5
|
+
import jaxsim.typing as jtp
|
6
|
+
from jaxsim.utils import JaxsimDataclass
|
7
|
+
|
8
|
+
|
9
|
+
@jax_dataclasses.pytree_dataclass
|
10
|
+
class ActuationParams(JaxsimDataclass):
|
11
|
+
"""
|
12
|
+
Parameters class for the actuation model.
|
13
|
+
"""
|
14
|
+
|
15
|
+
torque_max: jtp.Float = dataclasses.field(default=3000.0) # (Nm)
|
16
|
+
omega_th: jtp.Float = dataclasses.field(default=30.0) # (rad/s)
|
17
|
+
omega_max: jtp.Float = dataclasses.field(default=100.0) # (rad/s)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: jaxsim
|
3
|
-
Version: 0.6.2.
|
3
|
+
Version: 0.6.2.dev253
|
4
4
|
Summary: A differentiable physics engine and multibody dynamics library for control and robot learning.
|
5
5
|
Author-email: Diego Ferigo <dgferigo@gmail.com>, Filippo Luca Ferretti <filippoluca.ferretti@outlook.com>
|
6
6
|
Maintainer-email: Filippo Luca Ferretti <filippo.ferretti@iit.it>, Alessandro Croci <alessandro.croci@iit.it>
|
@@ -80,7 +80,7 @@ Requires-Dist: idyntree>=12.2.1; extra == "testing"
|
|
80
80
|
Requires-Dist: pytest>=6.0; extra == "testing"
|
81
81
|
Requires-Dist: pytest-benchmark; extra == "testing"
|
82
82
|
Requires-Dist: pytest-icdiff; extra == "testing"
|
83
|
-
Requires-Dist: robot-descriptions; extra == "testing"
|
83
|
+
Requires-Dist: robot-descriptions>=1.16.0; extra == "testing"
|
84
84
|
Requires-Dist: icub-models; extra == "testing"
|
85
85
|
Provides-Extra: viz
|
86
86
|
Requires-Dist: lxml; extra == "viz"
|
@@ -1,10 +1,10 @@
|
|
1
1
|
jaxsim/__init__.py,sha256=b8dYoVXqtHxHcF56iM2xgKk78lsvmGrfDlvdwaGasgs,3388
|
2
|
-
jaxsim/_version.py,sha256=
|
2
|
+
jaxsim/_version.py,sha256=tso8wO5VrX4RPYa0ZLA_aUJ6ylncC96kilEqh4mUO5U,528
|
3
3
|
jaxsim/exceptions.py,sha256=MQ3LRMfVMX2-g3qYj7mUVNV9OLlIA48TANJegbcQyXI,2641
|
4
4
|
jaxsim/logging.py,sha256=STI-D_upXZYX-ZezLrlJJ0UlD5YspST0vZ_DcIwkzO4,1553
|
5
5
|
jaxsim/typing.py,sha256=7msl8t5Jt09RNYfKdPJtpjLfWurldcycDappb045Eso,761
|
6
6
|
jaxsim/api/__init__.py,sha256=4skzcTTejLFfZ_JE6yEEyNxObpXnR5u-bYsn2lBEx-4,234
|
7
|
-
jaxsim/api/actuation_model.py,sha256=
|
7
|
+
jaxsim/api/actuation_model.py,sha256=GgLi-yhEpsczwhMNYIlMvet8tirmmED6S7AumbSbk4U,3705
|
8
8
|
jaxsim/api/com.py,sha256=47a9SSaXY540RCkVnHodwLNUrodIfJIkguIYdSEQVwQ,13697
|
9
9
|
jaxsim/api/common.py,sha256=yTaRXDYkXmISBOhZ93f9TssR0p4wq7qj7B6OsvYzRME,6942
|
10
10
|
jaxsim/api/contact.py,sha256=dlKKDQUG-KQ5qQaYBv2NmZLDb1OnJdltZv8MWXkD_W0,20969
|
@@ -14,7 +14,7 @@ jaxsim/api/integrators.py,sha256=DgOnzLepy45e-TM6Infk8qfPXn0r8GubCdJQZmNLP8w,526
|
|
14
14
|
jaxsim/api/joint.py,sha256=AnqlNWmBOay-gsoo0y4AbfFQ2OCJm-8T1E0IMhZeLoY,7457
|
15
15
|
jaxsim/api/kin_dyn_parameters.py,sha256=v1ZDb-Eqn552Zb344sJYy9e5sQT--_SYGIdtNC2JVSg,29828
|
16
16
|
jaxsim/api/link.py,sha256=bSZOYJDY9HJMgY25VzevTTsdFZTJc6yRRpslc5FhGHE,12782
|
17
|
-
jaxsim/api/model.py,sha256=
|
17
|
+
jaxsim/api/model.py,sha256=rZK8YigkM1pHxx0Aj9AJDpFma7I_pNgcs8lzPF8ukUk,69914
|
18
18
|
jaxsim/api/ode.py,sha256=fp20_LK9lXw2DfNkQgrfJmtd_iBXDNzZkOn0u5Pm8Qw,6190
|
19
19
|
jaxsim/api/references.py,sha256=-vd50y3v-jkXAsILS432etIKV6e2EUE2oOeLHuUrfuQ,20399
|
20
20
|
jaxsim/math/__init__.py,sha256=dNozvtm8WsB7nxw4uK29yQQKPcDUEczr2zcHoZfMItc,383
|
@@ -44,7 +44,7 @@ jaxsim/parsers/rod/__init__.py,sha256=G2vqlLajBLUc4gyzXwsEI2Wsi4TMOIF9bLDFeT6KrG
|
|
44
44
|
jaxsim/parsers/rod/meshes.py,sha256=yAXefG73_zqbVKRUdlcz9yFmypjDIpiP9cO96PeAozE,2842
|
45
45
|
jaxsim/parsers/rod/parser.py,sha256=vaOlvlvgQCEGbymFc21praHKEVq_LqqlKeRJNv7tZiE,14398
|
46
46
|
jaxsim/parsers/rod/utils.py,sha256=wmD-wCF1lLO8pknX7A3a8CGt9wDlTS_xCqQulcZ_XlM,8242
|
47
|
-
jaxsim/rbda/__init__.py,sha256=
|
47
|
+
jaxsim/rbda/__init__.py,sha256=ksfupKZzeJyysxrbyMyEfszUdBH6LfCfkSz3KLfODhY,328
|
48
48
|
jaxsim/rbda/aba.py,sha256=QiajR4Uv06u-BX5V2kWpmFmP_kIfTxxcycdJhIbid9A,9029
|
49
49
|
jaxsim/rbda/collidable_points.py,sha256=XyeV1I43GL22j03rkNVocaIPOGYirt3PiDHrFMndziQ,2070
|
50
50
|
jaxsim/rbda/crba.py,sha256=DC9kBXMG1qXaoAdo8K7OCnVHT_YUaL_t6Li56sRf8ro,5093
|
@@ -52,6 +52,8 @@ jaxsim/rbda/forward_kinematics.py,sha256=qem7Yp-B2oNVOsU3Q2CWV2tbfZKJOCAdDozFgaP
|
|
52
52
|
jaxsim/rbda/jacobian.py,sha256=EaMvf073UnLWJGXm4UZIlYd4erulFAGgj_pp89k6xic,11113
|
53
53
|
jaxsim/rbda/rnea.py,sha256=lMU7xxdPqGGzk0QwteB-IYjL4auHOpd78C1YqAXlp9s,7588
|
54
54
|
jaxsim/rbda/utils.py,sha256=6JwEDQqLMsBX7CUmPYEhdPEscXmGbWVYg6xEriPOgvE,5587
|
55
|
+
jaxsim/rbda/actuation/__init__.py,sha256=zWqB8VBHadbyf8FAuhQtcfWdetGjfVxuNDwIeUqNOS4,36
|
56
|
+
jaxsim/rbda/actuation/common.py,sha256=aGFqO4VTgQLsTJyOtVuoa_otT_RbkckmG3rq7wjOyB4,462
|
55
57
|
jaxsim/rbda/contacts/__init__.py,sha256=resrBkTdOA-1YMdcdUH2RATEhAf_Ye6MQNtjG3ClMYQ,371
|
56
58
|
jaxsim/rbda/contacts/common.py,sha256=qVm3Ghoytg1HAeykNrYw5-4rQJ4Mv7h0Pk75ETzGXyc,9045
|
57
59
|
jaxsim/rbda/contacts/relaxed_rigid.py,sha256=RjeLF06Pp19qio447U9z5EdhdM6nyMh-ISQX_2-vdaE,21349
|
@@ -63,8 +65,8 @@ jaxsim/utils/__init__.py,sha256=Y5zyoRevl3EMVQadhZ4EtSwTEkDt2vcnFoRhPJjKTZ0,215
|
|
63
65
|
jaxsim/utils/jaxsim_dataclass.py,sha256=XzmZeIibcaOzaxpprsGSxH3UrM66PAO456rFV91sNXg,11453
|
64
66
|
jaxsim/utils/tracing.py,sha256=Btwxdfhb7fJLk3r5PlQkGYj60Y2KbFT1gANGIA697FU,530
|
65
67
|
jaxsim/utils/wrappers.py,sha256=3IMwydqFgmSPqeuUQ3PRmdhDc1IoT6XC23jPC_LjWXs,4175
|
66
|
-
jaxsim-0.6.2.
|
67
|
-
jaxsim-0.6.2.
|
68
|
-
jaxsim-0.6.2.
|
69
|
-
jaxsim-0.6.2.
|
70
|
-
jaxsim-0.6.2.
|
68
|
+
jaxsim-0.6.2.dev253.dist-info/licenses/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
|
69
|
+
jaxsim-0.6.2.dev253.dist-info/METADATA,sha256=F_UAPp-S0HPegiLJOZ2yiiu8y1qQRmIIqzwYiiuiieM,19658
|
70
|
+
jaxsim-0.6.2.dev253.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
71
|
+
jaxsim-0.6.2.dev253.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
|
72
|
+
jaxsim-0.6.2.dev253.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|