{"id":18060023,"url":"https://github.com/ami-iit/jaxsim","last_synced_at":"2025-11-17T13:00:37.755Z","repository":{"id":59760002,"uuid":"454087931","full_name":"ami-iit/jaxsim","owner":"ami-iit","description":"A differentiable physics engine and multibody dynamics library for control and robot learning.","archived":false,"fork":false,"pushed_at":"2025-11-14T15:23:11.000Z","size":7700,"stargazers_count":162,"open_issues_count":22,"forks_count":18,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-11-14T15:26:54.220Z","etag":null,"topics":["aba","ad","automatic-differentiation","crba","dynamics","featherstone","jacobian","jax","jit","kinematics","ode","physics","physics-engine","rigid-body-dynamics","rnea","robotics","robotics-control","robotics-simulation","simulation","simulation-modeling"],"latest_commit_sha":null,"homepage":"https://jaxsim.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ami-iit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-01-31T16:44:28.000Z","updated_at":"2025-11-14T15:20:54.000Z","dependencies_parsed_at":"2023-02-10T13:46:33.846Z","dependency_job_id":"42cc0bc9-605b-4ee0-932f-91abe9c2ea9b","html_url":"https://github.com/ami-iit/jaxsim","commit_stats":{"total_commits":356,"total_committers":8,"mean_commits":44.5,"dds":0.3230337078651685,"last_synced_commit":"72e130abd1fee0644feccfbe12d2e51f73891aa2"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/ami-iit/jaxsim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ami-iit%2Fjaxsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ami-iit%2Fjaxsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ami-iit%2Fjaxsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ami-iit%2Fjaxsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ami-iit","download_url":"https://codeload.github.com/ami-iit/jaxsim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ami-iit%2Fjaxsim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284430669,"owners_count":27003934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-14T02:00:06.101Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aba","ad","automatic-differentiation","crba","dynamics","featherstone","jacobian","jax","jit","kinematics","ode","physics","physics-engine","rigid-body-dynamics","rnea","robotics","robotics-control","robotics-simulation","simulation","simulation-modeling"],"created_at":"2024-10-31T04:01:15.965Z","updated_at":"2025-11-17T13:00:37.750Z","avatar_url":"https://github.com/ami-iit.png","language":"Python","readme":"# JaxSim\n\n**JaxSim** is a **differentiable physics engine** built with JAX, tailored for co-design and robotic learning applications.\n\n\u003cdiv align=\"center\"\u003e\n\u003cbr/\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\u003cimg src=\"https://github.com/user-attachments/assets/89d0b4ca-7e0c-4f58-bf3e-9540e35b9a01\" style=\"height:300px; width:400px; object-fit:cover;\"\u003e\u003c/th\u003e\n    \u003cth\u003e\u003cimg src=\"https://github.com/user-attachments/assets/a909e388-d7b4-4b58-89f1-035da8636d94\" style=\"height:300px; width:400px; object-fit:cover;\"\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\u003cimg src=\"https://github.com/user-attachments/assets/3692bc06-18ed-406d-80bd-480780346224\" style=\"height:300px; width:400px; object-fit:cover;\"\u003e\u003c/th\u003e\n    \u003cth\u003e\u003cimg src=\"https://github.com/user-attachments/assets/3356f332-4710-4946-9a82-a8c2305dab88\" style=\"height:300px; width:400px; object-fit:cover;\"\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\u003cbr/\u003e\n\u003c/div\u003e\n\n## Features\n\n- Physically consistent differentiability w.r.t. hardware parameters.\n- Closed chain dynamics support.\n- Reduced-coordinate physics engine for **fixed-base** and **floating-base** robots.\n- Fully Python-based, leveraging [JAX][jax] following a functional programming paradigm.\n- Seamless execution on CPUs, GPUs, and TPUs.\n- Supports JIT compilation and automatic vectorization for high performance.\n- Compatible with SDF models and URDF (via [sdformat][sdformat] conversion).\n\n\u003e [!WARNING]\n\u003e This project is still experimental. APIs may change between releases without notice.\n\n\u003e [!NOTE]\n\u003e JaxSim currently focuses on locomotion applications.\n\u003e Only contacts between bodies and smooth ground surfaces are supported.\n\n## How to use it\n\n```python\nimport pathlib\n\nimport icub_models\nimport jax.numpy as jnp\n\nimport jaxsim.api as js\n\n# Load the iCub model\nmodel_path = icub_models.get_model_file(\"iCubGazeboV2_5\")\n\njoints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',\n          'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',\n          'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',\n          'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',\n          'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',\n          'r_ankle_roll')\n\n# Build and reduce the model\nmodel_description = pathlib.Path(model_path)\n\nfull_model = js.model.JaxSimModel.build_from_model_description(\n    model_description=model_description,\n)\n\nmodel = js.model.reduce(model=full_model, considered_joints=joints)\n\n# Get the number of degrees of freedom\nndof = model.dofs()\n\n# Initialize data and simulation\n# Note that the default data representation is mixed velocity representation\ndata = js.data.JaxSimModelData.build(\n    model=model, base_position=jnp.array([0.0, 0.0, 1.0])\n)\n\nT = jnp.arange(start=0, stop=1.0, step=model.time_step)\n\ntau = jnp.zeros(ndof)\n\n# Simulate\nfor _ in T:\n    data = js.model.step(\n        model=model, data=data, link_forces=None, joint_force_references=tau\n    )\n```\n\nCheck the example folder for additional use cases!\n\n[jax]: https://github.com/google/jax/\n[sdformat]: https://github.com/gazebosim/sdformat\n[notation]: https://research.tue.nl/en/publications/multibody-dynamics-notation-version-2\n[passive_viewer_mujoco]: https://mujoco.readthedocs.io/en/stable/python.html#passive-viewer\n\n## Installation\n\n\u003cdetails\u003e\n\u003csummary\u003eWith \u003ccode\u003econda\u003c/code\u003e\u003c/summary\u003e\n\nYou can install the project using [`conda`][conda] as follows:\n\n```bash\nconda install jaxsim -c conda-forge\n```\n\nGPU support for JAX will be automatically installed if a compatible GPU is detected.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWith \u003ccode\u003epixi\u003c/code\u003e\u003c/summary\u003e\n\n\u003e ### Note\n\u003e The minimum version of `pixi` required is `0.39.0`.\n\nSince the `pixi.lock` file is stored using Git LFS, make sure you have [Git LFS](https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md) installed and properly configured on your system before installation. After cloning the repository, run:\n\n```bash\ngit lfs install \u0026\u0026 git lfs pull\n```\n\nThis ensures all LFS-tracked files are properly downloaded before you proceed with the installation.\n\nYou can add the `jaxsim` dependency in your [`pixi`][pixi] project as follows:\n\n```bash\npixi add jaxsim\n```\n\nIf you are on Linux and you want to use a `cuda`-powered version of `jax`, remember to add the appropriate line in the [`system-requirements`](https://pixi.sh/latest/reference/pixi_manifest/#the-system-requirements-table) table, i.e. adding\n\n~~~toml\n[system-requirements]\ncuda = \"12\"\n~~~\n\nif you are using a `pixi.toml` file or\n\n~~~toml\n[tool.pixi.system-requirements]\ncuda = \"12\"\n~~~\n\nif you are using a `pyproject.toml` file.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWith \u003ccode\u003epip\u003c/code\u003e\u003c/summary\u003e\n\nYou can install the project using [`pypa/pip`][pip], preferably in a [virtual environment][venv], as follows:\n\n```bash\npip install jaxsim\n```\n\nCheck [`pyproject.toml`](pyproject.toml) for the complete list of optional dependencies.\nYou can obtain a full installation using `jaxsim[all]`.\n\nIf you need URDF support, follow the [official instructions](https://gazebosim.org/docs) to install Gazebo Sim on your operating system,\nmaking sure to obtain `sdformat ≥ 13.0` and `gz-tools ≥ 2.0`.\n\nYou don't need to install the entire Gazebo Sim suite.\nFor example, on Ubuntu, it is sufficient to install the `libsdformat*` and `gz-tools2` packages.\n\nIf you need GPU support, follow the official [installation instructions][jax_gpu] of JAX.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eContributors installation (with \u003ccode\u003econda\u003c/code\u003e)\u003c/summary\u003e\n\nIf you want to contribute to the project, we recommend creating the following `jaxsim` conda environment first:\n\n```bash\nconda env create -f environment.yml\n```\n\nThen, activate the environment and install the project in editable mode:\n\n```bash\nconda activate jaxsim\npip install --no-deps -e .\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eContributors installation (with \u003ccode\u003epixi\u003c/code\u003e)\u003c/summary\u003e\n\n\u003e ### Note\n\u003e The minimum version of `pixi` required is `0.39.0`.\n\nSince the `pixi.lock` file is stored using Git LFS, make sure you have [Git LFS](https://github.com/git-lfs/git-lfs/blob/main/INSTALLING.md) installed and properly configured on your system before installation. After cloning the repository, run:\n\n```bash\ngit lfs install \u0026\u0026 git lfs pull\n```\n\nThis ensures all LFS-tracked files are properly downloaded before you proceed with the installation.\n\nYou can install the default dependencies of the project using [`pixi`][pixi] as follows:\n\n```bash\npixi install\n```\n\nSee `pixi task list` for a list of available tasks.\n\n\u003c/details\u003e\n\n[conda]: https://anaconda.org/\n[pip]: https://github.com/pypa/pip/\n[pixi]: https://pixi.sh/\n[venv]: https://docs.python.org/3/tutorial/venv.html\n[jax_gpu]: https://github.com/google/jax/#installation\n\n## Documentation\n\nThe JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs].\n\n[readthedocs]: https://jaxsim.readthedocs.io/\n\n## Additional features\n\nJaxsim can also be used as a multi-body dynamics library! With full support for automatic differentiation of RBDAs (forwards and reverse mode) and automatic differentiation against both kinematic and dynamic parameters.\n\n### Using JaxSim as a multibody dynamics library\n\n```python\nimport pathlib\n\nimport icub_models\nimport jax.numpy as jnp\n\nimport jaxsim.api as js\n\n# Load the iCub model\nmodel_path = icub_models.get_model_file(\"iCubGazeboV2_5\")\n\njoints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',\n          'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',\n          'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',\n          'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',\n          'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',\n          'r_ankle_roll')\n\n# Build and reduce the model\nmodel_description = pathlib.Path(model_path)\n\nfull_model = js.model.JaxSimModel.build_from_model_description(\n    model_description=model_description,\n)\n\nmodel = js.model.reduce(model=full_model, considered_joints=joints)\n\n# Initialize model data\ndata = js.data.JaxSimModelData.build(\n    model=model,\n    base_position=jnp.array([0.0, 0.0, 1.0]),\n)\n\n# Frame and dynamics computations\nframe_index = js.frame.name_to_idx(model=model, frame_name=\"l_foot\")\n\n# Frame transformation\nW_H_F = js.frame.transform(\n    model=model, data=data, frame_index=frame_index\n)\n\n# Frame Jacobian\nW_J_F = js.frame.jacobian(\n    model=model, data=data, frame_index=frame_index\n)\n\n# Dynamics properties\nM = js.model.free_floating_mass_matrix(model=model, data=data)      # Mass matrix\nh = js.model.free_floating_bias_forces(model=model, data=data)      # Bias forces\ng = js.model.free_floating_gravity_forces(model=model, data=data)   # Gravity forces\nC = js.model.free_floating_coriolis_matrix(model=model, data=data)  # Coriolis matrix\n\n# Print dynamics results\nprint(f\"{M.shape=} \\n{h.shape=} \\n{g.shape=} \\n{C.shape=}\")\n```\n\n## Credits\n\nThe RBDAs are based on the theory of the [Rigid Body Dynamics Algorithms][RBDA]\nbook by Roy Featherstone.\nThe algorithms and some simulation features were inspired by its accompanying [code][spatial_v2].\n\n[RBDA]: https://link.springer.com/book/10.1007/978-1-4899-7560-7\n[spatial_v2]: http://royfeatherstone.org/spatial/index.html#spatial-software\n\nThe development of JaxSim started in late 2021, inspired by early versions of [`google/brax`][brax].\nAt that time, Brax was implemented in maximal coordinates, and we wanted a physics engine in reduced coordinates.\nWe are grateful to the Brax team for their work and for showing the potential of [JAX][jax] in this field.\n\nBrax v2 was later implemented with reduced coordinates, following an approach comparable to JaxSim.\nThe development then shifted to [MJX][mjx], which provides a JAX-based implementation of the Mujoco APIs.\n\nThe main differences between MJX/Brax and JaxSim are as follows:\n\n- JaxSim supports out-of-the-box all SDF models with [Pose Frame Semantics][PFS].\n- JaxSim only supports collisions between points rigidly attached to bodies and a compliant ground surface.\n\n[brax]: https://github.com/google/brax\n[mjx]: https://mujoco.readthedocs.io/en/3.0.0/mjx.html\n[PFS]: http://sdformat.org/tutorials?tut=pose_frame_semantics\n\n## Contributing\n\nWe welcome contributions from the community.\nPlease read the [contributing guide](./CONTRIBUTING.md) to get started.\n\n## Citing\n\nIf you use JaxSim in your work, please cite our upcoming paper:\n\n```bibtex\n@software{ferretti_accelerated_optimization_2025,\n  author       = {Filippo Luca Ferretti and Diego Ferigo and Carlotta Sartore and Alessandro Croci and Omar G. Younis and Silvio Traversaro and Daniele Pucci},\n  title        = {Hardware-Accelerated Morphology Optimization via Physically Consistent Differentiable Simulation},\n  year         = {2025},\n  url          = {https://github.com/ami-iit/jaxsim}\n}\n```\n\n## People\n\n| Authors | Maintainers |\n|:------:|:-----------:|\n| [\u003cimg src=\"https://avatars.githubusercontent.com/u/469199?v=4\" width=\"40\"\u003e][df] [\u003cimg src=\"https://avatars.githubusercontent.com/u/102977828?v=4\" width=\"40\"\u003e][ff] | [\u003cimg src=\"https://avatars.githubusercontent.com/u/102977828?v=4\" width=\"40\"\u003e][ff] [\u003cimg src=\"https://avatars.githubusercontent.com/u/57228872?v=4\" width=\"40\"\u003e][ac] |\n\n[df]: https://github.com/diegoferigo\n[ff]: https://github.com/flferretti\n[ac]: https://github.com/xela-95\n\n## License\n\n[BSD3](https://choosealicense.com/licenses/bsd-3-clause/)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fami-iit%2Fjaxsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fami-iit%2Fjaxsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fami-iit%2Fjaxsim/lists"}