jaxsim 0.6.2.dev2__tar.gz → 0.6.2.dev105__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 (144) hide show
  1. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.github/workflows/ci_cd.yml +6 -6
  2. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/PKG-INFO +6 -8
  3. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/README.md +5 -7
  4. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/guide/configuration.rst +1 -1
  5. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/jaxsim_as_multibody_dynamics_library.ipynb +9 -53
  6. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/jaxsim_as_physics_engine.ipynb +6 -8
  7. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/jaxsim_as_physics_engine_advanced.ipynb +7 -99
  8. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/jaxsim_for_robot_controllers.ipynb +11 -20
  9. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/__init__.py +1 -1
  10. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/_version.py +2 -2
  11. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/__init__.py +3 -1
  12. jaxsim-0.6.2.dev105/src/jaxsim/api/actuation_model.py +96 -0
  13. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/com.py +8 -8
  14. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/contact.py +15 -255
  15. jaxsim-0.6.2.dev105/src/jaxsim/api/contact_model.py +101 -0
  16. jaxsim-0.6.2.dev105/src/jaxsim/api/data.py +627 -0
  17. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/frame.py +7 -7
  18. jaxsim-0.6.2.dev105/src/jaxsim/api/integrators.py +76 -0
  19. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/kin_dyn_parameters.py +41 -58
  20. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/link.py +7 -7
  21. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/model.py +190 -453
  22. jaxsim-0.6.2.dev105/src/jaxsim/api/ode.py +171 -0
  23. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/references.py +2 -2
  24. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/exceptions.py +2 -2
  25. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/__init__.py +4 -3
  26. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/joint_model.py +17 -107
  27. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/mujoco/model.py +1 -1
  28. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/mujoco/utils.py +2 -2
  29. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/kinematic_graph.py +1 -3
  30. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/rbda/aba.py +7 -4
  31. jaxsim-0.6.2.dev105/src/jaxsim/rbda/collidable_points.py +65 -0
  32. jaxsim-0.6.2.dev105/src/jaxsim/rbda/contacts/__init__.py +5 -0
  33. jaxsim-0.6.2.dev105/src/jaxsim/rbda/contacts/common.py +175 -0
  34. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/rbda/contacts/relaxed_rigid.py +156 -11
  35. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/rbda/crba.py +5 -2
  36. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/rbda/forward_kinematics.py +37 -12
  37. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/rbda/jacobian.py +15 -6
  38. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/rbda/rnea.py +7 -4
  39. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/rbda/utils.py +3 -3
  40. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/utils/jaxsim_dataclass.py +5 -1
  41. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim.egg-info/PKG-INFO +6 -8
  42. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim.egg-info/SOURCES.txt +3 -8
  43. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/conftest.py +3 -0
  44. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_api_contact.py +8 -8
  45. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_api_data.py +12 -54
  46. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_api_frame.py +14 -14
  47. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_api_link.py +15 -15
  48. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_api_model.py +29 -34
  49. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_automatic_differentiation.py +49 -98
  50. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_contact.py +1 -1
  51. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_pytree.py +1 -1
  52. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_simulations.py +27 -205
  53. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/utils_idyntree.py +7 -7
  54. jaxsim-0.6.2.dev2/src/jaxsim/api/data.py +0 -925
  55. jaxsim-0.6.2.dev2/src/jaxsim/api/ode.py +0 -475
  56. jaxsim-0.6.2.dev2/src/jaxsim/api/ode_data.py +0 -401
  57. jaxsim-0.6.2.dev2/src/jaxsim/integrators/__init__.py +0 -2
  58. jaxsim-0.6.2.dev2/src/jaxsim/integrators/common.py +0 -592
  59. jaxsim-0.6.2.dev2/src/jaxsim/integrators/fixed_step.py +0 -153
  60. jaxsim-0.6.2.dev2/src/jaxsim/integrators/variable_step.py +0 -706
  61. jaxsim-0.6.2.dev2/src/jaxsim/rbda/collidable_points.py +0 -156
  62. jaxsim-0.6.2.dev2/src/jaxsim/rbda/contacts/__init__.py +0 -13
  63. jaxsim-0.6.2.dev2/src/jaxsim/rbda/contacts/common.py +0 -313
  64. jaxsim-0.6.2.dev2/src/jaxsim/rbda/contacts/rigid.py +0 -462
  65. jaxsim-0.6.2.dev2/src/jaxsim/rbda/contacts/soft.py +0 -480
  66. jaxsim-0.6.2.dev2/src/jaxsim/rbda/contacts/visco_elastic.py +0 -1066
  67. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.devcontainer/Dockerfile +0 -0
  68. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.devcontainer/devcontainer.json +0 -0
  69. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.gitattributes +0 -0
  70. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.github/CODEOWNERS +0 -0
  71. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.github/dependabot.yml +0 -0
  72. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.github/workflows/pixi.yml +0 -0
  73. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.github/workflows/read_the_docs.yml +0 -0
  74. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.gitignore +0 -0
  75. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.pre-commit-config.yaml +0 -0
  76. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/.readthedocs.yaml +0 -0
  77. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/CONTRIBUTING.md +0 -0
  78. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/LICENSE +0 -0
  79. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/Makefile +0 -0
  80. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/conf.py +0 -0
  81. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/examples.rst +0 -0
  82. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/guide/install.rst +0 -0
  83. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/index.rst +0 -0
  84. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/make.bat +0 -0
  85. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/modules/api.rst +0 -0
  86. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/modules/integrators.rst +0 -0
  87. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/modules/math.rst +0 -0
  88. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/modules/mujoco.rst +0 -0
  89. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/modules/parsers.rst +0 -0
  90. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/modules/rbda.rst +0 -0
  91. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/modules/typing.rst +0 -0
  92. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/docs/modules/utils.rst +0 -0
  93. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/environment.yml +0 -0
  94. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/.gitattributes +0 -0
  95. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/.gitignore +0 -0
  96. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/README.md +0 -0
  97. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/assets/build_cartpole_urdf.py +0 -0
  98. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/examples/assets/cartpole.urdf +0 -0
  99. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/pixi.lock +0 -0
  100. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/pyproject.toml +0 -0
  101. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/setup.cfg +0 -0
  102. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/setup.py +0 -0
  103. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/common.py +0 -0
  104. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/api/joint.py +0 -0
  105. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/logging.py +0 -0
  106. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/adjoint.py +0 -0
  107. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/cross.py +0 -0
  108. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/inertia.py +0 -0
  109. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/quaternion.py +0 -0
  110. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/rotation.py +0 -0
  111. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/skew.py +0 -0
  112. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/transform.py +0 -0
  113. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/math/utils.py +0 -0
  114. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/mujoco/__init__.py +0 -0
  115. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/mujoco/__main__.py +0 -0
  116. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/mujoco/loaders.py +0 -0
  117. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/mujoco/visualizer.py +0 -0
  118. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/__init__.py +0 -0
  119. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/descriptions/__init__.py +0 -0
  120. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/descriptions/collision.py +0 -0
  121. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/descriptions/joint.py +0 -0
  122. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/descriptions/link.py +0 -0
  123. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/descriptions/model.py +0 -0
  124. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/rod/__init__.py +0 -0
  125. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/rod/meshes.py +0 -0
  126. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/rod/parser.py +0 -0
  127. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/parsers/rod/utils.py +0 -0
  128. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/rbda/__init__.py +0 -0
  129. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/terrain/__init__.py +0 -0
  130. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/terrain/terrain.py +0 -0
  131. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/typing.py +0 -0
  132. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/utils/__init__.py +0 -0
  133. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/utils/tracing.py +0 -0
  134. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim/utils/wrappers.py +0 -0
  135. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim.egg-info/dependency_links.txt +0 -0
  136. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim.egg-info/requires.txt +0 -0
  137. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/src/jaxsim.egg-info/top_level.txt +0 -0
  138. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/__init__.py +0 -0
  139. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_api_com.py +0 -0
  140. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_api_joint.py +0 -0
  141. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_benchmark.py +0 -0
  142. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_exceptions.py +0 -0
  143. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_meshes.py +0 -0
  144. {jaxsim-0.6.2.dev2 → jaxsim-0.6.2.dev105}/tests/test_visualizer.py +0 -0
