jaxsim 0.3.1.dev64__tar.gz → 0.3.1.dev113__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 (128) hide show
  1. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.gitignore +4 -0
  2. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.readthedocs.yaml +2 -2
  3. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/PKG-INFO +1 -1
  4. jaxsim-0.3.1.dev113/docs/conf.py +124 -0
  5. jaxsim-0.3.1.dev113/docs/examples.rst +46 -0
  6. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/index.rst +20 -9
  7. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/modules/api.rst +28 -0
  8. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/modules/rbda.rst +4 -24
  9. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/environment.yml +5 -0
  10. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/examples/PD_controller.ipynb +19 -18
  11. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/examples/Parallel_computing.ipynb +22 -22
  12. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/examples/README.md +3 -4
  13. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/pyproject.toml +11 -10
  14. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/__init__.py +5 -5
  15. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/_version.py +2 -2
  16. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/com.py +3 -4
  17. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/common.py +11 -11
  18. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/contact.py +11 -3
  19. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/data.py +3 -6
  20. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/frame.py +9 -10
  21. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/kin_dyn_parameters.py +25 -28
  22. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/link.py +12 -12
  23. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/model.py +47 -43
  24. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/ode.py +19 -12
  25. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/ode_data.py +11 -11
  26. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/integrators/common.py +17 -20
  27. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/integrators/fixed_step.py +10 -10
  28. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/integrators/variable_step.py +13 -13
  29. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/__init__.py +2 -1
  30. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/joint_model.py +2 -1
  31. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/quaternion.py +3 -9
  32. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/transform.py +2 -2
  33. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/mujoco/loaders.py +5 -5
  34. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/mujoco/model.py +6 -6
  35. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/mujoco/visualizer.py +3 -0
  36. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/descriptions/joint.py +1 -1
  37. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/descriptions/link.py +3 -4
  38. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/descriptions/model.py +1 -1
  39. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/kinematic_graph.py +38 -39
  40. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/rod/parser.py +14 -14
  41. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/rod/utils.py +9 -11
  42. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/aba.py +6 -12
  43. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/collidable_points.py +8 -7
  44. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/contacts/soft.py +29 -27
  45. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/crba.py +3 -3
  46. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/forward_kinematics.py +1 -1
  47. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/jacobian.py +8 -8
  48. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/rnea.py +3 -3
  49. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/utils.py +1 -1
  50. jaxsim-0.3.1.dev113/src/jaxsim/terrain/terrain.py +160 -0
  51. jaxsim-0.3.1.dev113/src/jaxsim/typing.py +39 -0
  52. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/utils/jaxsim_dataclass.py +4 -4
  53. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/utils/wrappers.py +5 -1
  54. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim.egg-info/PKG-INFO +1 -1
  55. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim.egg-info/SOURCES.txt +1 -1
  56. jaxsim-0.3.1.dev113/tests/__init__.py +0 -0
  57. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/conftest.py +3 -3
  58. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_api_data.py +2 -2
  59. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_api_model.py +5 -5
  60. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_automatic_differentiation.py +9 -9
  61. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/utils_idyntree.py +8 -8
  62. jaxsim-0.3.1.dev64/docs/conf.py +0 -74
  63. jaxsim-0.3.1.dev64/docs/modules/index.rst +0 -19
  64. jaxsim-0.3.1.dev64/src/jaxsim/parsers/__init__.py +0 -1
  65. jaxsim-0.3.1.dev64/src/jaxsim/terrain/terrain.py +0 -82
  66. jaxsim-0.3.1.dev64/src/jaxsim/typing.py +0 -42
  67. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.devcontainer/Dockerfile +0 -0
  68. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.devcontainer/devcontainer.json +0 -0
  69. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.gitattributes +0 -0
  70. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.github/CODEOWNERS +0 -0
  71. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.github/workflows/ci_cd.yml +0 -0
  72. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.github/workflows/read_the_docs.yml +0 -0
  73. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.github/workflows/style.yml +0 -0
  74. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/.pre-commit-config.yaml +0 -0
  75. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/CONTRIBUTING.md +0 -0
  76. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/LICENSE +0 -0
  77. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/README.md +0 -0
  78. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/Makefile +0 -0
  79. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/guide/install.rst +0 -0
  80. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/make.bat +0 -0
  81. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/modules/integrators.rst +0 -0
  82. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/modules/math.rst +0 -0
  83. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/modules/mujoco.rst +0 -0
  84. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/modules/parsers.rst +0 -0
  85. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/modules/typing.rst +0 -0
  86. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/docs/modules/utils.rst +0 -0
  87. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/examples/.gitattributes +0 -0
  88. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/examples/.gitignore +0 -0
  89. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/examples/assets/cartpole.urdf +0 -0
  90. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/pixi.lock +0 -0
  91. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/setup.cfg +0 -0
  92. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/setup.py +0 -0
  93. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/__init__.py +0 -0
  94. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/joint.py +0 -0
  95. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/api/references.py +0 -0
  96. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/exceptions.py +0 -0
  97. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/integrators/__init__.py +0 -0
  98. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/logging.py +0 -0
  99. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/adjoint.py +0 -0
  100. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/cross.py +0 -0
  101. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/inertia.py +0 -0
  102. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/rotation.py +0 -0
  103. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/math/skew.py +0 -0
  104. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/mujoco/__init__.py +0 -0
  105. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/mujoco/__main__.py +0 -0
  106. {jaxsim-0.3.1.dev64/src/jaxsim/rbda/contacts → jaxsim-0.3.1.dev113/src/jaxsim/parsers}/__init__.py +0 -0
  107. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/descriptions/__init__.py +0 -0
  108. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/descriptions/collision.py +0 -0
  109. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/parsers/rod/__init__.py +0 -0
  110. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/__init__.py +0 -0
  111. {jaxsim-0.3.1.dev64/tests → jaxsim-0.3.1.dev113/src/jaxsim/rbda/contacts}/__init__.py +0 -0
  112. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/rbda/contacts/common.py +0 -0
  113. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/terrain/__init__.py +0 -0
  114. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/utils/__init__.py +0 -0
  115. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim/utils/tracing.py +0 -0
  116. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim.egg-info/dependency_links.txt +0 -0
  117. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim.egg-info/not-zip-safe +0 -0
  118. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim.egg-info/requires.txt +0 -0
  119. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/src/jaxsim.egg-info/top_level.txt +0 -0
  120. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_api_com.py +0 -0
  121. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_api_contact.py +0 -0
  122. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_api_frame.py +0 -0
  123. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_api_joint.py +0 -0
  124. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_api_link.py +0 -0
  125. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_contact.py +0 -0
  126. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_exceptions.py +0 -0
  127. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_pytree.py +0 -0
  128. {jaxsim-0.3.1.dev64 → jaxsim-0.3.1.dev113}/tests/test_simulations.py +0 -0
