Skip to content

Commit

Permalink
Adds Factory contact-rich manipulation tasks to IsaacLab (#1520)
Browse files Browse the repository at this point in the history
# Description

This MR adds new tasks for contact-rich manipulation based on the
Factory line of work. Tasks include peg insertion, gear meshing, and nut
threading.

## Type of change

- New feature (non-breaking change which adds functionality)
- This change requires a documentation update

## Screenshots

<img
src="https://github.com/user-attachments/assets/c8c32592-8972-4b1e-be7c-51b0313393bf"
alt="peg_insertion" height="200"/>
<img
src="https://github.com/user-attachments/assets/437baf31-f9cb-4a27-94ac-5f21e2309089"
alt="gear_meshing" height="200"/>
<img
src="https://github.com/user-attachments/assets/bccdf71b-cd5f-45f7-b4ca-71616885ef48"
alt="nut_threading" height="200"/>

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
Co-authored-by: Iretiayo Akinola <[email protected]>
Co-authored-by: Kelly Guo <[email protected]>
Co-authored-by: Kelly Guo <[email protected]>
  • Loading branch information
4 people authored Dec 17, 2024
1 parent fc6042f commit 3c55db4
Show file tree
Hide file tree
Showing 16 changed files with 1,963 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Guidelines for modifications:
* Haoran Zhou
* HoJin Jeon
* Hongwei Xiong
* Iretiayo Akinola
* Jan Kerner
* Jean Tampon
* Jia Lin Yuan
Expand All @@ -63,6 +64,7 @@ Guidelines for modifications:
* Lorenz Wellhausen
* Masoud Moghani
* Michael Gussert
* Michael Noseworthy
* Muhong Guo
* Nuralem Abizov
* Oyindamola Omotuyi
Expand Down Expand Up @@ -91,3 +93,4 @@ Guidelines for modifications:
* Gavriel State
* Hammad Mazhar
* Marco Hutter
* Yashraj Narang
Binary file added docs/source/_static/tasks/factory/gear_mesh.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/tasks/factory/nut_thread.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/tasks/factory/peg_insert.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs/source/overview/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,39 @@ for the lift-cube environment:
.. |cube-shadow-lstm-link| replace:: `Isaac-Repose-Cube-Shadow-OpenAI-LSTM-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/shadow_hand/shadow_hand_env_cfg.py>`__
.. |cube-shadow-vis-link| replace:: `Isaac-Repose-Cube-Shadow-Vision-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/shadow_hand/shadow_hand_vision_env.py>`__

Contact-rich Manipulation
~~~~~~~~~~~~

Environments based on contact-rich manipulation tasks such as peg insertion, gear meshing and nut-bolt fastening.

These tasks share the same task configurations and control options. You can switch between them by specifying the task name.
For example:

* |factory-peg-link|: Peg insertion with the Franka arm
* |factory-gear-link|: Gear meshing with the Franka arm
* |factory-nut-link|: Nut-Bolt fastening with the Franka arm

.. table::
:widths: 33 37 30

+--------------------+-------------------------+-----------------------------------------------------------------------------+
| World | Environment ID | Description |
+====================+=========================+=============================================================================+
| |factory-peg| | |factory-peg-link| | Insert peg into the socket with the Franka robot |
+--------------------+-------------------------+-----------------------------------------------------------------------------+
| |factory-gear| | |factory-gear-link| | Insert and mesh gear into the base with other gears, using the Franka robot |
+--------------------+-------------------------+-----------------------------------------------------------------------------+
| |factory-nut| | |factory-nut-link| | Thread the nut onto the first 2 threads of the bolt, using the Franka robot |
+--------------------+-------------------------+-----------------------------------------------------------------------------+

.. |factory-peg| image:: ../_static/tasks/factory/peg_insert.jpg
.. |factory-gear| image:: ../_static/tasks/factory/gear_mesh.jpg
.. |factory-nut| image:: ../_static/tasks/factory/nut_thread.jpg

.. |factory-peg-link| replace:: `Isaac-Factory-PegInsert-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/factory/factory_env_cfg.py>`__
.. |factory-gear-link| replace:: `Isaac-Factory-GearMesh-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/factory/factory_env_cfg.py>`__
.. |factory-nut-link| replace:: `Isaac-Factory-NutThread-Direct-v0 <https://github.com/isaac-sim/IsaacLab/blob/main/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/factory/factory_env_cfg.py>`__

Locomotion
~~~~~~~~~~

Expand Down Expand Up @@ -369,6 +402,18 @@ Comprehensive List of Environments
-
- Manager Based
- **rl_games** (PPO), **rsl_rl** (PPO), **skrl** (PPO), **sb3** (PPO)
* - Isaac-Factory-GearMesh-Direct-v0
-
- Direct
- **rl_games** (PPO)
* - Isaac-Factory-NutThread-Direct-v0
-
- Direct
- **rl_games** (PPO)
* - Isaac-Factory-PegInsert-Direct-v0
-
- Direct
- **rl_games** (PPO)
* - Isaac-Franka-Cabinet-Direct-v0
-
- Direct
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.10.15"
version = "0.10.16"

# Description
title = "Isaac Lab Environments"
Expand Down
14 changes: 14 additions & 0 deletions source/extensions/omni.isaac.lab_tasks/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
Changelog
---------

0.10.16 (2024-12-16)
~~~~~~~~~~~~~~~~~~~~

Added
^^^^^

* Added ``Factory-Direct-v0`` environment as a direct RL env that
implements contact-rich manipulation tasks including peg insertion,
gear meshing, and nut threading.


0.10.15 (2024-12-16)
~~~~~~~~~~~~~~~~~~~~

Added
^^^^^

* Added ``Isaac-Reach-Franka-OSC-v0`` and ``Isaac-Reach-Franka-OSC-Play-v0``
variations of the manager based reach environment that uses
:class:`omni.isaac.lab.envs.mdp.actions.OperationalSpaceControllerAction`.
Expand All @@ -20,6 +32,7 @@ Added
* Added ``Isaac-Stack-Cube-Franka-IK-Rel-v0`` and ``Isaac-Stack-Cube-Instance-Randomize-Franka-IK-Rel-v0`` environments
as manager-based RL envs that implement a three cube stacking task.


0.10.13 (2024-10-30)
~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -49,6 +62,7 @@ Added

* Added feature extracted observation cartpole examples.


0.10.10 (2024-10-25)
~~~~~~~~~~~~~~~~~~~~

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

import gymnasium as gym

from . import agents
from .factory_env import FactoryEnv
from .factory_env_cfg import FactoryTaskGearMeshCfg, FactoryTaskNutThreadCfg, FactoryTaskPegInsertCfg

##
# Register Gym environments.
##

gym.register(
id="Isaac-Factory-PegInsert-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.factory:FactoryEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": FactoryTaskPegInsertCfg,
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
},
)