@@ -16,7 +16,7 @@ jobs:
16
16
 
17
17
  package:
18
18
  name: Package the project
19
- runs-on: ubuntu-22.04
19
+ runs-on: ubuntu-latest
20
20
 
21
21
  steps:
22
22
 
@@ -58,7 +58,7 @@ jobs:
58
58
  fail-fast: false
59
59
  matrix:
60
60
  os:
61
- - ubuntu-22.04
61
+ - ubuntu-latest
62
62
  - macos-latest
63
63
  - windows-latest
64
64
  python:
@@ -124,11 +124,11 @@ jobs:
124
124
  steps.changes.outputs.all == 'true')
125
125
  run: |
126
126
  sudo apt-get update
127
- sudo apt-get install lsb-release wget gnupg
128
- sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
127
+ sudo apt-get install lsb-release gnupg
128
+ sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
129
129
  echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
130
130
  sudo apt-get update
131
- sudo apt-get install --no-install-recommends libsdformat13 gz-tools2
131
+ sudo apt-get install gz-ionic sdf
132
132
 
133
133
  - name: Run the Python tests
134
134
  if: |
@@ -144,7 +144,7 @@ jobs:
144
144
  publish:
145
145
  name: Publish to PyPI
146
146
  needs: test
147
- runs-on: ubuntu-22.04
147
+ runs-on: ubuntu-latest
148
148
  permissions:
