Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project's metadata #193

Merged
merged 5 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 80 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Its design facilitates research and accelerates prototyping in the intersection
- Provides all the quantities included in the Euler-Poincarè formulation of the equations of motion.
- Supports body-fixed, inertial-fixed, and mixed [velocity representations][notation].
- Exposes all the necessary quantities to develop controllers in centroidal coordinates.
- Supports running open-loop and full closed-loop control architectures on hardware accelerators.

### JaxSim for robot learning

Expand Down Expand Up @@ -82,7 +83,7 @@ You can install the project using [`pypa/pip`][pip], preferably in a [virtual en
pip install jaxsim
```

Check [`setup.cfg`](setup.cfg) for the complete list of optional dependencies.
Check [`pyproject.toml`](pyproject.toml) for the complete list of optional dependencies.
You can obtain a full installation using `jaxsim[all]`.

If you need GPU support, follow the official [installation instructions][jax_gpu] of JAX.
Expand Down Expand Up @@ -112,6 +113,71 @@ pip install --no-deps -e .
[venv]: https://docs.python.org/3/tutorial/venv.html
[jax_gpu]: https://github.com/google/jax/#installation

## Overview

<details>
<summary>Structure of the Python package</summary>

```
# tree -L 2 -I "__pycache__" -I "__init__*" -I "__main__*" src/jaxsim

src/jaxsim
|-- api..........................# Package containing the main functional APIs.
| |-- com.py...................# |-- APIs for computing quantities related to the center of mass.
| |-- common.py................# |-- Common utilities used in the current package.
| |-- contact.py...............# |-- APIs for computing quantities related to the collidable points.
| |-- data.py..................# |-- Class storing the data of a simulated model.
| |-- frame.py.................# |-- APIs for computing quantities related to additional frames.
| |-- joint.py.................# |-- APIs for computing quantities related to the joints.
| |-- kin_dyn_parameters.py....# |-- Class storing kinematic and dynamic parameters of a model.
| |-- link.py..................# |-- APIs for computing quantities related to the links.
| |-- model.py.................# |-- Class defining a simulated model and APIs for computing related quantities.
| |-- ode.py...................# |-- APIs for computing quantities related to the system dynamics.
| |-- ode_data.py..............# |-- Set of classes to store the data of the system dynamics.
| `-- references.py............# `-- Helper class to create references (link forces and joint torques).
|-- exceptions.py................# Module containing functions to raise exceptions from JIT-compiled functions.
|-- integrators..................# Package containing the integrators used to simulate the system dynamics.
| |-- common.py................# |-- Common utilities used in the current package.
| |-- fixed_step.py............# |-- Fixed-step integrators (explicit Runge-Kutta schemes).
| `-- variable_step.py.........# `-- Variable-step integrators (embedded Runge-Kutta schemes).
|-- logging.py...................# Module containing logging utilities.
|-- math.........................# Package containing mathematical utilities.
| |-- adjoint.py...............# |-- APIs for creating and manipulating 6D transformations.
| |-- cross.py.................# |-- APIs for computing cross products of 6D quantities.
| |-- inertia.py...............# |-- APIs for creating and manipulating 6D inertia matrices.
| |-- joint_model.py...........# |-- APIs defining the supported joint model and the corresponding transformations.
| |-- quaternion.py............# |-- APIs for creating and manipulating quaternions.
| |-- rotation.py..............# |-- APIs for creating and manipulating rotation matrices.
| |-- skew.py..................# |-- APIs for creating and manipulating skew-symmetric matrices.
| `-- transform.py.............# `-- APIs for creating and manipulating homogeneous transformations.
|-- mujoco.......................# Package containing utilities to interact with the Mujoco passive viewer.
| |-- loaders.py...............# |-- Utilities for converting JaxSim models to Mujoco models.
| |-- model.py.................# |-- Class providing high-level methods to compute quantities using Mujoco.
| `-- visualizer.py............# `-- Class that simplifies opening the passive viewer and recording videos.
|-- parsers......................# Package containing utilities to parse model descriptions (SDF and URDF models).
| |-- descriptions/............# |-- Package containing the intermediate representation of a model description.
| |-- kinematic_graph.py.......# |-- Definition of the kinematic graph associated with a parsed model description.
| `-- rod/.....................# `-- Package to create the intermediate representation from model descriptions using ROD.
|-- rbda.........................# Package containing the low-level rigid body dynamics algorithms.
| |-- aba.py...................# |-- The Articulated Body Algorithm.
| |-- collidable_points.py.....# |-- Kinematics of collidable points.
| |-- contacts/................# |-- Package containing the supported contact models.
| |-- crba.py..................# |-- The Composite Rigid Body Algorithm.
| |-- forward_kinematics.py....# |-- Forward kinematics of the model.
| |-- jacobian.py..............# |-- Full Jacobian and full Jacobian derivative.
| |-- rnea.py..................# |-- The Recursive Newton-Euler Algorithm.
| `-- utils.py.................# `-- Common utilities used in the current package.
|-- terrain......................# Package containing resources to specify the terrain.
| `-- terrain.py...............# `-- Classes defining the supported terrains.
|-- typing.py....................# Module containing type hints.
`-- utils........................# Package of common utilities.
|-- jaxsim_dataclass.py......# |-- Utilities to operate on pytree dataclasses.
|-- tracing.py...............# |-- Utilities to use when JAX is tracing functions.
`-- wrappers.py..............# `-- Utilities to wrap objects for specific use cases on pytree dataclass attributes.
```

</details>

## Credits

The RBDAs are based on the theory of the [Rigid Body Dynamics Algorithms][RBDA]
Expand Down Expand Up @@ -157,6 +223,19 @@ Please read the [contributing guide](./CONTRIBUTING.md) to get started.
}
```

Theoretical aspects of JaxSim are based on Chapters 7 and 8 of the following Ph.D. thesis:

```bibtex
@phdthesis{ferigo_phd_thesis_2022,
title = {Simulation Architectures for Reinforcement Learning applied to Robotics},
author = {Diego Ferigo},
school = {University of Manchester},
type = {PhD Thesis},
month = {July},
year = {2022},
}
```

## People

| Author | Maintainers |
Expand Down
173 changes: 137 additions & 36 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,112 @@
[project]
dynamic = ["version", "dependencies", "optional-dependencies", "urls", "classifiers", "keywords", "authors", "requires-python", "license", "readme"]
name = "jaxsim"
dynamic = ["version"]
requires-python = ">= 3.10"
description = "A differentiable physics engine and multibody dynamics library for control and robot learning."
authors = [
{ name = "Diego Ferigo", email = "[email protected]" },
]
maintainers = [
{ name = "Diego Ferigo", email = "[email protected]" },
{ name = "Filippo Luca Ferretti", email = "[email protected]" },
]
license.file = "LICENSE"
keywords = [
"physics",
"physics engine",
"jax",
"rigid body dynamics",
"featherstone",
"reinforcement learning",
"robot",
"robotics",
"sdf",
"urdf",
]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Robot Framework",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Games/Entertainment :: Simulation",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development",
]
dependencies = [
"coloredlogs",
"jax >= 0.4.13",
"jaxlib >= 0.4.13",
"jaxlie >= 1.3.0",
"jax_dataclasses >= 1.4.0",
"pptree",
"rod >= 0.3.0",
"typing_extensions ; python_version < '3.12'",
]