gym.register(
id="Isaac-Factory-GearMesh-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.factory:FactoryEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": FactoryTaskGearMeshCfg,
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
},
)

gym.register(
id="Isaac-Factory-NutThread-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.factory:FactoryEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": FactoryTaskNutThreadCfg,
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
params:
seed: 0
algo:
name: a2c_continuous

env:
clip_actions: 1.0

model:
name: continuous_a2c_logstd

network:
name: actor_critic
separate: False

space:
continuous:
mu_activation: None
sigma_activation: None
mu_init:
name: default
sigma_init:
name: const_initializer
val: 0
fixed_sigma: False
mlp:
units: [512, 128, 64]
activation: elu
d2rl: False

initializer:
name: default
regularizer:
name: None

rnn:
name: lstm
units: 1024
layers: 2
before_mlp: True
concat_input: True
layer_norm: True

load_checkpoint: False
load_path: ""

config:
name: Factory
device: cuda:0
full_experiment_name: test
env_name: rlgpu
multi_gpu: False
ppo: True
mixed_precision: True
normalize_input: True
normalize_value: True
value_bootstrap: True
num_actors: 128
reward_shaper:
scale_value: 1.0
normalize_advantage: True
gamma: 0.995
tau: 0.95
learning_rate: 1.0e-4
lr_schedule: adaptive
schedule_type: standard
kl_threshold: 0.008
score_to_win: 20000
max_epochs: 200
save_best_after: 10
save_frequency: 100
print_stats: True
grad_norm: 1.0
entropy_coef: 0.0 # 0.0001 # 0.0
truncate_grads: True
e_clip: 0.2
horizon_length: 128
minibatch_size: 512 # batch size = num_envs * horizon_length; minibatch_size = batch_size / num_minibatches
mini_epochs: 4
critic_coef: 2
clip_value: True
seq_length: 128
bounds_loss_coef: 0.0001

central_value_config:
minibatch_size: 512
mini_epochs: 4
learning_rate: 1e-4
lr_schedule: adaptive
kl_threshold: 0.008
clip_value: True
normalize_input: True
truncate_grads: True

network:
name: actor_critic
central_value: True

mlp:
units: [512, 128, 64]
activation: elu
d2rl: False

initializer:
name: default
regularizer:
name: None

rnn:
name: lstm
units: 1024
layers: 2
before_mlp: True
concat_input: True
layer_norm: True

player:
deterministic: False
Loading

0 comments on commit 3c55db4

Please sign in to comment.