@@ -77,6 +77,10 @@ instance/
77
77
 
78
78
  # Sphinx documentation
79
79
  docs/_build/
80
+ docs/_collections/
81
+ docs/modules/_autosummary/
82
+ docs/modules/generated
83
+ docs/sg_execution_times.rst
80
84
 
81
85
  # PyBuilder
82
86
  target/
@@ -1,9 +1,9 @@
1
1
  version: "2"
2
2
 
3
3
  build:
4
- os: ubuntu-22.04
4
+ os: ubuntu-24.04
5
5
  tools:
6
- python: "mambaforge-22.9"
6
+ python: "mambaforge-23.11"
7
7
 
8
8
  conda:
9
9
  environment: environment.yml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jaxsim
3
- Version: 0.3.1.dev64
3
+ Version: 0.3.1.dev113
4
4
  Home-page: https://github.com/ami-iit/jaxsim
5
5
  Author: Diego Ferigo
6
6
  Author-email: diego.ferigo@iit.it
@@ -0,0 +1,124 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ import os
3
+ import sys
4
+
5
+ from pkg_resources import get_distribution
6
+
7
+ if os.environ.get("READTHEDOCS"):
8
+ checkout_name = os.path.basename(os.path.dirname(os.path.realpath(__file__)))
9
+ os.environ["CONDA_PREFIX"] = os.path.realpath(
10
+ os.path.join("..", "..", "conda", checkout_name)
11
+ )
12
+
13
+ import jaxsim
14
+
15
+ # -- Version information
16
+
17
+ sys.path.insert(0, os.path.abspath("."))
18
+ sys.path.insert(0, os.path.abspath("../"))
19
+ sys.path.insert(0, os.path.abspath("../../"))
20
+
21
+ module_path = os.path.abspath("../src/")
22
+ sys.path.insert(0, module_path)
23
+
24
+ __version__ = get_distribution("jaxsim").version
25
+
26
+ # -- Project information
27
+
28
+ project = "JAXsim"
29
+ copyright = "2022, Artificial and Mechanical Intelligence"
30
+ author = "Artificial and Mechanical Intelligence"
31
+
32
+ release = f"{__version__}"
33
+ version = f"main ({__version__})"
34
+
35
+ # -- General configuration
36
+
37
+ extensions = [
38
+ "sphinx.ext.duration",
39
+ "sphinx.ext.doctest",
40
+ "sphinx.ext.autodoc",
41
+ "sphinx.ext.autosummary",
42
+ "sphinx.ext.intersphinx",
43
+ "sphinx.ext.mathjax",
44
+ "sphinx.ext.ifconfig",
45
+ "sphinx.ext.viewcode",
46
+ "sphinx_rtd_theme",
47
+ "sphinx.ext.napoleon",
48
+ "sphinx_autodoc_typehints",
49
+ "sphinx_multiversion",
50
+ "enum_tools.autoenum",
51
+ "myst_nb",
52
+ "sphinx_gallery.gen_gallery",
53
+ "sphinxcontrib.collections",
54
+ "sphinx_design",
55
+ ]
56
+
57
+ # -- Options for intersphinx extension
58
+
59
+ language = "en"
60
+
61
+ html_theme = "sphinx_book_theme"
62
+
63
+ templates_path = ["_templates"]
64
+
65
+ html_title = f"JAXsim {version}"
66
+
67
+ master_doc = "index"
68
+
69
+ autodoc_typehints_format = "short"
70
+
71
+ autodoc_typehints = "description"
72
+
73
+ autosummary_generate = True
74
+
75
+ epub_show_urls = "footnote"
76
+
77
+ # Enable postponed evaluation of annotations (PEP 563)
78
+ autodoc_type_aliases = {
79
+ "jaxsim.typing.PyTree": "jaxsim.typing.PyTree",
80
+ "jaxsim.typing.Vector": "jaxsim.typing.Vector",
81
+ "jaxsim.typing.Matrix": "jaxsim.typing.Matrix",
82
+ "jaxsim.typing.Array": "jaxsim.typing.Array",
83
+ "jaxsim.typing.Int": "jaxsim.typing.Int",
84
+ "jaxsim.typing.Bool": "jaxsim.typing.Bool",
85
+ "jaxsim.typing.Float": "jaxsim.typing.Float",
86
+ "jaxsim.typing.ScalarLike": "jaxsim.typing.ScalarLike",
87
+ "jaxsim.typing.ArrayLike": "jaxsim.typing.ArrayLike",
88
+ "jaxsim.typing.VectorLike": "jaxsim.typing.VectorLike",
89
+ "jaxsim.typing.MatrixLike": "jaxsim.typing.MatrixLike",
90
+ "jaxsim.typing.IntLike": "jaxsim.typing.IntLike",
91
+ "jaxsim.typing.BoolLike": "jaxsim.typing.BoolLike",
92
+ "jaxsim.typing.FloatLike": "jaxsim.typing.FloatLike",
93
+ }
94
+
95
+ # -- Options for sphinx-collections
96
+
97
+ collections = {
98
+ "examples": {"driver": "copy_folder", "source": "../examples/", "ignore": "assets"}
99
+ }
100
+
101
+ # -- Options for sphinx-gallery ----------------------------------------------
102
+
103
+ sphinx_gallery_conf = {
104
+ "examples_dirs": "../examples",
105
+ "gallery_dirs": "../generated_examples/",
106
+ "doc_module": "jaxsim",
107
+ }
108
+
109
+ # -- Options for myst -------------------------------------------------------
110
+ myst_enable_extensions = [
111
+ "amsmath",
112
+ "dollarmath",
113
+ ]
114
+ nb_execution_mode = "auto"
115
+ nb_execution_raise_on_error = True
116
+ nb_render_image_options = {
117
+ "scale": "60",
118
+ }
119
+ nb_execution_timeout = 180
120
+
121
+ source_suffix = [".rst", ".md", ".ipynb"]
122
+
123
+ # Ignore header warnings
124
+ suppress_warnings = ["myst.header"]
@@ -0,0 +1,46 @@
1
+ .. _collections:
2
+
3
+ Example Notebooks
4
+ =================
5
+
6
+ .. toctree::
7
+ :glob:
8
+ :hidden:
9
+ :maxdepth: 1
10
+
11
+ _collections/examples/README.md
12
+
13
+ .. raw:: html
14
+
15
+ <div class="sphx-glr-thumbnails">
16
+
17
+ .. raw:: html
18
+
19
+ <div class="sphx-glr-thumbcontainer" tooltip="Parallel Simulation.">
20
+
21
+ .. only:: html
22
+
23
+ :doc:`_collections/examples/Parallel_computing`
24
+
25
+ .. raw:: html
26
+
27
+ <div class="sphx-glr-thumbnail-title">Parallel Simulation</div>
28
+ </div>
29
+
30
+
31
+ .. raw:: html
32
+
33
+ <div class="sphx-glr-thumbcontainer" tooltip="PD Controller.">
34
+
35
+ .. only:: html
36
+
37
+ :doc:`_collections/examples/PD_controller`
38
+
39
+ .. raw:: html
40
+
41
+ <div class="sphx-glr-thumbnail-title">PD Controller</div>
42
+ </div>
43
+
44
+ .. raw:: html
45
+
46
+ </div>
@@ -21,7 +21,7 @@ Features
21
21
 
