Skip to content
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
23 changes: 0 additions & 23 deletions .flake8

This file was deleted.

8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ repos:
rev: 24.3.0
hooks:
- id: black
args: ["--unstable"]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-simplify, flake8-return]
additional_dependencies:
- flake8-simplify
- flake8-return
- Flake8-pyproject
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand Down
10 changes: 3 additions & 7 deletions .vscode/tools/settings.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,10 @@
// This enables python language server. Seems to work slightly better than jedi:
"python.languageServer": "Pylance",
// We use "black" as a formatter:
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length", "120"],
"black-formatter.args": ["--line-length", "120", "--unstable"],
// Use flake8 for linting
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--max-line-length=120"
],
"flake8.enabled": true,
"flake8.args": ["--config", "${workspaceFolder}/pyproject.toml"],
// Use docstring generator
"autoDocstring.docstringFormat": "google",
"autoDocstring.guessTypes": true,
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

sys.path.insert(0, os.path.abspath("../source/isaaclab"))
sys.path.insert(0, os.path.abspath("../source/isaaclab/isaaclab"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_assets"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_assets/isaaclab_assets"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_tasks"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_tasks/isaaclab_tasks"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_rl"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_rl/isaaclab_rl"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_mimic"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_mimic/isaaclab_mimic"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_assets"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_assets/isaaclab_assets"))

# -- Project information -----------------------------------------------------

Expand Down Expand Up @@ -124,11 +124,11 @@
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"trimesh": ("https://trimesh.org/", None),
"torch": ("https://pytorch.org/docs/stable/", None),
"torch": ("https://docs.pytorch.org/docs/stable/", None),
"isaacsim": ("https://docs.isaacsim.omniverse.nvidia.com/5.1.0/py/", None),
"gymnasium": ("https://gymnasium.farama.org/", None),
"warp": ("https://nvidia.github.io/warp/", None),
"dev-guide": ("https://docs.omniverse.nvidia.com/dev-guide/latest", None),
"omniverse": ("https://docs.omniverse.nvidia.com/dev-guide/latest", None),
}

# Add any paths that contain templates here, relative to this directory.
Expand Down
130 changes: 124 additions & 6 deletions docs/source/api/lab_mimic/isaaclab_mimic.envs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,138 @@

.. autosummary::

FrankaCubeStackIKRelMimicEnv
FrankaCubeStackIKRelMimicEnvCfg
isaaclab_mimic.envs.franka_stack_ik_rel_mimic_env.FrankaCubeStackIKRelMimicEnv
isaaclab_mimic.envs.franka_stack_ik_rel_mimic_env_cfg.FrankaCubeStackIKRelMimicEnvCfg
isaaclab_mimic.envs.franka_stack_ik_abs_mimic_env.FrankaCubeStackIKAbsMimicEnv
isaaclab_mimic.envs.franka_stack_ik_abs_mimic_env_cfg.FrankaCubeStackIKAbsMimicEnvCfg
isaaclab_mimic.envs.galbot_stack_rmp_rel_mimic_env.RmpFlowGalbotCubeStackRelMimicEnv
isaaclab_mimic.envs.galbot_stack_rmp_rel_mimic_env_cfg.RmpFlowGalbotLeftArmGripperCubeStackRelMimicEnvCfg
isaaclab_mimic.envs.galbot_stack_rmp_rel_mimic_env_cfg.RmpFlowGalbotRightArmSuctionCubeStackRelMimicEnvCfg
isaaclab_mimic.envs.galbot_stack_rmp_abs_mimic_env.RmpFlowGalbotCubeStackAbsMimicEnv
isaaclab_mimic.envs.galbot_stack_rmp_abs_mimic_env_cfg.RmpFlowGalbotLeftArmGripperCubeStackAbsMimicEnvCfg
isaaclab_mimic.envs.galbot_stack_rmp_abs_mimic_env_cfg.RmpFlowGalbotRightArmSuctionCubeStackAbsMimicEnvCfg
isaaclab_mimic.envs.pick_place_mimic_env.PickPlaceRelMimicEnv
isaaclab_mimic.envs.pick_place_mimic_env.PickPlaceAbsMimicEnv
isaaclab_mimic.envs.agibot_place_upright_mug_mimic_env_cfg.RmpFlowAgibotPlaceUprightMugMimicEnvCfg
isaaclab_mimic.envs.agibot_place_toy2box_mimic_env_cfg.RmpFlowAgibotPlaceToy2BoxMimicEnvCfg

Franka Environments
-------------------

Franka Cube Stack IK Rel Mimic Env
----------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: FrankaCubeStackIKRelMimicEnv
.. autoclass:: isaaclab_mimic.envs.franka_stack_ik_rel_mimic_env.FrankaCubeStackIKRelMimicEnv
:members:
:inherited-members:
:show-inheritance:

Franka Cube Stack IK Rel Mimic Env Cfg
--------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.franka_stack_ik_rel_mimic_env_cfg.FrankaCubeStackIKRelMimicEnvCfg
:members:
:inherited-members:
:show-inheritance:

Franka Cube Stack IK Abs Mimic Env
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.franka_stack_ik_abs_mimic_env.FrankaCubeStackIKAbsMimicEnv
:members:
:inherited-members:
:show-inheritance:

Franka Cube Stack IK Abs Mimic Env Cfg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.franka_stack_ik_abs_mimic_env_cfg.FrankaCubeStackIKAbsMimicEnvCfg
:members:
:inherited-members:
:show-inheritance:

Galbot Environments
-------------------