149
149
  id-token: write
150
150
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jaxsim
3
- Version: 0.6.2.dev2
3
+ Version: 0.6.2.dev105
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>
@@ -98,9 +98,8 @@ Requires-Dist: jaxsim[style,testing,viz]; extra == "all"
98
98
  <br/>
99
99
  <table>
100
100
  <tr>
101
- <th><img src="https://github.com/user-attachments/assets/115b1c1c-6ae5-4c59-92e0-1be13ba954db" width="250"></th>
102
- <th><img src="https://github.com/user-attachments/assets/f9661fae-9a85-41dd-9a58-218758ec8c9c" width="250"></th>
103
- <th><img src="https://github.com/user-attachments/assets/ae8adadf-3bca-47b8-97ca-3a9273633d60" width="250"></th>
101
+ <th><img src="https://github.com/user-attachments/assets/f9661fae-9a85-41dd-9a58-218758ec8c9c" width="500"></th>
102
+ <th><img src="https://github.com/user-attachments/assets/62b88b9d-45ea-4d22-99d2-f24fc842dd29" width="500"></th>
104
103
  </tr>
105
104
  </table>
106
105
  <br/>
@@ -143,15 +142,14 @@ model = js.model.reduce(model=full_model, considered_joints=joints)
143
142
 
144
143
  ndof = model.dofs()
145
144
  # Initialize data and simulation
146
- data = js.data.JaxSimModelData.zero(model=model).reset_base_position(
147
- base_position=jnp.array([0.0, 0.0, 1.0])
148
- )
145
+ # Note that the default data representation is mixed velocity representation
146
+ data = js.data.JaxSimModelData.build(model=model,base_position=jnp.array([0.0, 0.0, 1.0]))
149
147
  T = jnp.arange(start=0, stop=1.0, step=model.time_step)
150
148
  tau = jnp.zeros(ndof)
151
149
 
152
150
  # Simulate
153
151
  for t in T:
154
- data, _ = js.model.step(model=model, data=data, link_forces=None, joint_force_references=tau)
152
+ data = js.model.step(model=model, data=data, link_forces=None, joint_force_references=tau)
155
153
 
156
154
  ```
157
155
 
@@ -6,9 +6,8 @@
6
6
  <br/>
7
7
  <table>
8
8
  <tr>
9
- <th><img src="https://github.com/user-attachments/assets/115b1c1c-6ae5-4c59-92e0-1be13ba954db" width="250"></th>
10
- <th><img src="https://github.com/user-attachments/assets/f9661fae-9a85-41dd-9a58-218758ec8c9c" width="250"></th>
11
- <th><img src="https://github.com/user-attachments/assets/ae8adadf-3bca-47b8-97ca-3a9273633d60" width="250"></th>
9
+ <th><img src="https://github.com/user-attachments/assets/f9661fae-9a85-41dd-9a58-218758ec8c9c" width="500"></th>
10
+ <th><img src="https://github.com/user-attachments/assets/62b88b9d-45ea-4d22-99d2-f24fc842dd29" width="500"></th>
12
11
  </tr>
13
12
  </table>
14
13
  <br/>
@@ -51,15 +50,14 @@ model = js.model.reduce(model=full_model, considered_joints=joints)
51
50
 
52
51
  ndof = model.dofs()
53
52
  # Initialize data and simulation
54
- data = js.data.JaxSimModelData.zero(model=model).reset_base_position(
55
- base_position=jnp.array([0.0, 0.0, 1.0])
56
- )
53
+ # Note that the default data representation is mixed velocity representation
54
+ data = js.data.JaxSimModelData.build(model=model,base_position=jnp.array([0.0, 0.0, 1.0]))
57
55
  T = jnp.arange(start=0, stop=1.0, step=model.time_step)
58
56
  tau = jnp.zeros(ndof)
59
57
 
60
58
  # Simulate
61
59
  for t in T:
62
- data, _ = js.model.step(model=model, data=data, link_forces=None, joint_force_references=tau)
60
+ data = js.model.step(model=model, data=data, link_forces=None, joint_force_references=tau)
63
61
 
64
62
  ```
65
63
 
@@ -61,7 +61,7 @@ The logging and exceptions configurations is controlled by the following environ
61
61
 
62
62
  *Default:* ``DEBUG`` for development, ``WARNING`` for production.
63
63
 