22
22
  .. div:: sd-font-normal
23
23
 
24
- Physics engine in reduced coordinates implemented with `JAX <https://github.com/google/jax/>`_.
24
+ Physics engine in reduced coordinates implemented with JAX_.
25
25
  Compatibility with JIT compilation for increased performance and transparent support to execute logic on CPUs, GPUs, and TPUs.
26
26
  Parallel multi-body simulations on hardware accelerators for significantly increased throughput
27
27
 
@@ -68,17 +68,24 @@ Features
68
68
 
69
69
  .. toctree::
70
70
  :hidden:
71
- :maxdepth: 1
72
- :caption: User Guide
73
71
 
74
72
  guide/install
75
73
 
74
+ examples
75
+
76
76
  .. toctree::
77
77
  :hidden:
78
- :maxdepth: 1
78
+ :maxdepth: 2
79
79
  :caption: JAXsim API
80
80
 
81
- modules/index
81
+ modules/api
82
+ modules/integrators
83
+ modules/math
84
+ modules/mujoco
85
+ modules/parsers
86
+ modules/rbda
87
+ modules/typing
88
+ modules/utils
82
89
 
83
90
  Examples
84
91
  --------
@@ -90,13 +97,13 @@ Credits
90
97
 
91
98
  The physics module of JAXsim is based on the theory of the `Rigid Body Dynamics Algorithms <https://link.springer.com/book/10.1007/978-1-4899-7560-7>`_ book by Roy Featherstone.