[project.optional-dependencies]
style = [
"black[jupyter] ~= 24.0",
"isort",
"pre-commit",
flferretti marked this conversation as resolved.
Show resolved Hide resolved
]
testing = [
"idyntree >= 12.2.1",
"pytest >=6.0",
"pytest-icdiff",
"robot-descriptions",
]
viz = [
"lxml",
"mediapy",
"mujoco >= 3.0.0",
]
all = [
"jaxsim[style,testing,viz]",
]

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.urls]
Changelog = "https://github.com/ami-iit/jaxsim/releases"
Documentation = "https://jaxsim.readthedocs.io"
Source = "https://github.com/ami-iit/jaxsim"
Tracker = "https://github.com/ami-iit/jaxsim/issues"

# ===========
# Build tools
# ===========

[build-system]
build-backend = "setuptools.build_meta"
requires = [
"wheel",
"setuptools>=64",
"setuptools_scm[toml]>=8",
"setuptools>=64",
"setuptools-scm[toml]>=8",
"wheel",
]

[tool.setuptools]
package-dir = { "" = "src" }

[tool.setuptools_scm]
local_scheme = "dirty-tag"
version_file = "src/jaxsim/_version.py"

# =================
# Style and testing
# =================

[tool.black]
line-length = 88

Expand All @@ -25,42 +118,46 @@ profile = "black"
addopts = "-rsxX -v --strict-markers"
minversion = "6.0"
testpaths = [
"tests",
"tests",
]