64
- - ``JAXSIM_DISABLE_EXCEPTIONS``: Disables the runtime checks and exceptions.
64
+ - ``JAXSIM_ENABLE_EXCEPTIONS``: Enables the runtime checks and exceptions. Note that enabling exceptions might lead to device-to-host transfer of data, increasing the computational time required.
65
65
 
66
66
  *Default:* ``False``.
67
67
 
@@ -261,8 +261,8 @@
261
261
  "data = js.data.random_model_data(model=model)\n",
262
262
  "\n",
263
263
  "# Print the default state.\n",
264
- "W_H_B, s = data.generalized_position()\n",
265
- "ν = data.generalized_velocity()\n",
264
+ "W_H_B, s = data.generalized_position\n",
265
+ "ν = data.generalized_velocity\n",
266
266
  "\n",
267
267
  "print(f\"W_H_B: shape={W_H_B.shape}\\n{W_H_B}\\n\")\n",
268
268
  "print(f\"s: shape={s.shape}\\n{s}\\n\")\n",
@@ -365,12 +365,6 @@
365
365
  "# Compute its pose w.r.t. the world frame through forward kinematics.\n",
366
366
  "W_H_L = js.link.transform(model=model, data=data, link_index=link_index)\n",
367
367
  "\n",
368
- "# Alternatively, the same transform can be extracted from the tensor of\n",
369
- "# all link transforms.\n",
370
- "assert jnp.allclose(\n",
371
- " W_H_L, js.model.forward_kinematics(model=model, data=data)[link_index]\n",
372
- ")\n",
373
- "\n",
374
368
  "print(f\"Transform of '{link_name}': shape={W_H_L.shape}\\n{W_H_L}\")"
375
369
  ]
376
370
  },
@@ -406,7 +400,7 @@
406
400
  "with data.switch_velocity_representation(VelRepr.Body):\n",
407
401
  "\n",
408
402
  " # Body-fixed generalized velocity.\n",
409
- " B_ν = data.generalized_velocity()\n",
403
+ " B_ν = data.generalized_velocity\n",
410
404
  "\n",
411
405
  " # Free-floating Jacobian accepting a body-fixed generalized velocity and\n",
412
406
  " # returning an inertial-fixed link velocity.\n",
@@ -479,7 +473,7 @@
479
473
  "with data.switch_velocity_representation(VelRepr.Body):\n",
480
474
  "\n",
481
475
  " # Body-fixed generalized velocity.\n",
482
- " B_ν = data.generalized_velocity()\n",
476
+ " B_ν = data.generalized_velocity\n",
483
477
  "\n",
484
478
  " # Free-floating Jacobian accepting a body-fixed generalized velocity and\n",
485
479
  " # returning an inertial-fixed link velocity.\n",
@@ -782,12 +776,11 @@
782
776
  ")\n",
783
777
  "\n",
784
778
  "# Compute the 3D gravity vector and the total mass of the robot.\n",
785
- "W_g = data.gravity\n",
786
779
  "m = js.model.total_mass(model=model)\n",
787
780
  "\n",
788
781
  "# The centroidal dynamics can be computed as follows.\n",
789
782
  "G_ḣ = 0\n",
790
- "G_ḣ += m * jnp.hstack([W_g, jnp.zeros(3)])\n",
783
+ "G_ḣ += m * jnp.hstack([0, 0, model.gravity, 0, 0, 0])\n",
791
784
  "G_ḣ += jnp.einsum(\"c66,c6->6\", G_Xf_C, jnp.hstack([C_fl, jnp.zeros_like(C_fl)]))\n",
792
785
  "print(f\"G_ḣ: shape={G_ḣ.shape}\")"
793
786
  ]
@@ -839,7 +832,7 @@
839
832
  "):\n",
840
833
  "\n",
841
834
  " # Compute the mixed generalized velocity.\n",
842
- " BW_ν = data.generalized_velocity()\n",
835
+ " BW_ν = data.generalized_velocity\n",
843
836
  "\n",
844
837
  " # Compute the mixed generalized acceleration.\n",
845
838
  " BW_ν̇ = jnp.hstack(\n",
@@ -876,44 +869,7 @@
876
869
  "W_p̈_C = 0\n",
877
870
  "W_p̈_C += jnp.einsum(\"c3g,g->c3\", J̇l_WC, BW_ν)\n",
878
871
  "W_p̈_C += jnp.einsum(\"c3g,g->c3\", Jl_WC, BW_ν̇)\n",