92
99
  We structured part of our logic following its accompanying `code <http://royfeatherstone.org/spatial/index.html#spatial-software>`_.
93
- The physics engine is developed entirely in Python using `JAX <https://github.com/google/jax/>`_.
100
+ The physics engine is developed entirely in Python using JAX_.
94
101
 
95
- The inspiration for developing JAXsim originally stemmed from early versions of `google/brax <https://github.com/google/brax>`_.
102
+ The inspiration for developing JAXsim originally stemmed from early versions of Brax_.
96
103
  Here below we summarize the differences between the projects:
97
104
 
98
- - JAXsim simulates multibody dynamics in reduced coordinates, while brax v1 uses maximal coordinates.
99
- - The new v2 APIs of brax (and the new `MJX <https://mujoco.readthedocs.io/en/3.0.0/mjx.html>`_) were then implemented in reduced coordinates, following an approach comparable to JAXsim, with major differences in contact handling.
105
+ - JAXsim simulates multibody dynamics in reduced coordinates, while :code:`brax v1` uses maximal coordinates.
106
+ - The new v2 APIs of brax (and the new MJX_) were then implemented in reduced coordinates, following an approach comparable to JAXsim, with major differences in contact handling.
100
107
  - The rigid-body algorithms used in JAXsim allow to efficiently compute quantities based on the Euler-Poincarè
101
108
  formulation of the equations of motion, necessary for model-based robotics research.
102
109
  - JAXsim supports SDF (and, indirectly, URDF) models, assuming the model is described with the
@@ -122,3 +129,7 @@ License
122
129
  -------
123
130
 
124
131
  `BSD3 <https://choosealicense.com/licenses/bsd-3-clause/>`_
