jaxsim 0.2.1.dev40__py3-none-any.whl → 0.2.1.dev51__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/joint.py +3 -12
- jaxsim/api/kin_dyn_parameters.py +9 -10
- jaxsim/math/joint_model.py +38 -44
- jaxsim/parsers/descriptions/__init__.py +1 -1
- jaxsim/parsers/descriptions/joint.py +10 -35
- jaxsim/parsers/kinematic_graph.py +8 -5
- jaxsim/parsers/rod/parser.py +71 -5
- jaxsim/parsers/rod/utils.py +4 -8
- {jaxsim-0.2.1.dev40.dist-info → jaxsim-0.2.1.dev51.dist-info}/METADATA +2 -2
- {jaxsim-0.2.1.dev40.dist-info → jaxsim-0.2.1.dev51.dist-info}/RECORD +14 -14
- {jaxsim-0.2.1.dev40.dist-info → jaxsim-0.2.1.dev51.dist-info}/LICENSE +0 -0
- {jaxsim-0.2.1.dev40.dist-info → jaxsim-0.2.1.dev51.dist-info}/WHEEL +0 -0
- {jaxsim-0.2.1.dev40.dist-info → jaxsim-0.2.1.dev51.dist-info}/top_level.txt +0 -0
jaxsim/_version.py
CHANGED
@@ -12,5 +12,5 @@ __version__: str
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
13
13
|
version_tuple: VERSION_TUPLE
|
14
14
|
|
15
|
-
__version__ = version = '0.2.1.
|
16
|
-
__version_tuple__ = version_tuple = (0, 2, 1, '
|
15
|
+
__version__ = version = '0.2.1.dev51'
|
16
|
+
__version_tuple__ = version_tuple = (0, 2, 1, 'dev51')
|
jaxsim/api/joint.py
CHANGED
@@ -3,7 +3,6 @@ from typing import Sequence
|
|
3
3
|
|
4
4
|
import jax
|
5
5
|
import jax.numpy as jnp
|
6
|
-
import numpy as np
|
7
6
|
|
8
7
|
import jaxsim.api as js
|
9
8
|
import jaxsim.typing as jtp
|
@@ -30,17 +29,9 @@ def name_to_idx(model: js.model.JaxSimModel, *, joint_name: str) -> jtp.Int:
|
|
30
29
|
# Note: the index of the joint for RBDAs starts from 1, but
|
31
30
|
# the index for accessing the right element starts from 0.
|
32
31
|
# Therefore, there is a -1.
|
33
|
-
return (
|
34
|
-
|
35
|
-
|
36
|
-
np.array(model.kin_dyn_parameters.joint_model.joint_names)
|
37
|
-
== joint_name
|
38
|
-
)
|
39
|
-
- 1
|
40
|
-
)
|
41
|
-
.squeeze()
|
42
|
-
.astype(int)
|
43
|
-
)
|
32
|
+
return jnp.array(
|
33
|
+
model.kin_dyn_parameters.joint_model.joint_names.index(joint_name) - 1
|
34
|
+
).squeeze()
|
44
35
|
return jnp.array(-1).astype(int)
|
45
36
|
|
46
37
|
|
jaxsim/api/kin_dyn_parameters.py
CHANGED
@@ -382,21 +382,20 @@ class KynDynParameters(JaxsimDataclass):
|
|
382
382
|
)
|
383
383
|
|
384
384
|
# Compute the transforms and motion subspaces of the joints.
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
supported_joint_motion(
|
389
|
-
|
390
|
-
|
385
|
+
if self.number_of_joints() == 0:
|
386
|
+
pre_H_suc_J, S_J = jnp.empty((0, 4, 4)), jnp.empty((0, 6, 1))
|
387
|
+
else:
|
388
|
+
pre_H_suc_J, S_J = jax.vmap(supported_joint_motion)(
|
389
|
+
jnp.array(self.joint_model.joint_types[1:]).astype(int),
|
390
|
+
jnp.array(joint_positions),
|
391
|
+
jnp.array(self.joint_model.joint_axis),
|
391
392
|
)
|
392
|
-
for i, s in enumerate(jnp.array(joint_positions).astype(float))
|
393
|
-
]
|
394
393
|
|
395
394
|
# Extract the transforms and motion subspaces of the joints.
|
396
395
|
# We stack the base transform W_H_B at index 0, and a dummy motion subspace
|
397
396
|
# for either the fixed or free-floating joint connecting the world to the base.
|
398
|
-
pre_H_suc = jnp.
|
399
|
-
S = jnp.
|
397
|
+
pre_H_suc = jnp.vstack([W_H_B[jnp.newaxis, ...], pre_H_suc_J])
|
398
|
+
S = jnp.vstack([jnp.zeros((6, 1))[jnp.newaxis, ...], S_J])
|
400
399
|
|
401
400
|
# Extract the successor-to-child fixed transforms.
|
402
401
|
# Note that here we include also the index 0 since suc_H_child[0] stores the
|
jaxsim/math/joint_model.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
|
-
import functools
|
4
|
-
|
5
3
|
import jax
|
6
4
|
import jax.numpy as jnp
|
7
5
|
import jax_dataclasses
|
@@ -9,12 +7,7 @@ import jaxlie
|
|
9
7
|
from jax_dataclasses import Static
|
10
8
|
|
11
9
|
import jaxsim.typing as jtp
|
12
|
-
from jaxsim.parsers.descriptions import
|
13
|
-
JointDescriptor,
|
14
|
-
JointGenericAxis,
|
15
|
-
JointType,
|
16
|
-
ModelDescription,
|
17
|
-
)
|
10
|
+
from jaxsim.parsers.descriptions import JointGenericAxis, JointType, ModelDescription
|
18
11
|
from jaxsim.parsers.kinematic_graph import KinematicGraphTransforms
|
19
12
|
|
20
13
|
from .rotation import Rotation
|
@@ -46,7 +39,8 @@ class JointModel:
|
|
46
39
|
|
47
40
|
joint_dofs: Static[tuple[int, ...]]
|
48
41
|
joint_names: Static[tuple[str, ...]]
|
49
|
-
joint_types: Static[tuple[JointType
|
42
|
+
joint_types: Static[tuple[JointType, ...]]
|
43
|
+
joint_axis: Static[tuple[JointGenericAxis, ...]]
|
50
44
|
|
51
45
|
@staticmethod
|
52
46
|
def build(description: ModelDescription) -> JointModel:
|
@@ -114,7 +108,8 @@ class JointModel:
|
|
114
108
|
# Static attributes
|
115
109
|
joint_dofs=tuple([base_dofs] + [int(1) for _ in ordered_joints]),
|
116
110
|
joint_names=tuple(["world_to_base"] + [j.name for j in ordered_joints]),
|
117
|
-
joint_types=tuple([JointType.
|
111
|
+
joint_types=tuple([JointType.Fixed] + [j.jtype for j in ordered_joints]),
|
112
|
+
joint_axis=tuple([j.axis for j in ordered_joints]),
|
118
113
|
)
|
119
114
|
|
120
115
|
def parent_H_child(
|
@@ -204,8 +199,9 @@ class JointModel:
|
|
204
199
|
"""
|
205
200
|
|
206
201
|
pre_H_suc, S = supported_joint_motion(
|
207
|
-
|
208
|
-
joint_position
|
202
|
+
self.joint_types[joint_index],
|
203
|
+
joint_position,
|
204
|
+
self.joint_axis[joint_index],
|
209
205
|
)
|
210
206
|
|
211
207
|
return pre_H_suc, S
|
@@ -226,59 +222,57 @@ class JointModel:
|
|
226
222
|
return self.suc_H_i[joint_index]
|
227
223
|
|
228
224
|
|
229
|
-
@
|
225
|
+
@jax.jit
|
230
226
|
def supported_joint_motion(
|
231
|
-
joint_type: JointType
|
227
|
+
joint_type: JointType,
|
228
|
+
joint_position: jtp.VectorLike,
|
229
|
+
joint_axis: JointGenericAxis,
|
230
|
+
/,
|
232
231
|
) -> tuple[jtp.Matrix, jtp.Array]:
|
233
232
|
"""
|
234
233
|
Compute the homogeneous transformation and motion subspace of a joint.
|
235
234
|
|
236
235
|
Args:
|
237
236
|
joint_type: The type of the joint.
|
237
|
+
joint_axis: The axis of rotation or translation of the joint.
|
238
238
|
joint_position: The position of the joint.
|
239
239
|
|
240
240
|
Returns:
|
241
241
|
A tuple containing the homogeneous transformation and the motion subspace.
|
242
242
|
"""
|
243
243
|
|
244
|
-
if isinstance(joint_type, JointType):
|
245
|
-
type_enum = joint_type
|
246
|
-
elif isinstance(joint_type, JointDescriptor):
|
247
|
-
type_enum = joint_type.joint_type
|
248
|
-
else:
|
249
|
-
raise ValueError(joint_type)
|
250
|
-
|
251
244
|
# Prepare the joint position
|
252
245
|
s = jnp.array(joint_position).astype(float)
|
253
246
|
|
254
|
-
|
255
|
-
|
256
|
-
case JointType.R:
|
257
|
-
joint_type: JointGenericAxis
|
247
|
+
def compute_F():
|
248
|
+
return jaxlie.SE3.identity(), jnp.zeros(shape=(6, 1))
|
258
249
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
)
|
250
|
+
def compute_R():
|
251
|
+
pre_H_suc = jaxlie.SE3.from_rotation(
|
252
|
+
rotation=jaxlie.SO3.from_matrix(
|
253
|
+
Rotation.from_axis_angle(vector=s * joint_axis)
|
263
254
|
)
|
255
|
+
)
|
264
256
|
|
265
|
-
|
266
|
-
|
267
|
-
case JointType.P:
|
268
|
-
joint_type: JointGenericAxis
|
269
|
-
|
270
|
-
pre_H_suc = jaxlie.SE3.from_rotation_and_translation(
|
271
|
-
rotation=jaxlie.SO3.identity(),
|
272
|
-
translation=jnp.array(s * joint_type.axis),
|
273
|
-
)
|
257
|
+
S = jnp.vstack(jnp.hstack([jnp.zeros(3), joint_axis.squeeze()]))
|
258
|
+
return pre_H_suc, S
|
274
259
|
|
275
|
-
|
260
|
+
def compute_P():
|
261
|
+
pre_H_suc = jaxlie.SE3.from_rotation_and_translation(
|
262
|
+
rotation=jaxlie.SO3.identity(),
|
263
|
+
translation=jnp.array(s * joint_axis),
|
264
|
+
)
|
276
265
|
|
277
|
-
|
278
|
-
|
279
|
-
S = jnp.zeros(shape=(6, 1))
|
266
|
+
S = jnp.vstack(jnp.hstack([joint_axis.squeeze(), jnp.zeros(3)]))
|
267
|
+
return pre_H_suc, S
|
280
268
|
|
281
|
-
|
282
|
-
|
269
|
+
pre_H_suc, S = jax.lax.switch(
|
270
|
+
index=joint_type,
|
271
|
+
branches=(
|
272
|
+
compute_F, # JointType.Fixed
|
273
|
+
compute_R, # JointType.Revolute
|
274
|
+
compute_P, # JointType.Prismatic
|
275
|
+
),
|
276
|
+
)
|
283
277
|
|
284
278
|
return pre_H_suc.as_matrix(), S
|
@@ -1,4 +1,4 @@
|
|
1
1
|
from .collision import BoxCollision, CollidablePoint, CollisionShape, SphereCollision
|
2
|
-
from .joint import JointDescription,
|
2
|
+
from .joint import JointDescription, JointGenericAxis, JointType
|
3
3
|
from .link import LinkDescription
|
4
4
|
from .model import ModelDescription
|
@@ -1,8 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import dataclasses
|
4
|
-
import
|
5
|
-
from typing import Tuple, Union
|
4
|
+
from typing import ClassVar, Tuple, Union
|
6
5
|
|
7
6
|
import jax_dataclasses
|
8
7
|
import numpy as np
|
@@ -14,39 +13,15 @@ from jaxsim.utils import JaxsimDataclass, Mutability
|
|
14
13
|
from .link import LinkDescription
|
15
14
|
|
16
15
|
|
17
|
-
@
|
18
|
-
class JointType
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@staticmethod
|
24
|
-
def _generate_next_value_(name, start, count, last_values):
|
25
|
-
# Start auto Enum value from 0 instead of 1
|
26
|
-
return count
|
27
|
-
|
28
|
-
#: Fixed joint.
|
29
|
-
F = enum.auto()
|
30
|
-
|
31
|
-
#: Revolute joint (1 DoF around axis).
|
32
|
-
R = enum.auto()
|
33
|
-
|
34
|
-
#: Prismatic joint (1 DoF along axis).
|
35
|
-
P = enum.auto()
|
36
|
-
|
37
|
-
|
38
|
-
@jax_dataclasses.pytree_dataclass
|
39
|
-
class JointDescriptor:
|
40
|
-
"""
|
41
|
-
Base class for joint types requiring to store additional metadata.
|
42
|
-
"""
|
43
|
-
|
44
|
-
#: The joint type.
|
45
|
-
joint_type: JointType
|
16
|
+
@dataclasses.dataclass(frozen=True)
|
17
|
+
class JointType:
|
18
|
+
Fixed: ClassVar[int] = 0
|
19
|
+
Revolute: ClassVar[int] = 1
|
20
|
+
Prismatic: ClassVar[int] = 2
|
46
21
|
|
47
22
|
|
48
23
|
@jax_dataclasses.pytree_dataclass
|
49
|
-
class JointGenericAxis
|
24
|
+
class JointGenericAxis:
|
50
25
|
"""
|
51
26
|
A joint requiring the specification of a 3D axis.
|
52
27
|
"""
|
@@ -55,7 +30,7 @@ class JointGenericAxis(JointDescriptor):
|
|
55
30
|
axis: jtp.Vector
|
56
31
|
|
57
32
|
def __hash__(self) -> int:
|
58
|
-
return hash((
|
33
|
+
return hash((tuple(np.array(self.axis).tolist())))
|
59
34
|
|
60
35
|
def __eq__(self, other: JointGenericAxis) -> bool:
|
61
36
|
if not isinstance(other, JointGenericAxis):
|
@@ -73,7 +48,7 @@ class JointDescription(JaxsimDataclass):
|
|
73
48
|
name (str): The name of the joint.
|
74
49
|
axis (npt.NDArray): The axis of rotation or translation for the joint.
|
75
50
|
pose (npt.NDArray): The pose transformation matrix of the joint.
|
76
|
-
jtype (
|
51
|
+
jtype (JointType): The type of the joint.
|
77
52
|
child (LinkDescription): The child link attached to the joint.
|
78
53
|
parent (LinkDescription): The parent link attached to the joint.
|
79
54
|
index (Optional[int]): An optional index for the joint.
|
@@ -89,7 +64,7 @@ class JointDescription(JaxsimDataclass):
|
|
89
64
|
name: jax_dataclasses.Static[str]
|
90
65
|
axis: npt.NDArray
|
91
66
|
pose: npt.NDArray
|
92
|
-
jtype: jax_dataclasses.Static[
|
67
|
+
jtype: jax_dataclasses.Static[JointType]
|
93
68
|
child: LinkDescription = dataclasses.dataclass(repr=False)
|
94
69
|
parent: LinkDescription = dataclasses.dataclass(repr=False)
|
95
70
|
|
@@ -121,7 +121,8 @@ class KinematicGraph(Sequence[descriptions.LinkDescription]):
|
|
121
121
|
# Also here, we assume the model is fixed-base, therefore the first frame will
|
122
122
|
# have last_link_idx + 1. These frames are not part of the physics model.
|
123
123
|
for index, frame in enumerate(self.frames):
|
124
|
-
frame.
|
124
|
+
with frame.mutable_context(mutability=Mutability.MUTABLE_NO_VALIDATION):
|
125
|
+
frame.index = int(index + len(self.link_names()))
|
125
126
|
|
126
127
|
# Number joints so that their index matches their child link index
|
127
128
|
links_dict = {l.name: l for l in iter(self)}
|
@@ -689,6 +690,7 @@ class KinematicGraphTransforms:
|
|
689
690
|
# Compute the joint transform from the predecessor to the successor frame.
|
690
691
|
pre_H_J = self.pre_H_suc(
|
691
692
|
joint_type=joint.jtype,
|
693
|
+
joint_axis=joint.axis,
|
692
694
|
joint_position=self._initial_joint_positions[joint.name],
|
693
695
|
)
|
694
696
|
|
@@ -762,14 +764,15 @@ class KinematicGraphTransforms:
|
|
762
764
|
|
763
765
|
@staticmethod
|
764
766
|
def pre_H_suc(
|
765
|
-
joint_type: descriptions.JointType
|
767
|
+
joint_type: descriptions.JointType,
|
768
|
+
joint_axis: descriptions.JointGenericAxis,
|
766
769
|
joint_position: float | None = None,
|
767
770
|
) -> npt.NDArray:
|
768
771
|
|
769
772
|
import jaxsim.math
|
770
773
|
|
771
774
|
return np.array(
|
772
|
-
jaxsim.math.supported_joint_motion(
|
773
|
-
|
774
|
-
|
775
|
+
jaxsim.math.supported_joint_motion(joint_type, joint_position, joint_axis)[
|
776
|
+
0
|
777
|
+
]
|
775
778
|
)
|
jaxsim/parsers/rod/parser.py
CHANGED
@@ -6,6 +6,7 @@ import jax.numpy as jnp
|
|
6
6
|
import numpy as np
|
7
7
|
import rod
|
8
8
|
|
9
|
+
import jaxsim.utils
|
9
10
|
from jaxsim import logging
|
10
11
|
from jaxsim.math.quaternion import Quaternion
|
11
12
|
from jaxsim.parsers import descriptions, kinematic_graph
|
@@ -25,6 +26,7 @@ class SDFData(NamedTuple):
|
|
25
26
|
|
26
27
|
link_descriptions: List[descriptions.LinkDescription]
|
27
28
|
joint_descriptions: List[descriptions.JointDescription]
|
29
|
+
frame_descriptions: List[descriptions.LinkDescription]
|
28
30
|
collision_shapes: List[descriptions.CollisionShape]
|
29
31
|
|
30
32
|
sdf_model: rod.Model | None = None
|
@@ -70,6 +72,8 @@ def extract_model_data(
|
|
70
72
|
|
71
73
|
# Jaxsim supports only models compatible with URDF, i.e. those having all links
|
72
74
|
# directly attached to their parent joint without additional roto-translations.
|
75
|
+
# Furthermore, the following switch also post-processes frames such that their
|
76
|
+
# pose is expressed wrt the parent link they are rigidly attached to.
|
73
77
|
sdf_model.switch_frame_convention(frame_convention=rod.FrameConvention.Urdf)
|
74
78
|
|
75
79
|
# Log type of base link
|
@@ -113,6 +117,23 @@ def extract_model_data(
|
|
113
117
|
# Create a dictionary to find easily links
|
114
118
|
links_dict: Dict[str, descriptions.LinkDescription] = {l.name: l for l in links}
|
115
119
|
|
120
|
+
# ============
|
121
|
+
# Parse frames
|
122
|
+
# ============
|
123
|
+
|
124
|
+
# Parse the frames (unconnected)
|
125
|
+
frames = [
|
126
|
+
descriptions.LinkDescription(
|
127
|
+
name=f.name,
|
128
|
+
mass=jnp.array(0.0, dtype=float),
|
129
|
+
inertia=jnp.zeros(shape=(3, 3)),
|
130
|
+
parent=links_dict[f.attached_to],
|
131
|
+
pose=f.pose.transform() if f.pose is not None else jnp.eye(4),
|
132
|
+
)
|
133
|
+
for f in sdf_model.frames()
|
134
|
+
if f.attached_to in links_dict
|
135
|
+
]
|
136
|
+
|
116
137
|
# =========================
|
117
138
|
# Process fixed-base models
|
118
139
|
# =========================
|
@@ -309,6 +330,7 @@ def extract_model_data(
|
|
309
330
|
model_name=sdf_model.name,
|
310
331
|
link_descriptions=links,
|
311
332
|
joint_descriptions=joints,
|
333
|
+
frame_descriptions=frames,
|
312
334
|
collision_shapes=collisions,
|
313
335
|
fixed_base=sdf_model.is_fixed_base(),
|
314
336
|
base_link_name=sdf_model.get_canonical_link(),
|
@@ -338,10 +360,14 @@ def build_model_description(
|
|
338
360
|
model_description=model_description, model_name=None, is_urdf=is_urdf
|
339
361
|
)
|
340
362
|
|
341
|
-
# Build the model
|
363
|
+
# Build the intermediate representation used for building a JaxSim model.
|
364
|
+
# This process, beyond other operations, removes the fixed joints.
|
342
365
|
# Note: if the model is fixed-base, the fixed joint between world and the first
|
343
366
|
# link is removed and the pose of the first link is updated.
|
344
|
-
|
367
|
+
#
|
368
|
+
# The whole process is:
|
369
|
+
# URDF/SDF ⟶ rod.Model ⟶ ModelDescription ⟶ JaxSimModel.
|
370
|
+
graph = descriptions.ModelDescription.build_model_from(
|
345
371
|
name=sdf_data.model_name,
|
346
372
|
links=sdf_data.link_descriptions,
|
347
373
|
joints=sdf_data.joint_descriptions,
|
@@ -352,11 +378,51 @@ def build_model_description(
|
|
352
378
|
considered_joints=[
|
353
379
|
j.name
|
354
380
|
for j in sdf_data.joint_descriptions
|
355
|
-
if j.jtype is not descriptions.JointType.
|
381
|
+
if j.jtype is not descriptions.JointType.Fixed
|
356
382
|
],
|
357
383
|
)
|
358
384
|
|
385
|
+
# Depending on how the model is reduced due to the removal of fixed joints,
|
386
|
+
# there might be frames that are no longer attached to existing links.
|
387
|
+
# We need to change the link to which they are attached to, and update their pose.
|
388
|
+
frames_with_no_parent_link = (
|
389
|
+
f for f in sdf_data.frame_descriptions if f.parent.name not in graph
|
390
|
+
)
|
391
|
+
|
392
|
+
# Build the object to compute forward kinematics.
|
393
|
+
fk = kinematic_graph.KinematicGraphTransforms(graph=graph)
|
394
|
+
|
395
|
+
for frame in frames_with_no_parent_link:
|
396
|
+
# Get the original data of the frame.
|
397
|
+
original_pose = frame.pose
|
398
|
+
original_parent_link = frame.parent.name
|
399
|
+
|
400
|
+
# The parent link, that has been removed, became a frame.
|
401
|
+
assert original_parent_link in graph.frames_dict, (frame, original_parent_link)
|
402
|
+
|
403
|
+
# Get the new parent of the frame corresponding to the removed parent link.
|
404
|
+
new_parent_link = graph.frames_dict[original_parent_link].parent.name
|
405
|
+
logging.debug(f"Frame '{frame.name}' is now attached to '{new_parent_link}'")
|
406
|
+
|
407
|
+
# Get the transform from the new parent link to the original parent link.
|
408
|
+
# The original pose is expressed wrt the original parent link.
|
409
|
+
F_H_P = fk.relative_transform(
|
410
|
+
relative_to=new_parent_link, name=original_parent_link
|
411
|
+
)
|
412
|
+
|
413
|
+
# Update the frame with the updated data.
|
414
|
+
with frame.mutable_context(
|
415
|
+
mutability=jaxsim.utils.Mutability.MUTABLE_NO_VALIDATION
|
416
|
+
):
|
417
|
+
frame.parent = graph.links_dict[new_parent_link]
|
418
|
+
frame.pose = np.array(F_H_P @ original_pose)
|
419
|
+
|
420
|
+
# Include the SDF frames originally stored in the SDF.
|
421
|
+
graph = dataclasses.replace(
|
422
|
+
graph, frames=sdf_data.frame_descriptions + graph.frames
|
423
|
+
)
|
424
|
+
|
359
425
|
# Store the parsed SDF tree as extra info
|
360
|
-
|
426
|
+
graph = dataclasses.replace(graph, extra_info={"sdf_model": sdf_data.sdf_model})
|
361
427
|
|
362
|
-
return
|
428
|
+
return graph
|
jaxsim/parsers/rod/utils.py
CHANGED
@@ -61,7 +61,7 @@ def from_sdf_inertial(inertial: rod.Inertial) -> jtp.Matrix:
|
|
61
61
|
|
62
62
|
def joint_to_joint_type(
|
63
63
|
joint: rod.Joint,
|
64
|
-
) -> descriptions.JointType
|
64
|
+
) -> descriptions.JointType:
|
65
65
|
"""
|
66
66
|
Extract the joint type from an SDF joint.
|
67
67
|
|
@@ -76,7 +76,7 @@ def joint_to_joint_type(
|
|
76
76
|
joint_type = joint.type
|
77
77
|
|
78
78
|
if joint_type == "fixed":
|
79
|
-
return descriptions.JointType.
|
79
|
+
return descriptions.JointType.Fixed
|
80
80
|
|
81
81
|
if not (axis.xyz is not None and axis.xyz.xyz is not None):
|
82
82
|
raise ValueError("Failed to read axis xyz data")
|
@@ -86,14 +86,10 @@ def joint_to_joint_type(
|
|
86
86
|
axis_xyz = axis_xyz / np.linalg.norm(axis_xyz)
|
87
87
|
|
88
88
|
if joint_type in {"revolute", "continuous"}:
|
89
|
-
return descriptions.
|
90
|
-
joint_type=descriptions.JointType.R, axis=axis_xyz
|
91
|
-
)
|
89
|
+
return descriptions.JointType.Revolute
|
92
90
|
|
93
91
|
if joint_type == "prismatic":
|
94
|
-
return descriptions.
|
95
|
-
joint_type=descriptions.JointType.P, axis=axis_xyz
|
96
|
-
)
|
92
|
+
return descriptions.JointType.Prismatic
|
97
93
|
|
98
94
|
raise ValueError("Joint not supported", axis_xyz, joint_type)
|
99
95
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: jaxsim
|
3
|
-
Version: 0.2.1.
|
3
|
+
Version: 0.2.1.dev51
|
4
4
|
Home-page: https://github.com/ami-iit/jaxsim
|
5
5
|
Author: Diego Ferigo
|
6
6
|
Author-email: diego.ferigo@iit.it
|
@@ -37,7 +37,7 @@ Requires-Dist: jaxlib >=0.4.13
|
|
37
37
|
Requires-Dist: jaxlie >=1.3.0
|
38
38
|
Requires-Dist: jax-dataclasses >=1.4.0
|
39
39
|
Requires-Dist: pptree
|
40
|
-
Requires-Dist: rod >=0.
|
40
|
+
Requires-Dist: rod >=0.3.0
|
41
41
|
Requires-Dist: typing-extensions ; python_version < "3.12"
|
42
42
|
Provides-Extra: all
|
43
43
|
Requires-Dist: black[jupyter] ~=24.0 ; extra == 'all'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
jaxsim/__init__.py,sha256=OcrfoYS1DGcmAGqu2AqlCTiUVxcpi-IsVwcr_16x74Q,1789
|
2
|
-
jaxsim/_version.py,sha256=
|
2
|
+
jaxsim/_version.py,sha256=gSig5h2ZFD-r1oHIhHQTOvL-PnxvMjAYMiDivQOzr48,426
|
3
3
|
jaxsim/logging.py,sha256=c4zhwBKf9eAYAHVp62kTEllqdsZgh0K-kPKVy8L3elU,1584
|
4
4
|
jaxsim/typing.py,sha256=MeuOCQtLAr-sPkvB_sU8FtwGNRirz1auCwIgRC-QZl8,646
|
5
5
|
jaxsim/api/__init__.py,sha256=fNTCPUeDfOAizRd4RsW3Epv0sLTu0KJGoFRSEsi75VM,162
|
@@ -7,8 +7,8 @@ jaxsim/api/com.py,sha256=Qtm_6qpiK4WtDVn6JMUHa8DySgBl9CjgKCybJqZ58Lc,7379
|
|
7
7
|
jaxsim/api/common.py,sha256=DV-WZG28sikXopNv458aYvpLjmiAtFr5LRscOwXusuk,6640
|
8
8
|
jaxsim/api/contact.py,sha256=Ve4ZOWkLEBRgK3KhtICxKY7YzsxYvc3lO-pPRBjqSnY,8659
|
9
9
|
jaxsim/api/data.py,sha256=GXSCfq4_PsRZuUwsmcl18e2Ppdtu4ykYs0oWih8J2ZI,26775
|
10
|
-
jaxsim/api/joint.py,sha256
|
11
|
-
jaxsim/api/kin_dyn_parameters.py,sha256=
|
10
|
+
jaxsim/api/joint.py,sha256=-5DogPg4g4mmLckyVIVNjwv-Rxz0IWS7_md9nDlhPWA,4581
|
11
|
+
jaxsim/api/kin_dyn_parameters.py,sha256=9xdHS3lDWSEdV0qAqCVoS6cSMUw17ebPJdbBfq4vjVU,25959
|
12
12
|
jaxsim/api/link.py,sha256=rypTwkMf9HJ5UuAtHRJh0LqqdJWcLKTtTjWcjduEsF0,9842
|
13
13
|
jaxsim/api/model.py,sha256=Ci7hl4M1gbnHNQAO5GLjxOdvJe8w3dhvGB_7x2gdpaU,53540
|
14
14
|
jaxsim/api/ode.py,sha256=6l-6i2YHagsQvR8Ac-_fmO6P0hBVT6NkHhwXnrdITEg,9785
|
@@ -22,7 +22,7 @@ jaxsim/math/__init__.py,sha256=inJ9nRFkqstuGa8OyFkfWVudo5U9Ug4WgDBuKva8AIA,337
|
|
22
22
|
jaxsim/math/adjoint.py,sha256=DT21izjVW497GRrgNfx8tv0ZeWW5QncWMGMhI0acUNw,4425
|
23
23
|
jaxsim/math/cross.py,sha256=U7yEx_l75mSy5g6O-jsjBztApvxC3WaV4MpkS5tThu4,1330
|
24
24
|
jaxsim/math/inertia.py,sha256=UAB7ym4gXFanejcs_ovZMpteHCc6poWYmt-mLmd5hhk,1640
|
25
|
-
jaxsim/math/joint_model.py,sha256=
|
25
|
+
jaxsim/math/joint_model.py,sha256=L_rLVUONJclAaPgZmtNrZRB6X7tx6g5xZoVH2E2PU7I,9535
|
26
26
|
jaxsim/math/quaternion.py,sha256=X9b8jHf0QemKUjIZSnXRJc3DdMr42CBhBy_mi9_X_AM,5068
|
27
27
|
jaxsim/math/rotation.py,sha256=Z90daUjGpuNEVLfWB3SVtM9EtwAIaneVj9A9UpWXqhA,2182
|
28
28
|
jaxsim/math/skew.py,sha256=oOGSSR8PUGROl6IJFlrmu6K3gPH-u16hUPfKIkcVv9o,1177
|
@@ -33,15 +33,15 @@ jaxsim/mujoco/loaders.py,sha256=-z6TIsems7DDogueDBwYLS2JuoWalNfv6sV1F45H63k,2102
|
|
33
33
|
jaxsim/mujoco/model.py,sha256=5-4KTbEbU19zjrSuvUVdLo3noWxTvlCNsFIs3rQTNDY,13506
|
34
34
|
jaxsim/mujoco/visualizer.py,sha256=YlteqcCbeB1B6saAHKBz1IJad3N5Rp163reZrzKLAys,5065
|
35
35
|
jaxsim/parsers/__init__.py,sha256=sonYi-bBWAoB04kp1mxT4uIORxjb7SdZ0ukGPmVx98Y,44
|
36
|
-
jaxsim/parsers/kinematic_graph.py,sha256=
|
37
|
-
jaxsim/parsers/descriptions/__init__.py,sha256=
|
36
|
+
jaxsim/parsers/kinematic_graph.py,sha256=rAqh1XBJU0qDkDoA_BSdt-PwBBTFO8SXVpr81Xumbp4,29074
|
37
|
+
jaxsim/parsers/descriptions/__init__.py,sha256=PbIlunVfb59pB5jSX97YVpMAANRZPRkJ0X-hS14rzv4,221
|
38
38
|
jaxsim/parsers/descriptions/collision.py,sha256=HUWwuRgI9KznY29FFw1_zU3bGigDEezrcPOJSxSJGNU,3382
|
39
|
-
jaxsim/parsers/descriptions/joint.py,sha256=
|
39
|
+
jaxsim/parsers/descriptions/joint.py,sha256=r7teUWJyw62WS7qNCB_9FGQD1hvGHBepk-2LCSlmcSc,3052
|
40
40
|
jaxsim/parsers/descriptions/link.py,sha256=hqLLitrAXnouia6ULk1BPOIEfRxrXwHmoPsi306IZW8,2859
|
41
41
|
jaxsim/parsers/descriptions/model.py,sha256=hapbpO1VpC7f5ELkGH1ZtM2I3dpmYLz8Em5cb3DdiaA,9264
|
42
42
|
jaxsim/parsers/rod/__init__.py,sha256=G2vqlLajBLUc4gyzXwsEI2Wsi4TMOIF9bLDFeT6KrGU,92
|
43
|
-
jaxsim/parsers/rod/parser.py,sha256=
|
44
|
-
jaxsim/parsers/rod/utils.py,sha256=
|
43
|
+
jaxsim/parsers/rod/parser.py,sha256=DmYYHAovzn1WnY_8qb6Sihr8QX--RMj32QF1RXPdScM,15278
|
44
|
+
jaxsim/parsers/rod/utils.py,sha256=9oO4YsQRaR2v700IkNOXRnPpn5i4N8HFfgjPkMLK2mc,5732
|
45
45
|
jaxsim/rbda/__init__.py,sha256=HLwxeU-IxaRpFGUCSQv-LDv20JHTt3Xj7ELiRbRieS8,319
|
46
46
|
jaxsim/rbda/aba.py,sha256=0OoCzHhf1v-qqr1y5PIrD7_mPwAlid0fjXxUrIa5E_s,9118
|
47
47
|
jaxsim/rbda/collidable_points.py,sha256=4ZNJbEj2nEi15jBLR-GNbdaqKgkN58FBgqd_TXupEgg,4948
|
@@ -57,8 +57,8 @@ jaxsim/utils/__init__.py,sha256=tnQq1_CavdfeKaLYt3pmO7Jk4MU2RwwQU_qICkjyoTY,197
|
|
57
57
|
jaxsim/utils/hashless.py,sha256=bFIwKeo9KiWwsY8QM55duEGGQOyyJ4jQyPcuqTLEp5k,297
|
58
58
|
jaxsim/utils/jaxsim_dataclass.py,sha256=h26timZ_XrBL_Q_oymv-DkQd-EcUiHn8QexAaZXBY9c,11396
|
59
59
|
jaxsim/utils/tracing.py,sha256=KDMoyVPlu2NJvFkhtZwq5AkqMMgajt3munvJom-vEjQ,650
|
60
|
-
jaxsim-0.2.1.
|
61
|
-
jaxsim-0.2.1.
|
62
|
-
jaxsim-0.2.1.
|
63
|
-
jaxsim-0.2.1.
|
64
|
-
jaxsim-0.2.1.
|
60
|
+
jaxsim-0.2.1.dev51.dist-info/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
|
61
|
+
jaxsim-0.2.1.dev51.dist-info/METADATA,sha256=UMhmMrS5kyph8xEtRZwiJqDGBqMPgfa4RDw-2NCApHc,9744
|
62
|
+
jaxsim-0.2.1.dev51.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
63
|
+
jaxsim-0.2.1.dev51.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
|
64
|
+
jaxsim-0.2.1.dev51.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|