jaxsim 0.1.dev401__py3-none-any.whl → 0.2.0__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/__init__.py +5 -6
- jaxsim/_version.py +2 -2
- jaxsim/api/__init__.py +3 -0
- jaxsim/api/com.py +240 -0
- jaxsim/api/common.py +216 -0
- jaxsim/api/contact.py +271 -0
- jaxsim/api/data.py +821 -0
- jaxsim/api/joint.py +189 -0
- jaxsim/api/kin_dyn_parameters.py +777 -0
- jaxsim/api/link.py +361 -0
- jaxsim/api/model.py +1633 -0
- jaxsim/api/ode.py +295 -0
- jaxsim/api/ode_data.py +694 -0
- jaxsim/api/references.py +421 -0
- jaxsim/integrators/__init__.py +2 -0
- jaxsim/integrators/common.py +594 -0
- jaxsim/integrators/fixed_step.py +102 -0
- jaxsim/integrators/variable_step.py +610 -0
- jaxsim/math/__init__.py +11 -0
- jaxsim/math/adjoint.py +24 -2
- jaxsim/math/joint_model.py +335 -0
- jaxsim/math/quaternion.py +44 -3
- jaxsim/math/rotation.py +4 -4
- jaxsim/math/transform.py +92 -0
- jaxsim/mujoco/__init__.py +3 -0
- jaxsim/mujoco/__main__.py +192 -0
- jaxsim/mujoco/loaders.py +615 -0
- jaxsim/mujoco/model.py +414 -0
- jaxsim/mujoco/visualizer.py +176 -0
- jaxsim/parsers/descriptions/collision.py +14 -0
- jaxsim/parsers/descriptions/link.py +13 -2
- jaxsim/parsers/kinematic_graph.py +8 -3
- jaxsim/parsers/rod/parser.py +54 -38
- jaxsim/parsers/rod/utils.py +7 -8
- jaxsim/rbda/__init__.py +7 -0
- jaxsim/rbda/aba.py +295 -0
- jaxsim/rbda/collidable_points.py +142 -0
- jaxsim/{physics/algos → rbda}/crba.py +43 -42
- jaxsim/rbda/forward_kinematics.py +113 -0
- jaxsim/rbda/jacobian.py +201 -0
- jaxsim/rbda/rnea.py +237 -0
- jaxsim/rbda/soft_contacts.py +296 -0
- jaxsim/rbda/utils.py +152 -0
- jaxsim/terrain/__init__.py +2 -0
- jaxsim/{physics/algos → terrain}/terrain.py +4 -6
- jaxsim/typing.py +30 -30
- jaxsim/utils/__init__.py +1 -4
- jaxsim/utils/hashless.py +18 -0
- jaxsim/utils/jaxsim_dataclass.py +281 -31
- {jaxsim-0.1.dev401.dist-info → jaxsim-0.2.0.dist-info}/LICENSE +1 -1
- jaxsim-0.2.0.dist-info/METADATA +237 -0
- jaxsim-0.2.0.dist-info/RECORD +64 -0
- {jaxsim-0.1.dev401.dist-info → jaxsim-0.2.0.dist-info}/WHEEL +1 -1
- jaxsim/high_level/__init__.py +0 -2
- jaxsim/high_level/common.py +0 -11
- jaxsim/high_level/joint.py +0 -148
- jaxsim/high_level/link.py +0 -259
- jaxsim/high_level/model.py +0 -1695
- jaxsim/math/conv.py +0 -114
- jaxsim/math/joint.py +0 -101
- jaxsim/math/plucker.py +0 -100
- jaxsim/physics/__init__.py +0 -12
- jaxsim/physics/algos/__init__.py +0 -0
- jaxsim/physics/algos/aba.py +0 -256
- jaxsim/physics/algos/aba_motors.py +0 -284
- jaxsim/physics/algos/forward_kinematics.py +0 -79
- jaxsim/physics/algos/jacobian.py +0 -98
- jaxsim/physics/algos/rnea.py +0 -180
- jaxsim/physics/algos/rnea_motors.py +0 -196
- jaxsim/physics/algos/soft_contacts.py +0 -454
- jaxsim/physics/algos/utils.py +0 -69
- jaxsim/physics/model/__init__.py +0 -0
- jaxsim/physics/model/ground_contact.py +0 -55
- jaxsim/physics/model/physics_model.py +0 -358
- jaxsim/physics/model/physics_model_state.py +0 -174
- jaxsim/simulation/__init__.py +0 -4
- jaxsim/simulation/integrators.py +0 -452
- jaxsim/simulation/ode.py +0 -290
- jaxsim/simulation/ode_data.py +0 -53
- jaxsim/simulation/ode_integration.py +0 -125
- jaxsim/simulation/simulator.py +0 -544
- jaxsim/simulation/simulator_callbacks.py +0 -53
- jaxsim/simulation/utils.py +0 -15
- jaxsim/sixd/__init__.py +0 -2
- jaxsim/utils/oop.py +0 -532
- jaxsim/utils/vmappable.py +0 -117
- jaxsim-0.1.dev401.dist-info/METADATA +0 -167
- jaxsim-0.1.dev401.dist-info/RECORD +0 -64
- {jaxsim-0.1.dev401.dist-info → jaxsim-0.2.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,237 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: jaxsim
|
3
|
+
Version: 0.2.0
|
4
|
+
Summary: A differentiable physics engine and multibody dynamics library for control and robot learning.
|
5
|
+
Home-page: https://github.com/ami-iit/jaxsim
|
6
|
+
Author: Diego Ferigo
|
7
|
+
Author-email: diego.ferigo@iit.it
|
8
|
+
License: BSD
|
9
|
+
Project-URL: Changelog, https://github.com/ami-iit/jaxsim/releases
|
10
|
+
Project-URL: Documentation, https://jaxsim.readthedocs.io
|
11
|
+
Project-URL: Source, https://github.com/ami-iit/jaxsim
|
12
|
+
Project-URL: Tracker, https://github.com/ami-iit/jaxsim/issues
|
13
|
+
Keywords: physics,physics engine,jax,rigid body dynamics,featherstone,reinforcement learning,robot,robotics,sdf,urdf
|
14
|
+
Platform: any
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
16
|
+
Classifier: Framework :: Robot Framework
|
17
|
+
Classifier: Intended Audience :: Developers
|
18
|
+
Classifier: Intended Audience :: Science/Research
|
19
|
+
Classifier: License :: OSI Approved :: BSD License
|
20
|
+
Classifier: Operating System :: POSIX :: Linux
|
21
|
+
Classifier: Operating System :: MacOS
|
22
|
+
Classifier: Operating System :: Microsoft
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
25
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
26
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
27
|
+
Classifier: Topic :: Games/Entertainment :: Simulation
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
29
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
30
|
+
Classifier: Topic :: Software Development
|
31
|
+
Requires-Python: >=3.11
|
32
|
+
Description-Content-Type: text/markdown
|
33
|
+
License-File: LICENSE
|
34
|
+
Requires-Dist: coloredlogs
|
35
|
+
Requires-Dist: jax >=0.4.13
|
36
|
+
Requires-Dist: jaxlib >=0.4.13
|
37
|
+
Requires-Dist: jaxlie >=1.3.0
|
38
|
+
Requires-Dist: jax-dataclasses >=1.4.0
|
39
|
+
Requires-Dist: pptree
|
40
|
+
Requires-Dist: rod >=0.2.0
|
41
|
+
Requires-Dist: typing-extensions ; python_version < "3.12"
|
42
|
+
Provides-Extra: all
|
43
|
+
Requires-Dist: black[jupyter] ~=24.0 ; extra == 'all'
|
44
|
+
Requires-Dist: isort ; extra == 'all'
|
45
|
+
Requires-Dist: pre-commit ; extra == 'all'
|
46
|
+
Requires-Dist: idyntree ; extra == 'all'
|
47
|
+
Requires-Dist: pytest >=6.0 ; extra == 'all'
|
48
|
+
Requires-Dist: pytest-icdiff ; extra == 'all'
|
49
|
+
Requires-Dist: robot-descriptions ; extra == 'all'
|
50
|
+
Requires-Dist: lxml ; extra == 'all'
|
51
|
+
Requires-Dist: mediapy ; extra == 'all'
|
52
|
+
Requires-Dist: mujoco >=3.0.0 ; extra == 'all'
|
53
|
+
Provides-Extra: style
|
54
|
+
Requires-Dist: black[jupyter] ~=24.0 ; extra == 'style'
|
55
|
+
Requires-Dist: isort ; extra == 'style'
|
56
|
+
Requires-Dist: pre-commit ; extra == 'style'
|
57
|
+
Provides-Extra: testing
|
58
|
+
Requires-Dist: idyntree ; extra == 'testing'
|
59
|
+
Requires-Dist: pytest >=6.0 ; extra == 'testing'
|
60
|
+
Requires-Dist: pytest-icdiff ; extra == 'testing'
|
61
|
+
Requires-Dist: robot-descriptions ; extra == 'testing'
|
62
|
+
Provides-Extra: viz
|
63
|
+
Requires-Dist: lxml ; extra == 'viz'
|
64
|
+
Requires-Dist: mediapy ; extra == 'viz'
|
65
|
+
Requires-Dist: mujoco >=3.0.0 ; extra == 'viz'
|
66
|
+
|
67
|
+
# JaxSim
|
68
|
+
|
69
|
+
JaxSim is a **differentiable physics engine** and **multibody dynamics library** designed for applications in control and robot learning, implemented with JAX.
|
70
|
+
|
71
|
+
Its design facilitates research and accelerates prototyping in the intersection of robotics and artificial intelligence.
|
72
|
+
|
73
|
+
## Features
|
74
|
+
|
75
|
+
- Physics engine in reduced coordinates supporting fixed-base and floating-base robots.
|
76
|
+
- Multibody dynamics library providing all the necessary components for developing model-based control algorithms.
|
77
|
+
- Completely developed in Python with [`google/jax`][jax] following a functional programming paradigm.
|
78
|
+
- Transparent support for running on CPUs, GPUs, and TPUs.
|
79
|
+
- Full support for JIT compilation for increased performance.
|
80
|
+
- Full support for automatic vectorization for massive parallelization of open-loop and closed-loop architectures.
|
81
|
+
- Support for SDF models and, upon conversion with [sdformat][sdformat], URDF models.
|
82
|
+
- Visualization based on the [passive viewer][passive_viewer_mujoco] of Mujoco.
|
83
|
+
|
84
|
+
### JaxSim as a simulator
|
85
|
+
|
86
|
+
- Wide range of fixed-step explicit Runge-Kutta integrators.
|
87
|
+
- Support for variable-step integrators implemented as embedded Runge-Kutta schemes.
|
88
|
+
- Improved stability by optionally integrating the base orientation on the $\text{SO}(3)$ manifold.
|
89
|
+
- Soft contacts model supporting full friction cone and sticking-slipping transition.
|
90
|
+
- Collision detection between points rigidly attached to bodies and uneven ground surfaces.
|
91
|
+
|
92
|
+
### JaxSim as a multibody dynamics library
|
93
|
+
|
94
|
+
- Provides rigid body dynamics algorithms (RBDAs) like RNEA, ABA, CRBA, and Jacobians.
|
95
|
+
- Provides all the quantities included in the Euler-Poincarè formulation of the equations of motion.
|
96
|
+
- Supports body-fixed, inertial-fixed, and mixed [velocity representations][notation].
|
97
|
+
- Exposes all the necessary quantities to develop controllers in centroidal coordinates.
|
98
|
+
|
99
|
+
### JaxSim for robot learning
|
100
|
+
|
101
|
+
- Being developed with JAX, all the RBDAs support automatic differentiation both in forward and reverse modes.
|
102
|
+
- Support for automatically differentiating against kinematics and dynamics parameters.
|
103
|
+
- All fixed-step integrators are forward and reverse differentiable.
|
104
|
+
- All variable-step integrators are forward differentiable.
|
105
|
+
- Ideal for sampling synthetic data for reinforcement learning (RL).
|
106
|
+
- Ideal for designing physics-informed neural networks (PINNs) with loss functions requiring model-based quantities.
|
107
|
+
- Ideal for combining model-based control with learning-based components.
|
108
|
+
|
109
|
+
[jax]: https://github.com/google/jax/
|
110
|
+
[sdformat]: https://github.com/gazebosim/sdformat
|
111
|
+
[notation]: https://research.tue.nl/en/publications/multibody-dynamics-notation-version-2
|
112
|
+
[passive_viewer_mujoco]: https://mujoco.readthedocs.io/en/stable/python.html#passive-viewer
|
113
|
+
|
114
|
+
> [!WARNING]
|
115
|
+
> This project is still experimental, APIs could change between releases without notice.
|
116
|
+
|
117
|
+
> [!NOTE]
|
118
|
+
> JaxSim currently focuses on locomotion applications.
|
119
|
+
> Only contacts between bodies and smooth ground surfaces are supported.
|
120
|
+
|
121
|
+
## Documentation
|
122
|
+
|
123
|
+
The JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs].
|
124
|
+
|
125
|
+
[readthedocs]: https://jaxsim.readthedocs.io/
|
126
|
+
|
127
|
+
## Installation
|
128
|
+
|
129
|
+
<details>
|
130
|
+
<summary>With conda</summary>
|
131
|
+
|
132
|
+
You can install the project using [`conda`][conda] as follows:
|
133
|
+
|
134
|
+
```bash
|
135
|
+
conda install jaxsim -c conda-forge
|
136
|
+
```
|
137
|
+
|
138
|
+
You can enforce GPU support, if needed, by also specifying `"jaxlib = * = *cuda*"`.
|
139
|
+
|
140
|
+
</details>
|
141
|
+
|
142
|
+
<details>
|
143
|
+
<summary>With pip</summary>
|
144
|
+
|
145
|
+
You can install the project using [`pypa/pip`][pip], preferably in a [virtual environment][venv], as follows:
|
146
|
+
|
147
|
+
```bash
|
148
|
+
pip install jaxsim
|
149
|
+
```
|
150
|
+
|
151
|
+
Check [`setup.cfg`](setup.cfg) for the complete list of optional dependencies.
|
152
|
+
You can obtain a full installation using `jaxsim[all]`.
|
153
|
+
|
154
|
+
If you need GPU support, follow the official [installation instructions][jax_gpu] of JAX.
|
155
|
+
|
156
|
+
</details>
|
157
|
+
|
158
|
+
<details>
|
159
|
+
<summary>Contributors installation</summary>
|
160
|
+
|
161
|
+
If you want to contribute to the project, we recommend creating the following `jaxsim` conda environment first:
|
162
|
+
|
163
|
+
```bash
|
164
|
+
conda env create -f environment.yml
|
165
|
+
```
|
166
|
+
|
167
|
+
Then, activate the environment and install the project in editable mode:
|
168
|
+
|
169
|
+
```bash
|
170
|
+
conda activate jaxsim
|
171
|
+
pip install --no-deps -e .
|
172
|
+
```
|
173
|
+
|
174
|
+
</details>
|
175
|
+
|
176
|
+
[conda]: https://anaconda.org/
|
177
|
+
[pip]: https://github.com/pypa/pip/
|
178
|
+
[venv]: https://docs.python.org/3/tutorial/venv.html
|
179
|
+
[jax_gpu]: https://github.com/google/jax/#installation
|
180
|
+
|
181
|
+
## Credits
|
182
|
+
|
183
|
+
The RBDAs are based on the theory of the [Rigid Body Dynamics Algorithms][RBDA]
|
184
|
+
book by Roy Featherstone.
|
185
|
+
The algorithms and some simulation features were inspired by its accompanying [code][spatial_v2].
|
186
|
+
|
187
|
+
[RBDA]: https://link.springer.com/book/10.1007/978-1-4899-7560-7
|
188
|
+
[spatial_v2]: http://royfeatherstone.org/spatial/index.html#spatial-software
|
189
|
+
|
190
|
+
The development of JaxSim started in late 2021, inspired by early versions of [`google/brax`][brax].
|
191
|
+
At that time, Brax was implemented in maximal coordinates, and we wanted a physics engine in reduced coordinates.
|
192
|
+
We are grateful to the Brax team for their work and showing the potential of [JAX][jax] in this field.
|
193
|
+
|
194
|
+
Brax v2 was later implemented reduced coordinates, following an approach comparable to JaxSim.
|
195
|
+
The development then shifted to [MJX][mjx], which today provides a JAX-based implementation of the Mujoco APIs.
|
196
|
+
|
197
|
+
The main differences between MJX/Brax and JaxSim are as follows:
|
198
|
+
|
199
|
+
- JaxSim supports out-of-the-box all SDF models with [Pose Frame Semantics][PFS].
|
200
|
+
- JaxSim only supports collisions between points rigidly attached to bodies and a compliant ground surface.
|
201
|
+
Our contact model requires careful tuning of its spring-damper parameters, but being an instantaneous
|
202
|
+
function of the state $(\mathbf{q}, \boldsymbol{\nu})$, it doesn't require running any optimization algorithm
|
203
|
+
when stepping the simulation forward.
|
204
|
+
- JaxSim mitigates the stiffness of the contact-aware system dynamics by providing variable-step integrators.
|
205
|
+
|
206
|
+
[brax]: https://github.com/google/brax
|
207
|
+
[mjx]: https://mujoco.readthedocs.io/en/3.0.0/mjx.html
|
208
|
+
[PFS]: http://sdformat.org/tutorials?tut=pose_frame_semantics
|
209
|
+
|
210
|
+
## Contributing
|
211
|
+
|
212
|
+
We welcome contributions from the community.
|
213
|
+
Please read the [contributing guide](./CONTRIBUTING.md) to get started.
|
214
|
+
|
215
|
+
## Citing
|
216
|
+
|
217
|
+
```bibtex
|
218
|
+
@software{ferigo_jaxsim_2022,
|
219
|
+
author = {Diego Ferigo and Filippo Luca Ferretti and Silvio Traversaro and Daniele Pucci},
|
220
|
+
title = {{JaxSim}: A Differentiable Physics Engine and Multibody Dynamics Library for Control and Robot Learning},
|
221
|
+
url = {http://github.com/ami-iit/jaxsim},
|
222
|
+
year = {2022},
|
223
|
+
}
|
224
|
+
```
|
225
|
+
|
226
|
+
## People
|
227
|
+
|
228
|
+
| Author | Maintainers |
|
229
|
+
|:------:|:-----------:|
|
230
|
+
| [<img src="https://avatars.githubusercontent.com/u/469199?v=4" width="40">][df] | [<img src="https://avatars.githubusercontent.com/u/102977828?v=4" width="40">][ff] [<img src="https://avatars.githubusercontent.com/u/469199?v=4" width="40">][df] |
|
231
|
+
|
232
|
+
[df]: https://github.com/diegoferigo
|
233
|
+
[ff]: https://github.com/flferretti
|
234
|
+
|
235
|
+
## License
|
236
|
+
|
237
|
+
[BSD3](https://choosealicense.com/licenses/bsd-3-clause/)
|
@@ -0,0 +1,64 @@
|
|
1
|
+
jaxsim/__init__.py,sha256=OcrfoYS1DGcmAGqu2AqlCTiUVxcpi-IsVwcr_16x74Q,1789
|
2
|
+
jaxsim/_version.py,sha256=H-qsvrxCpdhaQzyddR-yajEqI71hPxLa4KxzpP3uS1g,411
|
3
|
+
jaxsim/logging.py,sha256=c4zhwBKf9eAYAHVp62kTEllqdsZgh0K-kPKVy8L3elU,1584
|
4
|
+
jaxsim/typing.py,sha256=MeuOCQtLAr-sPkvB_sU8FtwGNRirz1auCwIgRC-QZl8,646
|
5
|
+
jaxsim/api/__init__.py,sha256=fNTCPUeDfOAizRd4RsW3Epv0sLTu0KJGoFRSEsi75VM,162
|
6
|
+
jaxsim/api/com.py,sha256=Qtm_6qpiK4WtDVn6JMUHa8DySgBl9CjgKCybJqZ58Lc,7379
|
7
|
+
jaxsim/api/common.py,sha256=DV-WZG28sikXopNv458aYvpLjmiAtFr5LRscOwXusuk,6640
|
8
|
+
jaxsim/api/contact.py,sha256=Ve4ZOWkLEBRgK3KhtICxKY7YzsxYvc3lO-pPRBjqSnY,8659
|
9
|
+
jaxsim/api/data.py,sha256=cPFy6TTm0rNpDk1O0ZxOpvBwWVPu6V14XLRMeC7x81Q,26786
|
10
|
+
jaxsim/api/joint.py,sha256=q31Kp3Cqv-yTcxijjzbj_QADFnGQyjb2al9fYZtzedo,4763
|
11
|
+
jaxsim/api/kin_dyn_parameters.py,sha256=G4mtSi8fElYe0yttLgsxSOPf7vcK-yqTu06Aa5SSrYg,26012
|
12
|
+
jaxsim/api/link.py,sha256=rypTwkMf9HJ5UuAtHRJh0LqqdJWcLKTtTjWcjduEsF0,9842
|
13
|
+
jaxsim/api/model.py,sha256=UwjZctpQR_3F8_Cm-NmFQb14Wtw_vscs3Yg-ULpQyrs,52269
|
14
|
+
jaxsim/api/ode.py,sha256=6l-6i2YHagsQvR8Ac-_fmO6P0hBVT6NkHhwXnrdITEg,9785
|
15
|
+
jaxsim/api/ode_data.py,sha256=dwRFVPJ30XMmdUbPXEu7YxsQ97jZP4L4fd5ZzhrO5Ys,22184
|
16
|
+
jaxsim/api/references.py,sha256=Lvskf17r619KKxwCJP7hAAty2kaXgDXJX1uKqoDIDgo,15483
|
17
|
+
jaxsim/integrators/__init__.py,sha256=hxvOD-VK_mmd6v31wtC-nb28AYve1gLuZCNLV9wS-Kg,103
|
18
|
+
jaxsim/integrators/common.py,sha256=9HXRVFo95Mpt6RcVhBrOfvOO7mDxqbkXeg_lKUibEFY,20693
|
19
|
+
jaxsim/integrators/fixed_step.py,sha256=JXaEyEzfSiYea0GnPA7l27J3X0YPB0e25D4qfrxAvzQ,2766
|
20
|
+
jaxsim/integrators/variable_step.py,sha256=jq3PStzFiMciU7lux6CTj4B3gVOfSpYgK2oz2yzIbdo,21380
|
21
|
+
jaxsim/math/__init__.py,sha256=inJ9nRFkqstuGa8OyFkfWVudo5U9Ug4WgDBuKva8AIA,337
|
22
|
+
jaxsim/math/adjoint.py,sha256=DT21izjVW497GRrgNfx8tv0ZeWW5QncWMGMhI0acUNw,4425
|
23
|
+
jaxsim/math/cross.py,sha256=U7yEx_l75mSy5g6O-jsjBztApvxC3WaV4MpkS5tThu4,1330
|
24
|
+
jaxsim/math/inertia.py,sha256=UAB7ym4gXFanejcs_ovZMpteHCc6poWYmt-mLmd5hhk,1640
|
25
|
+
jaxsim/math/joint_model.py,sha256=LKLB26VMz6vx9JLdFUWhGyrElYFEQV-bJiQO5kaZUGY,10896
|
26
|
+
jaxsim/math/quaternion.py,sha256=X9b8jHf0QemKUjIZSnXRJc3DdMr42CBhBy_mi9_X_AM,5068
|
27
|
+
jaxsim/math/rotation.py,sha256=Z90daUjGpuNEVLfWB3SVtM9EtwAIaneVj9A9UpWXqhA,2182
|
28
|
+
jaxsim/math/skew.py,sha256=oOGSSR8PUGROl6IJFlrmu6K3gPH-u16hUPfKIkcVv9o,1177
|
29
|
+
jaxsim/math/transform.py,sha256=boeuN8df4Yd9NvS64g-xUYoNqG91YafYLam4iITFJVg,2917
|
30
|
+
jaxsim/mujoco/__init__.py,sha256=Zo5GAlN1DYKvX8s1hu1j6HntKIbBMLB9Puv9ouaNAZ8,158
|
31
|
+
jaxsim/mujoco/__main__.py,sha256=GBmB7J-zj75ZnFyuAAmpSOpbxi_HhHhWJeot3ljGDJY,5291
|
32
|
+
jaxsim/mujoco/loaders.py,sha256=8_2jB6DjGyFGPQS6mTs_1JH37Wd6mSiWP8rlNTuB6Uo,21029
|
33
|
+
jaxsim/mujoco/model.py,sha256=5-4KTbEbU19zjrSuvUVdLo3noWxTvlCNsFIs3rQTNDY,13506
|
34
|
+
jaxsim/mujoco/visualizer.py,sha256=YlteqcCbeB1B6saAHKBz1IJad3N5Rp163reZrzKLAys,5065
|
35
|
+
jaxsim/parsers/__init__.py,sha256=sonYi-bBWAoB04kp1mxT4uIORxjb7SdZ0ukGPmVx98Y,44
|
36
|
+
jaxsim/parsers/kinematic_graph.py,sha256=_ZJr-u1m64qPCeY6BHTI56dSOWhOGfbg2HN49XbTXhA,23784
|
37
|
+
jaxsim/parsers/descriptions/__init__.py,sha256=EbTfnrK3oCxA3pNv--YUwllJ6uICENvFgAdRbYtS9ts,238
|
38
|
+
jaxsim/parsers/descriptions/collision.py,sha256=HUWwuRgI9KznY29FFw1_zU3bGigDEezrcPOJSxSJGNU,3382
|
39
|
+
jaxsim/parsers/descriptions/joint.py,sha256=hpH0ANvIhbEQk-NGRmWIvPv3lXW385TBIMWNgz5rzM4,4106
|
40
|
+
jaxsim/parsers/descriptions/link.py,sha256=hqLLitrAXnouia6ULk1BPOIEfRxrXwHmoPsi306IZW8,2859
|
41
|
+
jaxsim/parsers/descriptions/model.py,sha256=wenuDrjoBf6prkzm9WyYT0nFWc0l6WBpKNjLoRUDPxo,8937
|
42
|
+
jaxsim/parsers/rod/__init__.py,sha256=G2vqlLajBLUc4gyzXwsEI2Wsi4TMOIF9bLDFeT6KrGU,92
|
43
|
+
jaxsim/parsers/rod/parser.py,sha256=mFi1baSJte6EMmWLpVjVuCpicfAAF48aFUzoKzYzPpo,12555
|
44
|
+
jaxsim/parsers/rod/utils.py,sha256=xoxNdb4IgOePFFnblNo6UrgYCRm53mB3No3yXM6qlpw,6471
|
45
|
+
jaxsim/rbda/__init__.py,sha256=HLwxeU-IxaRpFGUCSQv-LDv20JHTt3Xj7ELiRbRieS8,319
|
46
|
+
jaxsim/rbda/aba.py,sha256=0OoCzHhf1v-qqr1y5PIrD7_mPwAlid0fjXxUrIa5E_s,9118
|
47
|
+
jaxsim/rbda/collidable_points.py,sha256=4ZNJbEj2nEi15jBLR-GNbdaqKgkN58FBgqd_TXupEgg,4948
|
48
|
+
jaxsim/rbda/crba.py,sha256=GodskOZjtrSlbQAqxRv1un_706O7BaJK-U2qa18vJk8,4741
|
49
|
+
jaxsim/rbda/forward_kinematics.py,sha256=OHugNU7C0UxYAW0o1rqH1ZgniSwurz6L1T1MJxfxq08,3418
|
50
|
+
jaxsim/rbda/jacobian.py,sha256=9LGGy9ya5m5U0mBmV1NFH5XYZpEMYbx74qnYBvZs7Ok,6360
|
51
|
+
jaxsim/rbda/rnea.py,sha256=DjwkvXQVUSUclM3Uy3UPZ2tao91R5dGd4o7TsS2qObI,7650
|
52
|
+
jaxsim/rbda/soft_contacts.py,sha256=2EZ9Lw4nFWqXTMEeYsirl17H61s82SmTZllKVsP1Yek,10759
|
53
|
+
jaxsim/rbda/utils.py,sha256=zpbFM2Iq8cntku0BFVu9nfEqZhInCWi9D2INT6MFEI8,5003
|
54
|
+
jaxsim/terrain/__init__.py,sha256=f7lVX-iNpH_wkkjef9Qpjh19TTAUOQw76EiLYJDVizc,78
|
55
|
+
jaxsim/terrain/terrain.py,sha256=q0xkWqEShVq-p1j2abTLZq8sEhjyJwquxQKm80PaHhM,2161
|
56
|
+
jaxsim/utils/__init__.py,sha256=tnQq1_CavdfeKaLYt3pmO7Jk4MU2RwwQU_qICkjyoTY,197
|
57
|
+
jaxsim/utils/hashless.py,sha256=bFIwKeo9KiWwsY8QM55duEGGQOyyJ4jQyPcuqTLEp5k,297
|
58
|
+
jaxsim/utils/jaxsim_dataclass.py,sha256=T8nZolb563mYJD7YvTmYW-z-hpkEiaK3cDbYHqwtqRc,11347
|
59
|
+
jaxsim/utils/tracing.py,sha256=KDMoyVPlu2NJvFkhtZwq5AkqMMgajt3munvJom-vEjQ,650
|
60
|
+
jaxsim-0.2.0.dist-info/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
|
61
|
+
jaxsim-0.2.0.dist-info/METADATA,sha256=t2ADrolAYSNA-5JfwxlYJgN-Em_Bb8SGw2vQs0Hp-8w,9773
|
62
|
+
jaxsim-0.2.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
63
|
+
jaxsim-0.2.0.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
|
64
|
+
jaxsim-0.2.0.dist-info/RECORD,,
|
jaxsim/high_level/__init__.py
DELETED
jaxsim/high_level/common.py
DELETED
jaxsim/high_level/joint.py
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
import dataclasses
|
2
|
-
import functools
|
3
|
-
from typing import Any
|
4
|
-
|
5
|
-
import jax.numpy as jnp
|
6
|
-
import jax_dataclasses
|
7
|
-
from jax_dataclasses import Static
|
8
|
-
|
9
|
-
import jaxsim.parsers
|
10
|
-
import jaxsim.typing as jtp
|
11
|
-
from jaxsim.utils import Vmappable, not_tracing, oop
|
12
|
-
|
13
|
-
|
14
|
-
@jax_dataclasses.pytree_dataclass
|
15
|
-
class Joint(Vmappable):
|
16
|
-
"""
|
17
|
-
High-level class to operate in r/o on a single joint of a simulated model.
|
18
|
-
"""
|
19
|
-
|
20
|
-
joint_description: Static[jaxsim.parsers.descriptions.JointDescription]
|
21
|
-
|
22
|
-
_parent_model: Any = dataclasses.field(
|
23
|
-
default=None, repr=False, compare=False, hash=False
|
24
|
-
)
|
25
|
-
|
26
|
-
@property
|
27
|
-
def parent_model(self) -> "jaxsim.high_level.model.Model":
|
28
|
-
""""""
|
29
|
-
|
30
|
-
return self._parent_model
|
31
|
-
|
32
|
-
@functools.partial(oop.jax_tf.method_ro, jit=False)
|
33
|
-
def valid(self) -> jtp.Bool:
|
34
|
-
""""""
|
35
|
-
|
36
|
-
return jnp.array(self.parent_model is not None, dtype=bool)
|
37
|
-
|
38
|
-
@functools.partial(oop.jax_tf.method_ro, jit=False)
|
39
|
-
def index(self) -> jtp.Int:
|
40
|
-
""""""
|
41
|
-
|
42
|
-
return jnp.array(self.joint_description.index, dtype=int)
|
43
|
-
|
44
|
-
@functools.partial(oop.jax_tf.method_ro)
|
45
|
-
def dofs(self) -> jtp.Int:
|
46
|
-
""""""
|
47
|
-
|
48
|
-
return jnp.array(1, dtype=int)
|
49
|
-
|
50
|
-
@functools.partial(oop.jax_tf.method_ro, jit=False, vmap=False)
|
51
|
-
def name(self) -> str:
|
52
|
-
""""""
|
53
|
-
|
54
|
-
return self.joint_description.name
|
55
|
-
|
56
|
-
@functools.partial(oop.jax_tf.method_ro)
|
57
|
-
def position(self, dof: int | None = None) -> jtp.Float:
|
58
|
-
""""""
|
59
|
-
|
60
|
-
dof = dof if dof is not None else 0
|
61
|
-
|
62
|
-
return jnp.array(
|
63
|
-
self.parent_model.joint_positions(joint_names=(self.name(),))[dof],
|
64
|
-
dtype=float,
|
65
|
-
)
|
66
|
-
|
67
|
-
@functools.partial(oop.jax_tf.method_ro)
|
68
|
-
def velocity(self, dof: int | None = None) -> jtp.Float:
|
69
|
-
""""""
|
70
|
-
|
71
|
-
dof = dof if dof is not None else 0
|
72
|
-
|
73
|
-
return jnp.array(
|
74
|
-
self.parent_model.joint_velocities(joint_names=(self.name(),))[dof],
|
75
|
-
dtype=float,
|
76
|
-
)
|
77
|
-
|
78
|
-
@functools.partial(oop.jax_tf.method_ro)
|
79
|
-
def force_target(self, dof: int | None = None) -> jtp.Float:
|
80
|
-
""""""
|
81
|
-
|
82
|
-
dof = dof if dof is not None else 0
|
83
|
-
|
84
|
-
return jnp.array(
|
85
|
-
self.parent_model.joint_generalized_forces_targets(
|
86
|
-
joint_names=(self.name(),)
|
87
|
-
)[dof],
|
88
|
-
dtype=float,
|
89
|
-
)
|
90
|
-
|
91
|
-
@functools.partial(oop.jax_tf.method_ro)
|
92
|
-
def position_limit(self, dof: int | None = None) -> tuple[jtp.Float, jtp.Float]:
|
93
|
-
""""""
|
94
|
-
|
95
|
-
dof = dof if dof is not None else 0
|
96
|
-
|
97
|
-
if not_tracing(dof) and dof != 0:
|
98
|
-
msg = "Only joints with 1 DoF are currently supported"
|
99
|
-
raise ValueError(msg)
|
100
|
-
|
101
|
-
low, high = self.joint_description.position_limit
|
102
|
-
|
103
|
-
return jnp.array(low, dtype=float), jnp.array(high, dtype=float)
|
104
|
-
|
105
|
-
# =============
|
106
|
-
# Motor methods
|
107
|
-
# =============
|
108
|
-
@functools.partial(oop.jax_tf.method_ro)
|
109
|
-
def motor_inertia(self) -> jtp.Vector:
|
110
|
-
""""""
|
111
|
-
|
112
|
-
return jnp.array(self.joint_description.motor_inertia, dtype=float)
|
113
|
-
|
114
|
-
@functools.partial(oop.jax_tf.method_ro)
|
115
|
-
def motor_gear_ratio(self) -> jtp.Vector:
|
116
|
-
""""""
|
117
|
-
|
118
|
-
return jnp.array(self.joint_description.motor_gear_ratio, dtype=float)
|
119
|
-
|
120
|
-
@functools.partial(oop.jax_tf.method_ro)
|
121
|
-
def motor_viscous_friction(self) -> jtp.Vector:
|
122
|
-
""""""
|
123
|
-
|
124
|
-
return jnp.array(self.joint_description.motor_viscous_friction, dtype=float)
|
125
|
-
|
126
|
-
# =================
|
127
|
-
# Multi-DoF methods
|
128
|
-
# =================
|
129
|
-
|
130
|
-
@functools.partial(oop.jax_tf.method_ro)
|
131
|
-
def joint_position(self) -> jtp.Vector:
|
132
|
-
""""""
|
133
|
-
|
134
|
-
return self.parent_model.joint_positions(joint_names=(self.name(),))
|
135
|
-
|
136
|
-
@functools.partial(oop.jax_tf.method_ro)
|
137
|
-
def joint_velocity(self) -> jtp.Vector:
|
138
|
-
""""""
|
139
|
-
|
140
|
-
return self.parent_model.joint_velocities(joint_names=(self.name(),))
|
141
|
-
|
142
|
-
@functools.partial(oop.jax_tf.method_ro)
|
143
|
-
def joint_force_target(self) -> jtp.Vector:
|
144
|
-
""""""
|
145
|
-
|
146
|
-
return self.parent_model.joint_generalized_forces_targets(
|
147
|
-
joint_names=(self.name(),)
|
148
|
-
)
|