879
- "print(f\"W_p̈_C: shape={W_p̈_C.shape}\")\n"
880
- ]
881
- },
882
- {
883
- "cell_type": "markdown",
884
- "metadata": {
885
- "id": "rrSfxp8lh9YZ"
886
- },
887
- "source": [
888
- "### Contact Forces\n",
889
- "\n",
890
- "To conclude, JaxSim also provides different contact models to compute the contact forces. However, these forces are mainly related to the usage of JaxSim as a simulator rather than as a multibody dynamics library. This use case is shown in more details in other examples.\n",
891
- "\n",
892
- "Here below we report the function to call to compute the contact forces using the default contact model stored in the `JaxSimModel`."
893
- ]
894
- },
895
- {
896
- "cell_type": "code",
897
- "execution_count": null,
898
- "metadata": {
899
- "colab": {
900
- "base_uri": "https://localhost:8080/"
901
- },
902
- "id": "Ot6HePB_twaE",
903
- "outputId": "02a6abae-257e-45ee-e9de-6a607cdbeb9a"
904
- },
905
- "outputs": [],
906
- "source": [
907
- "print(f\"Active contact model: {type(model.contact_model)}\\n\")\n",
908
- "\n",
909
- "# Compute the contact forces.\n",
910
- "W_f_C = js.contact.collidable_point_forces(\n",
911
- " model=model,\n",
912
- " data=data,\n",
913
- " link_forces=references.link_forces(model=model, data=data),\n",
914
- " joint_force_references=references.joint_force_references(model=model),\n",
915
- ")\n",
916
- "print(f\"W_f_C: shape={W_f_C.shape}\")"
872
+ "print(f\"W_p̈_C: shape={W_p̈_C.shape}\")"
917
873
  ]
918
874
  },
919
875
  {
@@ -944,7 +900,7 @@
944
900
  "toc_visible": true
945
901
  },
946
902
  "kernelspec": {
947
- "display_name": "Python 3 (ipykernel)",
903
+ "display_name": "comodo_jaxsim",
948
904
  "language": "python",
949
905
  "name": "python3"
950
906
  },
@@ -958,7 +914,7 @@
958
914
  "name": "python",
959
915
  "nbconvert_exporter": "python",
960
916
  "pygments_lexer": "ipython3",
961
- "version": "3.10.15"
917
+ "version": "3.12.8"
962
918
  }
963
919
  },
964
920
  "nbformat": 4,
@@ -52,6 +52,7 @@
52
52
  "# Set environment variable to avoid GPU out of memory errors\n",
53
53
  "%env XLA_PYTHON_CLIENT_MEM_PREALLOCATE=false\n",
54
54
  "\n",
55
+ "\n",
55
56
  "# ================\n",
56
57
  "# Notebook imports\n",
57
58
  "# ================\n",
@@ -148,9 +149,7 @@
148
149
  "outputs": [],
149
150
  "source": [
150
151
  "# Create the data of a single model.\n",
151
- "data_zero = js.data.JaxSimModelData.zero(model=model)\n",
152
- "base_position = jnp.array([0.0, 0.0, 1.0])\n",
153
- "data = data_zero.reset_base_position(base_position=base_position) # Note that the reset position returns the updated data object"
152
+ "data = js.data.JaxSimModelData.build(model=model, base_position=jnp.array([0.0, 0.0, 1.0]))"
154
153
  ]
155
154
  },
156
155
  {
@@ -175,7 +174,7 @@
175
174
  "\n",
176
175
  "# Simulate\n",
177
176
  "for _t in T:\n",
178
- " data, _ = js.model.step(\n",
177
+ " data = js.model.step(\n",
179
178
  " model=model,\n",
180
179
  " data=data,\n",
181
180
  " link_forces=None,\n",
@@ -234,12 +233,11 @@
234
233
  "# Then we have to create the vector of initial state\n",
235
234
  "batch_size = 5\n",
236
235
  "data_batch_t0 = jax.vmap(\n",
237
- " lambda pos: data_zero.reset_base_position(base_position=pos)\n",
238
- ")(jnp.tile(jnp.array([0.0, 0.0, 1.0]), (batch_size, 1)))\n",
236
+ " lambda pos: js.data.JaxSimModelData.build(model=model, base_position=pos))(jnp.tile(jnp.array([0.0, 0.0, 1.0]), (batch_size, 1)))\n",
239
237
  "\n",
240
238
  "data = data_batch_t0\n",
241
239
  "for _t in T:\n",
242
- " data, _ = step_parallel(model, data)"
240
+ " data = step_parallel(model, data)"
243
241
  ]
244
242
  }
245
243
  ],
@@ -266,7 +264,7 @@
266
264
  "name": "python",
267
265
  "nbconvert_exporter": "python",
268
266
  "pygments_lexer": "ipython3",
269
- "version": "3.13.0"
267
+ "version": "3.13.1"
270
268
  }
271
269
  },
272
270
  "nbformat": 4,
@@ -61,9 +61,9 @@
61
61
  "import os\n",
62
62
  "\n",
63
63
  "import jax\n",
