jaxsim 0.4.3.dev139__tar.gz → 0.4.3.dev143__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.
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/PKG-INFO +1 -1
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/examples/PD_controller.ipynb +2 -2
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/examples/Parallel_computing.ipynb +1 -1
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/_version.py +2 -2
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/model.py +4 -4
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/ode.py +29 -19
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/ode_data.py +18 -16
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/references.py +6 -6
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/contacts/relaxed_rigid.py +3 -1
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/contacts/rigid.py +3 -1
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim.egg-info/PKG-INFO +1 -1
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_automatic_differentiation.py +1 -1
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.devcontainer/Dockerfile +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.devcontainer/devcontainer.json +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.gitattributes +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.github/CODEOWNERS +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.github/workflows/ci_cd.yml +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.github/workflows/read_the_docs.yml +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.github/workflows/update_pixi_lockfile.yml +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.gitignore +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.pre-commit-config.yaml +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/.readthedocs.yaml +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/CONTRIBUTING.md +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/LICENSE +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/README.md +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/Makefile +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/conf.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/examples.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/guide/install.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/index.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/make.bat +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/modules/api.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/modules/integrators.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/modules/math.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/modules/mujoco.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/modules/parsers.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/modules/rbda.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/modules/typing.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/docs/modules/utils.rst +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/environment.yml +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/examples/.gitattributes +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/examples/.gitignore +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/examples/README.md +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/examples/assets/cartpole.urdf +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/pixi.lock +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/pyproject.toml +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/setup.cfg +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/setup.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/com.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/common.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/contact.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/data.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/frame.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/joint.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/kin_dyn_parameters.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/api/link.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/exceptions.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/integrators/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/integrators/common.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/integrators/fixed_step.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/integrators/variable_step.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/logging.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/adjoint.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/cross.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/inertia.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/joint_model.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/quaternion.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/rotation.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/skew.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/math/transform.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/mujoco/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/mujoco/__main__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/mujoco/loaders.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/mujoco/model.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/mujoco/visualizer.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/descriptions/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/descriptions/collision.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/descriptions/joint.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/descriptions/link.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/descriptions/model.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/kinematic_graph.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/rod/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/rod/parser.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/parsers/rod/utils.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/aba.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/collidable_points.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/contacts/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/contacts/common.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/contacts/soft.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/crba.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/forward_kinematics.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/jacobian.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/rnea.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/rbda/utils.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/terrain/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/terrain/terrain.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/typing.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/utils/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/utils/jaxsim_dataclass.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/utils/tracing.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim/utils/wrappers.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim.egg-info/SOURCES.txt +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim.egg-info/dependency_links.txt +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim.egg-info/requires.txt +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/src/jaxsim.egg-info/top_level.txt +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/__init__.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/conftest.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_api_com.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_api_contact.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_api_data.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_api_frame.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_api_joint.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_api_link.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_api_model.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_contact.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_exceptions.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_pytree.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/test_simulations.py +0 -0
- {jaxsim-0.4.3.dev139 → jaxsim-0.4.3.dev143}/tests/utils_idyntree.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: jaxsim
|
3
|
-
Version: 0.4.3.
|
3
|
+
Version: 0.4.3.dev143
|
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>
|
6
6
|
Maintainer-email: Diego Ferigo <dgferigo@gmail.com>, Filippo Luca Ferretti <filippo.ferretti@iit.it>
|
@@ -198,7 +198,7 @@
|
|
198
198
|
" data=data,\n",
|
199
199
|
" integrator=integrator,\n",
|
200
200
|
" integrator_state=integrator_state,\n",
|
201
|
-
"
|
201
|
+
" joint_force_references=None,\n",
|
202
202
|
" link_forces=None,\n",
|
203
203
|
" )\n",
|
204
204
|
"\n",
|
@@ -276,7 +276,7 @@
|
|
276
276
|
" data=data,\n",
|
277
277
|
" integrator=integrator,\n",
|
278
278
|
" integrator_state=integrator_state,\n",
|
279
|
-
"
|
279
|
+
" joint_force_references=control_torques,\n",
|
280
280
|
" link_forces=None,\n",
|
281
281
|
" )\n",
|
282
282
|
"\n",
|
@@ -12,5 +12,5 @@ __version__: str
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
13
13
|
version_tuple: VERSION_TUPLE
|
14
14
|
|
15
|
-
__version__ = version = '0.4.3.
|
16
|
-
__version_tuple__ = version_tuple = (0, 4, 3, '
|
15
|
+
__version__ = version = '0.4.3.dev143'
|
16
|
+
__version_tuple__ = version_tuple = (0, 4, 3, 'dev143')
|
@@ -1907,8 +1907,8 @@ def step(
|
|
1907
1907
|
dt: jtp.FloatLike,
|
1908
1908
|
integrator: jaxsim.integrators.Integrator,
|
1909
1909
|
integrator_state: dict[str, Any] | None = None,
|
1910
|
-
joint_forces: jtp.VectorLike | None = None,
|
1911
1910
|
link_forces: jtp.MatrixLike | None = None,
|
1911
|
+
joint_force_references: jtp.VectorLike | None = None,
|
1912
1912
|
**kwargs,
|
1913
1913
|
) -> tuple[js.data.JaxSimModelData, dict[str, Any]]:
|
1914
1914
|
"""
|
@@ -1920,10 +1920,10 @@ def step(
|
|
1920
1920
|
dt: The time step to consider.
|
1921
1921
|
integrator: The integrator to use.
|
1922
1922
|
integrator_state: The state of the integrator.
|
1923
|
-
joint_forces: The joint forces to consider.
|
1924
1923
|
link_forces:
|
1925
1924
|
The 6D forces to apply to the links expressed in the frame corresponding to
|
1926
1925
|
the velocity representation of `data`.
|
1926
|
+
joint_force_references: The joint force references to consider.
|
1927
1927
|
kwargs: Additional kwargs to pass to the integrator.
|
1928
1928
|
|
1929
1929
|
Returns:
|
@@ -1953,7 +1953,7 @@ def step(
|
|
1953
1953
|
params=integrator_state_x0,
|
1954
1954
|
# Always inject the current (model, data) pair into the system dynamics
|
1955
1955
|
# considered by the integrator, and include the input variables represented
|
1956
|
-
# by the pair (
|
1956
|
+
# by the pair (joint_force_references, link_forces).
|
1957
1957
|
# Note that the wrapper of the system dynamics will override (state_x0, t0)
|
1958
1958
|
# inside the passed data even if it is not strictly needed. This logic is
|
1959
1959
|
# necessary to re-use the jit-compiled step function of compatible pytrees
|
@@ -1962,7 +1962,7 @@ def step(
|
|
1962
1962
|
dict(
|
1963
1963
|
model=model,
|
1964
1964
|
data=data,
|
1965
|
-
|
1965
|
+
joint_force_references=joint_force_references,
|
1966
1966
|
link_forces=link_forces,
|
1967
1967
|
)
|
1968
1968
|
| integrator_kwargs
|
@@ -86,8 +86,8 @@ def system_velocity_dynamics(
|
|
86
86
|
model: js.model.JaxSimModel,
|
87
87
|
data: js.data.JaxSimModelData,
|
88
88
|
*,
|
89
|
-
joint_forces: jtp.Vector | None = None,
|
90
89
|
link_forces: jtp.Vector | None = None,
|
90
|
+
joint_force_references: jtp.Vector | None = None,
|
91
91
|
) -> tuple[jtp.Vector, jtp.Vector, dict[str, Any]]:
|
92
92
|
"""
|
93
93
|
Compute the dynamics of the system velocity.
|
@@ -95,10 +95,10 @@ def system_velocity_dynamics(
|
|
95
95
|
Args:
|
96
96
|
model: The model to consider.
|
97
97
|
data: The data of the considered model.
|
98
|
-
joint_forces: The joint force references to apply.
|
99
98
|
link_forces:
|
100
99
|
The 6D forces to apply to the links expressed in the frame corresponding to
|
101
100
|
the velocity representation of `data`.
|
101
|
+
joint_force_references: The joint force references to apply.
|
102
102
|
|
103
103
|
Returns:
|
104
104
|
A tuple containing the derivative of the base 6D velocity in inertial-fixed
|
@@ -120,7 +120,7 @@ def system_velocity_dynamics(
|
|
120
120
|
references = js.references.JaxSimModelReferences.build(
|
121
121
|
model=model,
|
122
122
|
link_forces=O_f_L,
|
123
|
-
joint_force_references=
|
123
|
+
joint_force_references=joint_force_references,
|
124
124
|
data=data,
|
125
125
|
velocity_representation=data.velocity_representation,
|
126
126
|
)
|
@@ -192,7 +192,10 @@ def system_velocity_dynamics(
|
|
192
192
|
f_L_total = references.link_forces(model=model, data=data)
|
193
193
|
|
194
194
|
v̇_WB, s̈ = system_acceleration(
|
195
|
-
model=model,
|
195
|
+
model=model,
|
196
|
+
data=data,
|
197
|
+
joint_force_references=joint_force_references,
|
198
|
+
link_forces=f_L_total,
|
196
199
|
)
|
197
200
|
|
198
201
|
return v̇_WB, s̈, aux_data
|
@@ -202,8 +205,8 @@ def system_acceleration(
|
|
202
205
|
model: js.model.JaxSimModel,
|
203
206
|
data: js.data.JaxSimModelData,
|
204
207
|
*,
|
205
|
-
joint_forces: jtp.VectorLike | None = None,
|
206
208
|
link_forces: jtp.MatrixLike | None = None,
|
209
|
+
joint_force_references: jtp.VectorLike | None = None,
|
207
210
|
) -> tuple[jtp.Vector, jtp.Vector]:
|
208
211
|
"""
|
209
212
|
Compute the system acceleration in the active representation.
|
@@ -211,12 +214,13 @@ def system_acceleration(
|
|
211
214
|
Args:
|
212
215
|
model: The model to consider.
|
213
216
|
data: The data of the considered model.
|
214
|
-
joint_forces: The joint forces to apply.
|
215
217
|
link_forces:
|
216
|
-
The 6D forces to apply to the links expressed in the same
|
218
|
+
The 6D forces to apply to the links expressed in the same
|
219
|
+
velocity representation of data.
|
220
|
+
joint_force_references: The joint force references to apply.
|
217
221
|
|
218
222
|
Returns:
|
219
|
-
A tuple containing the base 6D acceleration in
|
223
|
+
A tuple containing the base 6D acceleration in the active representation
|
220
224
|
and the joint accelerations.
|
221
225
|
"""
|
222
226
|
|
@@ -232,9 +236,9 @@ def system_acceleration(
|
|
232
236
|
).astype(float)
|
233
237
|
|
234
238
|
# Build joint torques if not provided.
|
235
|
-
τ = (
|
236
|
-
jnp.atleast_1d(
|
237
|
-
if
|
239
|
+
τ_references = (
|
240
|
+
jnp.atleast_1d(joint_force_references.squeeze())
|
241
|
+
if joint_force_references is not None
|
238
242
|
else jnp.zeros_like(data.joint_positions())
|
239
243
|
).astype(float)
|
240
244
|
|
@@ -243,15 +247,16 @@ def system_acceleration(
|
|
243
247
|
# ====================
|
244
248
|
|
245
249
|
# TODO: enforce joint limits
|
246
|
-
τ_position_limit = jnp.zeros_like(τ).astype(float)
|
250
|
+
τ_position_limit = jnp.zeros_like(τ_references).astype(float)
|
247
251
|
|
248
252
|
# ====================
|
249
253
|
# Joint friction model
|
250
254
|
# ====================
|
251
255
|
|
252
|
-
τ_friction = jnp.zeros_like(τ).astype(float)
|
256
|
+
τ_friction = jnp.zeros_like(τ_references).astype(float)
|
253
257
|
|
254
258
|
if model.dofs() > 0:
|
259
|
+
|
255
260
|
# Static and viscous joint friction parameters
|
256
261
|
kc = jnp.array(
|
257
262
|
model.kin_dyn_parameters.joint_parameters.friction_static
|
@@ -271,22 +276,27 @@ def system_acceleration(
|
|
271
276
|
# ========================
|
272
277
|
|
273
278
|
# Compute the total joint forces.
|
274
|
-
τ_total = τ + τ_friction + τ_position_limit
|
279
|
+
τ_total = τ_references + τ_friction + τ_position_limit
|
275
280
|
|
281
|
+
# Store the link forces in a references object.
|
276
282
|
references = js.references.JaxSimModelReferences.build(
|
277
283
|
model=model,
|
278
284
|
data=data,
|
279
285
|
velocity_representation=data.velocity_representation,
|
280
|
-
joint_force_references=τ_total,
|
281
286
|
link_forces=f_L,
|
282
287
|
)
|
283
288
|
|
289
|
+
# Compute forward dynamics.
|
290
|
+
#
|
284
291
|
# - Joint accelerations: s̈ ∈ ℝⁿ
|
285
292
|
# - Base acceleration: v̇_WB ∈ ℝ⁶
|
293
|
+
#
|
294
|
+
# Note that ABA returns the base acceleration in the velocity representation
|
295
|
+
# stored in the `data` object.
|
286
296
|
v̇_WB, s̈ = js.model.forward_dynamics_aba(
|
287
297
|
model=model,
|
288
298
|
data=data,
|
289
|
-
joint_forces
|
299
|
+
joint_forces=τ_total,
|
290
300
|
link_forces=references.link_forces(model=model, data=data),
|
291
301
|
)
|
292
302
|
|
@@ -337,8 +347,8 @@ def system_dynamics(
|
|
337
347
|
model: js.model.JaxSimModel,
|
338
348
|
data: js.data.JaxSimModelData,
|
339
349
|
*,
|
340
|
-
joint_forces: jtp.Vector | None = None,
|
341
350
|
link_forces: jtp.Vector | None = None,
|
351
|
+
joint_force_references: jtp.Vector | None = None,
|
342
352
|
baumgarte_quaternion_regularization: jtp.FloatLike = 1.0,
|
343
353
|
) -> tuple[ODEState, dict[str, Any]]:
|
344
354
|
"""
|
@@ -347,10 +357,10 @@ def system_dynamics(
|
|
347
357
|
Args:
|
348
358
|
model: The model to consider.
|
349
359
|
data: The data of the considered model.
|
350
|
-
joint_forces: The joint forces to apply.
|
351
360
|
link_forces:
|
352
361
|
The 6D forces to apply to the links expressed in the frame corresponding to
|
353
362
|
the velocity representation of `data`.
|
363
|
+
joint_force_references: The joint force references to apply.
|
354
364
|
baumgarte_quaternion_regularization:
|
355
365
|
The Baumgarte regularization coefficient used to adjust the norm of the
|
356
366
|
quaternion (only used in integrators not operating on the SO(3) manifold).
|
@@ -368,7 +378,7 @@ def system_dynamics(
|
|
368
378
|
W_v̇_WB, s̈, aux_dict = system_velocity_dynamics(
|
369
379
|
model=model,
|
370
380
|
data=data,
|
371
|
-
|
381
|
+
joint_force_references=joint_force_references,
|
372
382
|
link_forces=link_forces,
|
373
383
|
)
|
374
384
|
|
@@ -38,16 +38,16 @@ class ODEInput(JaxsimDataclass):
|
|
38
38
|
@staticmethod
|
39
39
|
def build_from_jaxsim_model(
|
40
40
|
model: js.model.JaxSimModel | None = None,
|
41
|
-
joint_forces: jtp.VectorLike | None = None,
|
42
41
|
link_forces: jtp.MatrixLike | None = None,
|
42
|
+
joint_force_references: jtp.VectorLike | None = None,
|
43
43
|
) -> ODEInput:
|
44
44
|
"""
|
45
45
|
Build an `ODEInput` from a `JaxSimModel`.
|
46
46
|
|
47
47
|
Args:
|
48
48
|
model: The `JaxSimModel` associated with the ODE input.
|
49
|
-
joint_forces: The vector of joint forces.
|
50
49
|
link_forces: The matrix of external forces applied to the links.
|
50
|
+
joint_force_references: The vector of joint force references.
|
51
51
|
|
52
52
|
Returns:
|
53
53
|
The `ODEInput` built from the `JaxSimModel`.
|
@@ -60,8 +60,8 @@ class ODEInput(JaxsimDataclass):
|
|
60
60
|
return ODEInput.build(
|
61
61
|
physics_model_input=PhysicsModelInput.build_from_jaxsim_model(
|
62
62
|
model=model,
|
63
|
-
joint_forces=joint_forces,
|
64
63
|
link_forces=link_forces,
|
64
|
+
joint_force_references=joint_force_references,
|
65
65
|
),
|
66
66
|
model=model,
|
67
67
|
)
|
@@ -526,16 +526,16 @@ class PhysicsModelInput(JaxsimDataclass):
|
|
526
526
|
@staticmethod
|
527
527
|
def build_from_jaxsim_model(
|
528
528
|
model: js.model.JaxSimModel | None = None,
|
529
|
-
joint_forces: jtp.VectorLike | None = None,
|
530
529
|
link_forces: jtp.MatrixLike | None = None,
|
530
|
+
joint_force_references: jtp.VectorLike | None = None,
|
531
531
|
) -> PhysicsModelInput:
|
532
532
|
"""
|
533
533
|
Build a `PhysicsModelInput` from a `JaxSimModel`.
|
534
534
|
|
535
535
|
Args:
|
536
536
|
model: The `JaxSimModel` associated with the input.
|
537
|
-
joint_forces: The vector of joint forces.
|
538
537
|
link_forces: The matrix of external forces applied to the links.
|
538
|
+
joint_force_references: The vector of joint force references.
|
539
539
|
|
540
540
|
Returns:
|
541
541
|
A `PhysicsModelInput` instance.
|
@@ -546,7 +546,7 @@ class PhysicsModelInput(JaxsimDataclass):
|
|
546
546
|
"""
|
547
547
|
|
548
548
|
return PhysicsModelInput.build(
|
549
|
-
|
549
|
+
joint_force_references=joint_force_references,
|
550
550
|
link_forces=link_forces,
|
551
551
|
number_of_dofs=model.dofs(),
|
552
552
|
number_of_links=model.number_of_links(),
|
@@ -554,8 +554,8 @@ class PhysicsModelInput(JaxsimDataclass):
|
|
554
554
|
|
555
555
|
@staticmethod
|
556
556
|
def build(
|
557
|
-
joint_forces: jtp.VectorLike | None = None,
|
558
557
|
link_forces: jtp.MatrixLike | None = None,
|
558
|
+
joint_force_references: jtp.VectorLike | None = None,
|
559
559
|
number_of_dofs: jtp.Int | None = None,
|
560
560
|
number_of_links: jtp.Int | None = None,
|
561
561
|
) -> PhysicsModelInput:
|
@@ -563,8 +563,8 @@ class PhysicsModelInput(JaxsimDataclass):
|
|
563
563
|
Build a `PhysicsModelInput`.
|
564
564
|
|
565
565
|
Args:
|
566
|
-
joint_forces: The vector of joint forces.
|
567
566
|
link_forces: The matrix of external forces applied to the links.
|
567
|
+
joint_force_references: The vector of joint force references.
|
568
568
|
number_of_dofs: The number of degrees of freedom of the model.
|
569
569
|
number_of_links: The number of links of the model.
|
570
570
|
|
@@ -572,19 +572,21 @@ class PhysicsModelInput(JaxsimDataclass):
|
|
572
572
|
A `PhysicsModelInput` instance.
|
573
573
|
"""
|
574
574
|
|
575
|
-
|
576
|
-
|
577
|
-
|
575
|
+
joint_force_references = jnp.atleast_1d(
|
576
|
+
jnp.array(joint_force_references, dtype=float).squeeze()
|
577
|
+
if joint_force_references is not None
|
578
|
+
else jnp.zeros(number_of_dofs)
|
579
|
+
).astype(float)
|
578
580
|
|
579
|
-
link_forces = (
|
580
|
-
link_forces
|
581
|
+
link_forces = jnp.atleast_2d(
|
582
|
+
jnp.array(link_forces, dtype=float).squeeze()
|
581
583
|
if link_forces is not None
|
582
584
|
else jnp.zeros(shape=(number_of_links, 6))
|
583
|
-
)
|
585
|
+
).astype(float)
|
584
586
|
|
585
587
|
return PhysicsModelInput(
|
586
|
-
tau=
|
587
|
-
f_ext=
|
588
|
+
tau=joint_force_references,
|
589
|
+
f_ext=link_forces,
|
588
590
|
)
|
589
591
|
|
590
592
|
@staticmethod
|
@@ -55,8 +55,8 @@ class JaxSimModelReferences(js.common.ModelDataWithVelocityRepresentation):
|
|
55
55
|
@staticmethod
|
56
56
|
def build(
|
57
57
|
model: js.model.JaxSimModel,
|
58
|
-
joint_force_references: jtp.
|
59
|
-
link_forces: jtp.
|
58
|
+
joint_force_references: jtp.VectorLike | None = None,
|
59
|
+
link_forces: jtp.MatrixLike | None = None,
|
60
60
|
data: js.data.JaxSimModelData | None = None,
|
61
61
|
velocity_representation: VelRepr | None = None,
|
62
62
|
) -> JaxSimModelReferences:
|
@@ -78,14 +78,14 @@ class JaxSimModelReferences(js.common.ModelDataWithVelocityRepresentation):
|
|
78
78
|
|
79
79
|
# Create or adjust joint force references.
|
80
80
|
joint_force_references = jnp.atleast_1d(
|
81
|
-
joint_force_references.squeeze()
|
81
|
+
jnp.array(joint_force_references, dtype=float).squeeze()
|
82
82
|
if joint_force_references is not None
|
83
83
|
else jnp.zeros(model.dofs())
|
84
84
|
).astype(float)
|
85
85
|
|
86
86
|
# Create or adjust link forces.
|
87
87
|
f_L = jnp.atleast_2d(
|
88
|
-
link_forces.squeeze()
|
88
|
+
jnp.array(link_forces, dtype=float).squeeze()
|
89
89
|
if link_forces is not None
|
90
90
|
else jnp.zeros((model.number_of_links(), 6))
|
91
91
|
).astype(float)
|
@@ -299,9 +299,9 @@ class JaxSimModelReferences(js.common.ModelDataWithVelocityRepresentation):
|
|
299
299
|
A new `JaxSimModelReferences` object with the given joint force references.
|
300
300
|
"""
|
301
301
|
|
302
|
-
forces = jnp.array(forces)
|
302
|
+
forces = jnp.atleast_1d(jnp.array(forces, dtype=float).squeeze())
|
303
303
|
|
304
|
-
def replace(forces: jtp.
|
304
|
+
def replace(forces: jtp.Vector) -> JaxSimModelReferences:
|
305
305
|
return self.replace(
|
306
306
|
validate=True,
|
307
307
|
input=self.input.replace(
|
@@ -274,7 +274,9 @@ class RelaxedRigidContacts(ContactModel):
|
|
274
274
|
model=model,
|
275
275
|
data=data,
|
276
276
|
link_forces=references.link_forces(model=model, data=data),
|
277
|
-
|
277
|
+
joint_force_references=references.joint_force_references(
|
278
|
+
model=model
|
279
|
+
),
|
278
280
|
)
|
279
281
|
)
|
280
282
|
BW_ν = data.generalized_velocity()
|
@@ -313,8 +313,10 @@ class RigidContacts(ContactModel):
|
|
313
313
|
js.ode.system_acceleration(
|
314
314
|
model=model,
|
315
315
|
data=data,
|
316
|
-
joint_forces=references.joint_force_references(model=model),
|
317
316
|
link_forces=references.link_forces(model=model, data=data),
|
317
|
+
joint_force_references=references.joint_force_references(
|
318
|
+
model=model
|
319
|
+
),
|
318
320
|
)
|
319
321
|
)
|
320
322
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: jaxsim
|
3
|
-
Version: 0.4.3.
|
3
|
+
Version: 0.4.3.dev143
|
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>
|
6
6
|
Maintainer-email: Diego Ferigo <dgferigo@gmail.com>, Filippo Luca Ferretti <filippo.ferretti@iit.it>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|