132
+
133
+ .. _Brax: https://github.com/google/brax
134
+ .. _MJX: https://mujoco.readthedocs.io/en/3.0.0/mjx.html
135
+ .. _JAX: https://github.com/google/jax
@@ -3,65 +3,93 @@ Functional API
3
3
 
4
4
  .. currentmodule:: jaxsim.api
5
5
 
6
+ .. autosummary::
7
+ :toctree: _autosummary
8
+
9
+ model
10
+ data
11
+ contact
12
+ kin_dyn_parameters
13
+ joint
14
+ link
15
+ frame
16
+ com
17
+ ode_data
18
+ ode
19
+ references
20
+ common
21
+
22
+
6
23
  Model
7
24
  ~~~~~
8
25
 
9
26
  .. automodule:: jaxsim.api.model
10
27
  :members:
28
+ :no-index:
11
29
 
12
30
  Data
13
31
  ~~~~
14
32
 
15
33
  .. automodule:: jaxsim.api.data
16
34
  :members:
35
+ :no-index:
17
36
 
18
37
  Contact
19
38
  ~~~~~~~
20
39
 
21
40
  .. automodule:: jaxsim.api.contact
22
41
  :members:
42
+ :no-index:
23
43
 
24
44
  KinDynParameters
25
45
  ~~~~~~~~~~~~~~~~
26
46
 
27
47
  .. automodule:: jaxsim.api.kin_dyn_parameters
28
48
  :members:
49
+ :no-index:
29
50
 
30
51
  Joint
31
52
  ~~~~~
32
53
 
33
54
  .. automodule:: jaxsim.api.joint
34
55
  :members:
56
+ :no-index:
35
57
 
36
58
  Link
37
59
  ~~~~~
38
60
  .. automodule:: jaxsim.api.link
39
61
  :members:
62
+ :no-index:
40
63
 
41
64
  Frame
42
65
  ~~~~~
43
66
  .. automodule:: jaxsim.api.frame
44
67
  :members:
68
+ :no-index:
45
69
 
46
70
  CoM
47
71
  ~~~
48
72
  .. automodule:: jaxsim.api.com
49
73
  :members:
74
+ :no-index:
50
75
 
51
76
  ODE Data
52
77
  ~~~~~~~~
53
78
 
54
79
  .. automodule:: jaxsim.api.ode_data
55
80
  :members:
81
+ :no-index:
56
82
 
57
83
  .. automodule:: jaxsim.api.ode
58
84
  :members:
85
+ :no-index:
59
86
 
60
87
  References
61
88
  ~~~~~~~~~~
62
89
 
63
90
  .. automodule:: jaxsim.api.references
64
91
  :members:
92
+ :no-index:
65
93
 
66
94
  Common
67
95
  ~~~~~~
@@ -10,49 +10,29 @@ This module provides a set of algorithms for rigid body dynamics.
10
10
 
11
11
  aba
12
12
  collidable_points
13
+ contacts.soft
13
14
  crba
14
15
  forward_kinematics
15
16
  jacobian
16
17
  utils
17
18
 
18
- Articulated Body Algorithm
19
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
20
-
21
- .. automodule:: jaxsim.rbda.aba
22
- :members:
23
-
24
19
  Collision Detection
25
20
  ~~~~~~~~~~~~~~~~~~~
26
21
 
27
22
  .. automodule:: jaxsim.rbda.collidable_points
28
23
  :members:
24
+ :no-index:
29
25
 
30
26
  Contact Models
31
27
  ~~~~~~~~~~~~~~
32
28
 
33
29
  .. automodule:: jaxsim.rbda.contacts.soft
34
30
  :members:
35
-
36
- Composite Rigid Body Algorithm
37
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38
-
39
- .. automodule:: jaxsim.rbda.crba
40
- :members:
41
-
42
- Forward Kinematics
43
- ~~~~~~~~~~~~~~~~~~~
44
-
45
- .. automodule:: jaxsim.rbda.forward_kinematics
46
- :members:
47
-
48
- Jacobians
49
- ~~~~~~~~~
50
-
51
- .. automodule:: jaxsim.rbda.jacobian
52
- :members:
31
+ :no-index:
53
32
 
54
33
  Utilities
55
34
  ~~~~~~~~~
56
35
 
57
36
  .. automodule:: jaxsim.rbda.utils
58
37
  :members:
38
+ :no-index:
@@ -38,6 +38,7 @@ dependencies:
38
38
  - filecache
39
39
  - filelock
40
40
  - jinja2
41
+ - myst-nb
41
42
  - pip