64
+ "\n",
64
65
  "import jax.numpy as jnp\n",
65
66
  "import jaxsim.api as js\n",
66
- "import jaxsim\n",
67
67
  "import rod\n",
68
68
  "from jaxsim import logging\n",
69
69
  "from rod.builder.primitives import SphereBuilder\n",
@@ -163,7 +163,6 @@
163
163
  "model = js.model.JaxSimModel.build_from_model_description(\n",
164
164
  " model_description=model_sdf_string,\n",
165
165
  " time_step=0.001,\n",
166
- " integrator=jaxsim.integrators.fixed_step.Heun2,\n",
167
166
  ")\n",
168
167
  "\n",
169
168
  "# Create the data of a single model.\n",
@@ -171,76 +170,6 @@
171
170
  "data_single = js.data.JaxSimModelData.zero(model=model)"
172
171
  ]
173
172
  },
174
- {
175
- "cell_type": "markdown",
176
- "metadata": {
177
- "id": "FJF-HoWaiK9J"
178
- },
179
- "source": [
180
- "### Select the contact model\n",
181
- "\n",
182
- "JaxSim offers several contact models, with the default being the non-linear Hunt/Crossley soft contact model. This model supports stick/slip transitions and fully accounts for friction cones.\n",
183
- "\n",
184
- "While it is faster than other models, it requires careful parameter tuning and may need a small time step $\\Delta t$, unless a variable-step integrator is used.\n",
185
- "\n"
186
- ]
187
- },
188
- {
189
- "cell_type": "code",
190
- "execution_count": null,
191
- "metadata": {
192
- "id": "VAaitHRKjnwc"
193
- },
194
- "outputs": [],
195
- "source": [
196
- "import jaxsim\n",
197
- "\n",
198
- "# Operate on a copy of the model.\n",
199
- "# When validate=True, this context manager ensures that the PyTree structure\n",
200
- "# of the object is not altered. This is a nice feature of JaxSim to spot\n",
201
- "# earlier user logic that might trigger unwanted JIT recompilations.\n",
202
- "# In this case, we need to disable validation since PyTree structure might\n",
203
- "# change if you use a contact model different from the default.\n",
204
- "with model.editable(validate=False) as model:\n",
205
- "\n",
206
- " # The SoftContacts class can be replaced with a different contact model.\n",
207
- " model.contact_model = jaxsim.rbda.contacts.SoftContacts.build()\n",
208
- "\n",
209
- "# JaxSim provides the following helper that estimates good contact\n",
210
- "# parameters. While they might not be optimal, usually are a good\n",
211
- "# starting point. Users are encouraged to fine-tune them.\n",
212
- "contacts_params = js.contact.estimate_good_contact_parameters(\n",
213
- " model=model,\n",
214
- " number_of_active_collidable_points_steady_state=4,\n",
215
- " max_penetration=0.001,\n",
216
- ")\n",
217
- "\n",
218
- "# Print the contact parameters.\n",
219
- "# Note that these parameters are the nominal parameters shared among\n",
220
- "# all parallel instances. If needed, they can be overridden in the\n",
221
- "# vectorized data object that will be created later.\n",
222
- "print(contacts_params)\n",
223
- "\n",
224
- "# Update the data object with the new contact model parameters.\n",
225
- "data_single = data_single.replace(contacts_params=contacts_params, validate=False)"
226
- ]
227
- },
228
- {
229
- "cell_type": "markdown",
230
- "metadata": {
231
- "id": "6REY2bq3lc_k"
232
- },
233
- "source": [
234
- "### Select the integrator\n",
235
- "\n",
236
- "JaxSim offers various integrators, ranging from basic ones like `ForwardEuler` to higher-order methods like `RungeKutta4`. You can explore the available integrators in the following modules:\n",
237
- "\n",
238
- "- `jaxsim.integrators.fixed_step`\n",
239
- "- `jaxsim.integrators.variable_step`\n",
240
- "\n",
241
- "The `*SO3` variants update the integration scheme by integrating more accurately the base orientation on the $\\text{SO}(3)$ manifold."
242
- ]
243
- },
244
173
  {
245
174
  "cell_type": "code",
246
175
  "execution_count": null,
@@ -249,7 +178,6 @@
249
178
  },
250
179
  "outputs": [],