Galbot Cube Stack Rel Mimic Env (RmpFlow)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.galbot_stack_rmp_rel_mimic_env.RmpFlowGalbotCubeStackRelMimicEnv
:members:
:inherited-members:
:show-inheritance:

Galbot Left Arm Gripper Cube Stack Rel Mimic Env Cfg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.galbot_stack_rmp_rel_mimic_env_cfg.RmpFlowGalbotLeftArmGripperCubeStackRelMimicEnvCfg
:members:
:inherited-members:
:show-inheritance:

Galbot Right Arm Suction Cube Stack Rel Mimic Env Cfg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.galbot_stack_rmp_rel_mimic_env_cfg.RmpFlowGalbotRightArmSuctionCubeStackRelMimicEnvCfg
:members:
:inherited-members:
:show-inheritance:

Galbot Cube Stack Abs Mimic Env (RmpFlow)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.galbot_stack_rmp_abs_mimic_env.RmpFlowGalbotCubeStackAbsMimicEnv
:members:
:inherited-members:
:show-inheritance:

Galbot Left Arm Gripper Cube Stack Abs Mimic Env Cfg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.galbot_stack_rmp_abs_mimic_env_cfg.RmpFlowGalbotLeftArmGripperCubeStackAbsMimicEnvCfg
:members:
:inherited-members:
:show-inheritance:

Galbot Right Arm Suction Cube Stack Abs Mimic Env Cfg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.galbot_stack_rmp_abs_mimic_env_cfg.RmpFlowGalbotRightArmSuctionCubeStackAbsMimicEnvCfg
:members:
:inherited-members:
:show-inheritance:

Agibot Environments
-------------------

Pick Place Rel Mimic Env
~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.pick_place_mimic_env.PickPlaceRelMimicEnv
:members:
:inherited-members:
:show-inheritance:

Pick Place Abs Mimic Env
~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.pick_place_mimic_env.PickPlaceAbsMimicEnv
:members:
:inherited-members:
:show-inheritance:

Agibot Place Upright Mug Mimic Env Cfg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: isaaclab_mimic.envs.agibot_place_upright_mug_mimic_env_cfg.RmpFlowAgibotPlaceUprightMugMimicEnvCfg
:members:
:inherited-members:
:show-inheritance:

Agibot Place Toy2Box Mimic Env Cfg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: FrankaCubeStackIKRelMimicEnvCfg
.. autoclass:: isaaclab_mimic.envs.agibot_place_toy2box_mimic_env_cfg.RmpFlowAgibotPlaceToy2BoxMimicEnvCfg
:members:
:inherited-members:
:show-inheritance:
17 changes: 17 additions & 0 deletions docs/source/overview/developer-guide/vs_code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,20 @@ and selecting ``Python: Select Interpreter``.

For more information on how to set python interpreter for VSCode, please
refer to the `VSCode documentation <https://code.visualstudio.com/docs/python/environments#_working-with-python-interpreters>`_.


Setting up formatting and linting
---------------------------------

We use `black <https://black.readthedocs.io/en/stable/>`_ as a formatter and `flake8 <https://flake8.pycqa.org/en/latest/>`_ as a linter. These are configured in the ``.vscode/settings.json`` file:

.. code-block:: json

{
"black-formatter.args": ["--line-length", "120", "--unstable"],
"flake8.enabled": true,
"flake8.args": ["--config", "${workspaceFolder}/pyproject.toml"],
}

The black formatter will automatically format your code to match the project's style guide (120 character line length).
The flake8 linter will show warnings and errors in your code to help you follow Python best practices and the project's coding standards.
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,46 @@
line-length = 120
target-version = ["py311"]
preview = true
unstable = true

[tool.flake8]
show-source = true
statistics = true

per-file-ignores = [
"*/__init__.py:F401",
]

ignore = [
"E402", # Module level import not at top of file
"E501", # Line too long
"F403", # Unable to detect undefined names
"W503", # Line break before binary operator
"E203", # Whitespace before ':' (Black conflict)
"D401", # First line should be in imperative mood
"R504", # Unnecessary variable assignment before return
"R505", # Unnecessary elif after return statement
"SIM102", # Use a single if-statement instead of nested if-statements
"SIM117", # Merge with statements for context managers that have same scope.
"SIM118", # Checks for key-existence checks against dict.keys() calls.
]

max-line-length = 120
max-complexity = 30

exclude = [
"_**",
".vscode",
".git",
"docs/**",
]

# docstrings
docstring-convention = "google"

# annotations
suppress-none-returning = true
allow-star-arg-any = true

[tool.isort]

Expand Down
12 changes: 9 additions & 3 deletions source/isaaclab/isaaclab/controllers/config/rmp_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@
from isaaclab.controllers.rmp_flow import RmpFlowControllerCfg
from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR

# Directory on Nucleus Server for RMP-Flow assets (URDFs, collision models, etc.)
ISAACLAB_NUCLEUS_RMPFLOW_DIR = os.path.join(ISAACLAB_NUCLEUS_DIR, "Controllers", "RmpFlowAssets")

# Note: RMP-Flow config files for supported robots are stored in the motion_generation extension
_RMP_CONFIG_DIR = os.path.join(
get_extension_path_from_name("isaacsim.robot_motion.motion_generation"), "motion_policy_configs"
)
# We need to move it here for doc building purposes.
try:
_RMP_CONFIG_DIR = os.path.join(
get_extension_path_from_name("isaacsim.robot_motion.motion_generation"),
"motion_policy_configs",
)
except Exception:
_RMP_CONFIG_DIR = ""

# Path to current directory
_CUR_DIR = os.path.dirname(os.path.realpath(__file__))
Expand Down
Loading