42
43
  - sphinx
43
44
  - sphinx-autodoc-typehints
@@ -45,6 +46,7 @@ dependencies:
45
46
  - sphinx-copybutton
46
47
  - sphinx-design
47
48
  - sphinx_fontawesome
49
+ - sphinx-gallery
48
50
  - sphinx-jinja2-compat
49
51
  - sphinx-multiversion
50
52
  - sphinx_rtd_theme
@@ -52,4 +54,7 @@ dependencies:
52
54
  # ========================================
53
55
  # Other dependencies for GitHub Codespaces
54
56
  # ========================================
57
+ - mesalib
55
58
  - ipython
59
+ - pip:
60
+ - sphinx-collections # TODO (flferretti): PR to conda-forge
@@ -20,7 +20,8 @@
20
20
  "outputs": [],
21
21
  "source": [
22
22
  "# @title Imports and setup\n",
23
- "from IPython.display import clear_output, HTML, display\n",
23
+ "from IPython.display import clear_output\n",
24
+ "import os\n",
24
25
  "import sys\n",
25
26
  "\n",
26
27
  "IS_COLAB = \"google.colab\" in sys.modules\n",
@@ -34,16 +35,18 @@
34
35
  " !apt -qq update\n",
35
36
  " !apt install -qq --no-install-recommends libsdformat13 gz-tools2\n",
36
37
  "\n",
37
- " # Optional dependency for visualization\n",
38
+ " # Install dependencies for visualization on Colab and ReadTheDocs\n",
39
+ " !sudo apt update\n",
40
+ " !apt install xvfb ffmpeg python-opengl\n",
38
41
  " !{sys.executable} -m pip install pyvirtualdisplay\n",
39
- " !apt install xvfb\n",
42
+ " clear_output()\n",
40
43
  "\n",
41
44
  " # Start Xvfb and set \"DISPLAY\" environment variable\n",
42
45
  " import pyvirtualdisplay\n",
46
+ "\n",
43
47
  " d = pyvirtualdisplay.Display()\n",
44
48
  " d.start()\n",
45
49
  "\n",
46
- " clear_output()\n",
47
50
  "\n",
48
51
  "import jax\n",
49
52
  "import jax.numpy as jnp\n",
@@ -100,6 +103,8 @@
100
103
  "from jaxsim import integrators\n",
101
104
  "\n",
102
105
  "dt = 0.01\n",
106
+ "integration_time = 5.0\n",
107
+ "num_steps = int(integration_time / dt)\n",
103
108
  "\n",
104
109
  "model = js.model.JaxSimModel.build_from_model_description(\n",
105
110
  " model_description=model_urdf_string, is_urdf=True\n",
@@ -149,19 +154,11 @@
149
154
  "outputs": [],
150
155
  "source": [
151
156
  "# @title Set up MuJoCo renderer\n",
152
- "\n",
153
- "from jaxsim.mujoco import RodModelToMjcf, MujocoModelHelper, MujocoVideoRecorder\n",
154
- "from jaxsim.mujoco.loaders import UrdfToMjcf\n",
155
- "\n",
156
- "import os\n",
157
157
  "import subprocess\n",
158
158
  "\n",
159
+ "os.environ[\"MUJOCO_GL\"] = \"osmesa\"\n",
159
160
  "\n",
160
161
  "if IS_COLAB:\n",
161
- " if subprocess.run(\"ffmpeg -version\", shell=True).returncode:\n",
162
- " !command -v ffmpeg >/dev/null || (apt update && apt install -y ffmpeg)\n",
163
- " clear_output()\n",
164
- "\n",
165
162
  " if subprocess.run(\"nvidia-smi\").returncode:\n",
166
163
  " raise RuntimeError(\n",
167
164
  " \"Cannot communicate with GPU. \"\n",
@@ -186,7 +183,11 @@
186
183
  " \"\"\"\n",
187
184
  " )\n",
188
185
  "\n",
189
- "%env MUJOCO_GL=egl\n",
186
+ " os.environ[\"MUJOCO_GL\"] = \"egl\"\n",
187
+ "\n",
188
+ "\n",
189
+ "from jaxsim.mujoco import MujocoModelHelper, MujocoVideoRecorder\n",
190
+ "from jaxsim.mujoco.loaders import UrdfToMjcf\n",
190
191
  "\n",
191
192
  "camera = {\n",
192
193
  " \"name\": \"cartpole_camera\",\n",
@@ -207,8 +208,8 @@
207
208
  " model=mj_model_helper.model,\n",
208
209
  " data=mj_model_helper.data,\n",
209
210
  " fps=int(1 / 0.010),\n",
210
- " width=320 * 4,\n",
211
- " height=240 * 4,\n",
211
+ " width=320 * 2,\n",
212
+ " height=240 * 2,\n",
212
213
  ")"
213
214
  ]
214
215
  },