251
180
  "source": [
252
- "print(f\"Using integrator: {model.integrator}\")\n",
253
181
  "\n",
254
182
  "# Initialize the simulated time.\n",
255
183
  "T = jnp.arange(start=0, stop=1.0, step=model.time_step)"
@@ -295,11 +223,10 @@
295
223
  " base_pos_bounds=([0, 0, 0.3], [0, 0, 0.6]),\n",
296
224
  " base_vel_lin_bounds=(0, 0),\n",
297
225
  " base_vel_ang_bounds=(0, 0),\n",
298
- " contacts_params=contacts_params,\n",
299
226
  " )\n",
300
227
  ")(jnp.vstack(subkeys))\n",
301
228
  "\n",
302
- "print(\"W_p_B(t0)=\\n\", data_batch_t0.base_position()[0:10])"
229
+ "print(\"W_p_B(t0)=\\n\", data_batch_t0.base_position[0:10])"
303
230
  ]
304
231
  },
305
232
  {
@@ -373,7 +300,7 @@
373
300
  "\n",
374
301
  "for _ in T:\n",
375
302
  "\n",
376
- " data, _ = step_parallel(model, data)\n",
303
+ " data = step_parallel(model, data)\n",
377
304
  " data_trajectory_list.append(data)"
378
305
  ]
379
306
  },
@@ -398,7 +325,7 @@
398
325
  "# This operation is called 'tree transpose' in JAX.\n",
399
326
  "data_trajectory = jax.tree.map(lambda *leafs: jnp.stack(leafs), *data_trajectory_list)\n",
400
327
  "\n",
401
- "print(f\"W_p_B: shape={data_trajectory.base_position().shape}\")"
328
+ "print(f\"W_p_B: shape={data_trajectory.base_position.shape}\")"
402
329
  ]
403
330
  },
404
331
  {
@@ -412,7 +339,7 @@
412
339
  "import matplotlib.pyplot as plt\n",
413
340
  "\n",
414
341
  "\n",
415
- "plt.plot(T, data_trajectory.base_position()[:, 0:5, 2])\n",
342
+ "plt.plot(T, data_trajectory.base_position[:, 0:5, 2])\n",
416
343
  "plt.grid(True)\n",
417
344
  "plt.xlabel(\"Time [s]\")\n",
418
345
  "plt.ylabel(\"Height [m]\")\n",
@@ -420,25 +347,6 @@
420
347
  "plt.show()"
421
348
  ]
422
349
  },
423
- {
424
- "cell_type": "markdown",
425
- "metadata": {
426
- "id": "N92-WjPFGuua"
427
- },
428
- "source": [
429
- "# Conclusions\n",
430
- "\n",
431
- "This notebook introduced the key APIs of JaxSim as a hardware-accelerated parallel physics engine. Key takeaways:\n",
432
- "\n",
433
- "- **Contact models**: trajectories are sensitive to the contact model used. Explore the `jaxsim.rbda.contacts` package to find the best fit, as each model comes with trade-offs.\n",
434
- "- **Integrator selection**: the choice of integrator affects both accuracy and speed. Experiment with options in the `jaxsim.integrators` package to optimize for your application and hardware accelerator.\n",
435
- "- **Time step**: the interaction between contact models and integrators depends on the integration step $\\Delta t$. Choose the largest stable time step that guarantees for stable simulations.\n",
436
- "- **Automatic vectorization**: this notebook demonstrated one way to use `jax.vmap`, but there are many other approaches. As you become more familiar with JAX, you'll discover better methods tailored to your needs.\n",
437
- "- **Advanced applications**: Combine `jax.jit` and `jax.vmap` with `jax.grad`, `jax.jacfwd`, and `jax.jacrev` for gradient-based learning and other advanced tasks (not covered here).\n",
438
- "\n",
439
- "Have fun!"
440
- ]
441
- },
442
350
  {
443
351
  "cell_type": "markdown",
444
352
  "metadata": {},
@@ -454,7 +362,7 @@
454
362
  "toc_visible": true
455
363
  },
456
364
  "kernelspec": {
457
- "display_name": "rsl",
365
+ "display_name": "comodo_jaxsim",
458
366
  "language": "python",
459
367
  "name": "python3"
460
368
  },
@@ -468,7 +376,7 @@
468
376
  "name": "python",
469
377
  "nbconvert_exporter": "python",
470
378
  "pygments_lexer": "ipython3",
471
- "version": "3.12.7"
379
+ "version": "3.12.8"
472
380
  }
473
381
  },
474
382
  "nbformat": 4,
@@ -239,13 +239,12 @@
239
239
  ")\n",
240
240
  "\n",
241
241
  "# Reset the state to the random joint positions.\n",
242
- "data = data_zero.reset_joint_positions(positions=random_joint_positions)\n",
243
- "\n",
242
+ "data = js.data.JaxSimModelData.build(model=model, joint_positions=random_joint_positions)\n",
244
243
  "\n",
245
244
  "for _ in T:\n",
246
245
  "\n",
247
246
  " # Step the JaxSim simulation.\n",
248
- " data, _ = js.model.step(\n",
247
+ " data = js.model.step(\n",
249
248
  " model=model,\n",