# ==================
# Ruff configuration
# ==================

[tool.ruff]
exclude = [
".git",
".pytest_cache",
".ruff_cache",
".vscode",
".devcontainer",
"__pycache__",
".git",
".pytest_cache",
".ruff_cache",
".vscode",
".devcontainer",
"__pycache__",
]
preview = true

[tool.ruff.lint]
# https://docs.astral.sh/ruff/rules/
select = [
"B",
"E",
"F",
"I",
"W",
"RUF",
"YTT",
"B",
"E",
"F",
"I",
"W",
"RUF",
"YTT",
]

ignore = [
"B008", # Function call in default argument
"B024", # Abstract base class without abstract methods
"E402", # Module level import not at top of file
"E501", # Line too long
"E731", # Do not assign a `lambda` expression, use a `def`
"E741", # Ambiguous variable name
"F841", # Local variable is assigned to but never used
"I001", # Import block is unsorted or unformatted
"RUF003", # Ambigous unicode character in comment
"B008", # Function call in default argument
"B024", # Abstract base class without abstract methods
"E402", # Module level import not at top of file
"E501", # Line too long
"E731", # Do not assign a `lambda` expression, use a `def`
"E741", # Ambiguous variable name
"F841", # Local variable is assigned to but never used
"I001", # Import block is unsorted or unformatted
"RUF003", # Ambigous unicode character in comment
]

[tool.ruff.lint.per-file-ignores]
Expand All @@ -70,6 +167,10 @@ ignore = [
"__init__.py" = ["F401"]
"docs/conf.py" = ["F401"]

# ==================
# Pixi configuration
# ==================

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64", "osx-64"]
Expand All @@ -90,9 +191,9 @@ sdformat14 = "*"
typing_extensions = "*"

[tool.pixi.feature.test.tasks]
examples = {cmd = "jupyter notebook ./examples"}
examples = { cmd = "jupyter notebook ./examples" }
pipcheck = "pip check"
test = {cmd = "pytest", depends_on = ["pipcheck"]}
test = { cmd = "pytest", depends_on = ["pipcheck"] }

[tool.pixi.feature.test.dependencies]
black = "24.*"
Expand All @@ -105,15 +206,15 @@ pytest-icdiff = "*"
robot_descriptions = "*"

[tool.pixi.feature.gpu]
dependencies = {cuda-version = "12.*", cuda-cupti = "*", jaxlib = "**cuda*"}
dependencies = { cuda-version = "12.*", cuda-cupti = "*", jaxlib = "**cuda*" }
platforms = ["linux-64"]
system-requirements = {cuda = "12.1"}
system-requirements = { cuda = "12.1" }

[tool.pixi.pypi-dependencies]
jaxsim = {path = "./", editable = true}
jaxsim = { path = "./", editable = true }

[tool.pixi.environments]
default = {solve-group = "cpugroup"}
gpu = {features = ["gpu"], solve-group = "gpugroup"}
test-cpu = {features = ["test"], solve-group = "cpugroup"}
test-gpu = {features = ["test", "gpu"], solve-group = "gpugroup"}
default = { solve-group = "cpugroup" }
gpu = { features = ["gpu"], solve-group = "gpugroup" }
test-cpu = { features = ["test"], solve-group = "cpugroup" }
test-gpu = { features = ["test", "gpu"], solve-group = "gpugroup" }
Loading