@@ -227,7 +228,7 @@
227
228
  "source": [
228
229
  "import mediapy as media\n",
229
230
  "\n",
230
- "for _ in range(500):\n",
231
+ "for _ in range(num_steps):\n",
231
232
  " data, integrator_state = js.model.step(\n",
232
233
  " dt=dt,\n",
233
234
  " model=model,\n",
@@ -299,7 +300,7 @@
299
300
  "metadata": {},
300
301
  "outputs": [],
301
302
  "source": [
302
- "for _ in range(500):\n",
303
+ "for _ in range(num_steps):\n",
303
304
  " control_torques = pd_controller(\n",
304
305
  " data=data,\n",
305
306
  " q_d=jnp.array([0.0, 0.0]),\n",
@@ -23,8 +23,6 @@
23
23
  "# @title Imports and setup\n",
24
24
  "import sys\n",
25
25
  "\n",
26
- "from IPython.display import HTML, clear_output, display\n",
27
- "\n",
28
26
  "IS_COLAB = \"google.colab\" in sys.modules\n",
29
27
  "\n",
30
28
  "# Install JAX and Gazebo\n",
@@ -40,15 +38,12 @@
40
38
  "%env XLA_PYTHON_CLIENT_MEM_PREALLOCATE=false\n",
41
39
  "\n",
42
40
  "import time\n",
43
- "from typing import Dict, Tuple\n",
44
41
  "\n",
45
42
  "import jax\n",
46
43
  "import jax.numpy as jnp\n",
47
- "import jax_dataclasses\n",
48
44
  "import rod\n",
49
45
  "from rod.builder.primitives import SphereBuilder\n",
50
46
  "\n",
51
- "import jaxsim.typing as jtp\n",
52
47
  "from jaxsim import logging\n",
53
48
  "\n",
54
49
  "logging.set_logging_level(logging.LoggingLevel.INFO)\n",
@@ -105,7 +100,7 @@
105
100
  "from jaxsim import integrators\n",
106
101
  "\n",
107
102
  "dt = 0.001\n",
108
- "integration_time = 1500\n",
103
+ "integration_time = 1.5 # seconds\n",
109
104
  "\n",
110
105
  "model = js.model.JaxSimModel.build_from_model_description(\n",
111
106
  " model_description=model_sdf_string\n",
@@ -129,7 +124,9 @@
129
124
  "\n",
130
125
  "By default, in JaxSim a sphere primitive has 250 collision points. This can be modified by setting the `JAXSIM_COLLISION_SPHERE_POINTS` environment variable.\n",
131
126
  "\n",
132
- "Given that at its steady-state the sphere will act on two or three points, we can estimate the ground parameters by explicitly setting the number of active points to these values."
127
+ "Given that at its steady-state the sphere will act on two or three points, we can estimate the ground parameters by explicitly setting the number of active points to these values. \n",
128
+ "\n",
129
+ "Eventually, you can specify the maximum penetration depth of the sphere into the terrain by passing `max_penetraion` to the `estimate_good_soft_contacts_parameters` function."
133
130
  ]
134
131
  },
135
132
  {
@@ -139,8 +136,10 @@
139
136
  "outputs": [],
140
137
  "source": [
141
138
  "data = data.replace(\n",
142
- " soft_contacts_params=js.contact.estimate_good_soft_contacts_parameters(\n",
143
- " model, number_of_active_collidable_points_steady_state=3\n",
139
+ " contacts_params=js.contact.estimate_good_soft_contacts_parameters(\n",
140
+ " model=model,\n",
141
+ " number_of_active_collidable_points_steady_state=3,\n",
142
+ " max_penetration=None,\n",
144
143
  " )\n",
145
144
  ")"
146
145
  ]
@@ -149,7 +148,7 @@
149
148
  "cell_type": "markdown",
150
149
  "metadata": {},
151
150
  "source": [
152
- "Let's create a position vector for a 3x3 grid. Every sphere will be placed at a different height."
151
+ "Let's create a position vector for a 4x4 grid. Every sphere will be placed at a different height."
153
152
  ]
154
153
  },