250
249
  " data=data,\n",
251
250
  " joint_force_references=None,\n",
@@ -254,7 +253,7 @@
254
253
  "\n",
255
254
  " # Update the MuJoCo data.\n",
256
255
  " mj_model_helper.set_joint_positions(\n",
257
- " positions=data.joint_positions(), joint_names=model.joint_names()\n",
256
+ " positions=data.joint_positions, joint_names=model.joint_names()\n",
258
257
  " )\n",
259
258
  "\n",
260
259
  " # Record a new video frame.\n",
@@ -343,8 +342,8 @@
343
342
  " Mss = js.model.free_floating_mass_matrix(model=model, data=data)[6:, 6:]\n",
344
343
  "\n",
345
344
  " # Get the current joint positions and velocities.\n",
346
- " s = data.joint_positions()\n",
347
- " ṡ = data.joint_velocities()\n",
345
+ " s = data.joint_positions\n",
346
+ " ṡ = data.joint_velocities\n",
348
347
  "\n",
349
348
  " # Compute the actuated joint torques.\n",
350
349
  " s_star = -kp * (s - s_des) - kd * (ṡ - s_dot_des)\n",
@@ -373,17 +372,9 @@
373
372
  "# @title Run the simulation\n",
374
373
  "\n",
375
374
  "# Initialize the data.\n",
376
- "# Set the joint positions.\n",
377
- "data = data_zero.reset_joint_positions(\n",
378
- " model=model,\n",
379
- " positions=jnp.array([-0.25, jnp.deg2rad(160)]),\n",
380
- ")\n",
381
375
  "\n",
382
- "# Set the joint velocities.\n",
383
- "data = data.reset_joint_velocities(\n",
384
- " model=model,\n",
385
- " velocities=jnp.array([3.00, jnp.deg2rad(10) / model.time_step]),\n",
386
- ")\n",
376
+ "# Set the joint positions.\n",
377
+ "data = js.data.JaxSimModelData.build(model=model, joint_positions=jnp.array([-0.25, jnp.deg2rad(160)]), joint_velocities=jnp.array([3.00, jnp.deg2rad(10) / model.time_step]))\n",
387
378
  "\n",
388
379
  "for _ in T:\n",
389
380
  "\n",
@@ -395,7 +386,7 @@
395
386
  " )\n",
396
387
  "\n",
397
388
  " # Step the JaxSim simulation.\n",
398
- " data, _ = js.model.step(\n",
389
+ " data = js.model.step(\n",
399
390
  " model=model,\n",
400
391
  " data=data,\n",
401
392
  " joint_force_references=τ,\n",
@@ -403,7 +394,7 @@
403
394
  "\n",
404
395
  " # Update the MuJoCo data.\n",
405
396
  " mj_model_helper.set_joint_positions(\n",
406
- " positions=data.joint_positions(), joint_names=model.joint_names()\n",
397
+ " positions=data.joint_positions, joint_names=model.joint_names()\n",
407
398
  " )\n",
408
399
  "\n",
409
400
  " # Record a new video frame.\n",
@@ -452,7 +443,7 @@
452
443
  "toc_visible": true
453
444
  },
454
445
  "kernelspec": {
455
- "display_name": "jaxsim",
446
+ "display_name": "comodo_jaxsim",
456
447
  "language": "python",
457
448
  "name": "python3"
458
449
  },
@@ -466,7 +457,7 @@
466
457
  "name": "python",
467
458
  "nbconvert_exporter": "python",
468
459
  "pygments_lexer": "ipython3",
469
- "version": "3.13.1"
460
+ "version": "3.12.8"
470
461
  }
471
462
  },
472
463
  "nbformat": 4,
@@ -114,5 +114,5 @@ del _get_default_logging_level
114
114
  del _is_editable
115
115
 
116
116
  from . import terrain # isort:skip
117
- from . import api, integrators, logging, math, rbda
117
+ from . import api, logging, math, rbda
118
118
  from .api.common import VelRepr
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.6.2.dev2'
16
- __version_tuple__ = version_tuple = (0, 6, 2, 'dev2')
15
+ __version__ = version = '0.6.2.dev105'
16
+ __version_tuple__ = version_tuple = (0, 6, 2, 'dev105')
@@ -1,13 +1,15 @@
1
1
  from . import common # isort:skip
2
2
  from . import model, data # isort:skip
3
3
  from . import (
4
+ actuation_model,
4
5
  com,
5
6
  contact,
7
+ contact_model,
6
8
  frame,
9
+ integrators,
7
10
  joint,
8
11
  kin_dyn_parameters,
9
12
  link,
10
13
  ode,
11
- ode_data,
12
14
  references,
13
15
  )