155
154
  {
@@ -169,14 +168,13 @@
169
168
  "def grid(edge_len, envs_per_row):\n",
170
169
  " edge = jnp.linspace(-edge_len, edge_len, envs_per_row)\n",
171
170
  " xx, yy = jnp.meshgrid(edge, edge)\n",
172
- "\n",
173
- " poses = [\n",
174
- " [[xx[i, j], yy[i, j], 0.2 + 0.1 * (i * envs_per_row + j)], [0, 0, 0]]\n",
175
- " for i in range(xx.shape[0])\n",
176
- " for j in range(yy.shape[0])\n",
177
- " ]\n",
178
- "\n",
179
- " return jnp.array(poses)\n",
171
+ " zz = 0.2 + 0.1 * (\n",
172
+ " jnp.arange(envs_per_row**2) % envs_per_row\n",
173
+ " + jnp.arange(envs_per_row**2) // envs_per_row\n",
174
+ " )\n",
175
+ " zz = zz.reshape(envs_per_row, envs_per_row)\n",
176
+ " poses = jnp.stack([xx, yy, zz], axis=-1).reshape(envs_per_row**2, 3)\n",
177
+ " return poses\n",
180
178
  "\n",
181
179
  "\n",
182
180
  "logging.info(f\"Simulating {envs_per_row**2} environments\")\n",
@@ -200,11 +198,13 @@
200
198
  "def simulate(\n",
201
199
  " data: js.data.JaxSimModelData, integrator_state: dict, pose: jnp.array\n",
202
200
  ") -> tuple:\n",
203
- "\n",
201
+ " # Set the base position to the initial pose\n",
204
202
  " data = data.reset_base_position(base_position=pose)\n",
203
+ "\n",
204
+ " # Create a list to store the base position over time\n",
205
205
  " x_t_i = []\n",
206
206
  "\n",
207
- " for _ in range(integration_time):\n",
207
+ " for _ in range(int(integration_time // dt)):\n",
208
208
  " data, integrator_state = js.model.step(\n",
209
209
  " dt=dt,\n",
210
210
  " model=model,\n",
@@ -243,7 +243,7 @@
243
243
  "# Run and time the simulation\n",
244
244
  "now = time.perf_counter()\n",
245
245
  "\n",
246
- "x_t = simulate_vectorized(data, integrator_state, poses[:, 0])\n",
246
+ "x_t = simulate_vectorized(data, integrator_state, poses)\n",
247
247
  "\n",
248
248
  "comp_time = time.perf_counter() - now\n",
249
249
  "\n",
@@ -251,7 +251,7 @@
251
251
  " f\"Running simulation with {envs_per_row**2} models took {comp_time} seconds.\"\n",
252
252
  ")\n",
253
253
  "logging.info(\n",
254
- " f\"This corresponds to an RTF (Real Time Factor) of {(envs_per_row**2 *integration_time/comp_time):.2f}\"\n",
254
+ " f\"This corresponds to an RTF (Real Time Factor) of {(envs_per_row**2 * integration_time / comp_time):.2f}\"\n",
255
255
  ")"
256
256
  ]
257
257
  },
@@ -5,11 +5,10 @@ This folder includes a Jupyter Notebook demonstrating the practical usage of JAX
5
5
  ### Examples
6
6
 
7
7
  - [PD_controller](./PD_controller.ipynb) <a target="_blank" href="https://colab.research.google.com/github/ami-iit/jaxsim/blob/main/examples/PD_controller.ipynb">
8
- <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
9
- </a> - A simple example demonstrating the use of JAXsim to simulate a PD controller with gravity compensation for a 2-DOF cartpole.
8
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> - A simple example demonstrating the use of JAXsim to simulate a PD controller with gravity compensation for a 2-DOF cartpole.
9
+
10
10
  - [Parallel_computing](./Parallel_computing.ipynb) <a target="_blank" href="https://colab.research.google.com/github/ami-iit/jaxsim/blob/main/examples/Parallel_computing.ipynb">
11
- <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
12
- </a> - An example demonstrating how to simulate vectorized models in parallel using JAXsim.
11
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> - An example demonstrating how to simulate vectorized models in parallel using JAXsim.
13
12
 
14
13
  > [!TIP]
15
14
  > Stay tuned for more examples!