Skip to content

Commit

Permalink
🚀 [RofuncRL] CURI Synergy-based Softhand grasping tasks are supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylark0924 committed Jan 28, 2024
1 parent 41d1338 commit 2872f12
Show file tree
Hide file tree
Showing 33 changed files with 208 additions and 6,507 deletions.
83 changes: 42 additions & 41 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
> - 🎉 for event celebrations
## Update News 🎉🎉🎉
- [2024-01-24] 🚀 [CURI Synergy-based Softhand grasping tasks](https://github.com/Skylark0924/Rofunc/blob/main/examples/learning_rl/IsaacGym_RofuncRL/example_DexterousHands_RofuncRL.py) are supported to be trained by `RofuncRL`.
- [2023-12-24] 🚀 [Dexterous hand (Shadow Hand, Allegro Hand, qbSofthand) tasks](https://github.com/Skylark0924/Rofunc/blob/main/examples/learning_rl/IsaacGym_RofuncRL/example_DexterousHands_RofuncRL.py) are supported to be trained by `RofuncRL`.
- [2023-12-07] 🖼️ [EfficientSAM](https://yformer.github.io/efficient-sam/) is supported for high-speed segmentation on edge devices like Nvidia Jetson, check the [example](https://github.com/Skylark0924/Rofunc/blob/main/examples/visualab/example_efficient_sam_seg_w_prompt.py) in Visualab.
- [2023-12-04] 🖼️ [VLPart-SAM](https://github.com/Cheems-Seminar/grounded-segment-any-parts) is supported for part-level segmentation with text prompt, check the [example](https://github.com/Skylark0924/Rofunc/blob/main/examples/visualab/example_vlpart_sam_seg_w_prompt.py).
Expand Down
Binary file added doc/img/CURIQbSoftHandSynergyGraspHammer.gif
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 doc/img/CURIQbSoftHandSynergyGraspKnife.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 doc/img/CURIQbSoftHandSynergyGraspSpatula.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import isaacgym
import argparse
import datetime

from rofunc.config.utils import omegaconf_to_dict, get_config
from rofunc.learning.RofuncRL.tasks import Tasks
Expand All @@ -26,9 +27,10 @@ def train(custom_args):
"headless={}".format(custom_args.headless),
"num_envs={}".format(custom_args.num_envs)]
cfg = get_config('./learning/rl', 'config', args=args_overrides)
cfg.task.env.objectType = custom_args.object.lower()
if custom_args.task == "CURIQbSoftHandSynergyGrasp":
cfg.task.env.objectType = custom_args.object.lower()
cfg.train.Trainer.maximum_steps = 100000
cfg.train.Trainer.experiment_name = custom_args.object
cfg.train.Trainer.experiment_name = "{}_{}".format(custom_args.object, datetime.datetime.now().strftime("%y-%m-%d_%H-%M-%S-%f"))
cfg_dict = omegaconf_to_dict(cfg.task)

set_seed(cfg.train.Trainer.seed)
Expand All @@ -47,6 +49,8 @@ def train(custom_args):
env=env,
device=cfg.rl_device,
env_name=custom_args.task)
if custom_args.ckpt_path is not None:
trainer.agent.load_ckpt(custom_args.ckpt_path)

# Start training
trainer.train()
Expand All @@ -59,8 +63,13 @@ def inference(custom_args):
"device_id={}".format(custom_args.sim_device),
"rl_device=cuda:{}".format(custom_args.rl_device),
"headless={}".format(False),
"num_envs={}".format(16)]
"num_envs={}".format(1)]
cfg = get_config('./learning/rl', 'config', args=args_overrides)
if custom_args.task == "CURIQbSoftHandSynergyGrasp":
cfg.task.env.objectType = custom_args.object.lower()
cfg.train.Trainer.experiment_name = custom_args.object
cfg.train.Trainer.inference_steps = 10000

cfg_dict = omegaconf_to_dict(cfg.task)

set_seed(cfg.train.Trainer.seed)
Expand Down Expand Up @@ -102,13 +111,17 @@ def inference(custom_args):
# QbSoftHandGrasp, BiQbSoftHandGraspAndPlace, BiQbSoftHandSynergyGrasp, QbSoftHandSynergyGrasp
# ShadowHandGrasp, CURIQbSoftHandSynergyGrasp
parser.add_argument("--task", type=str, default="CURIQbSoftHandSynergyGrasp")
parser.add_argument("--object", type=str, default="Hammer")
# Available objects: Hammer, Spatula, Large_Clamp, Mug, Power_Drill, Knife, Scissors, Large_Marker, Phillips_Screw_Driver
# Only for CURIQbSoftHandSynergyGrasp
parser.add_argument("--object", type=str, default="Mug")
# Only for CURIQbSoftHandSynergyGrasp
parser.add_argument("--use_synergy", type=str, default="True")
parser.add_argument("--agent", type=str, default="ppo") # Available agents: ppo, sac, td3, a2c
parser.add_argument("--num_envs", type=int, default=1024)
parser.add_argument("--sim_device", type=int, default=0)
parser.add_argument("--rl_device", type=int, default=gpu_id)
parser.add_argument("--headless", type=str, default="False")
parser.add_argument("--inference", action="store_false", help="turn to inference mode while adding this argument")
parser.add_argument("--inference", action="store_true", help="turn to inference mode while adding this argument")
parser.add_argument("--ckpt_path", type=str, default=None)
custom_args = parser.parse_args()

Expand Down
9 changes: 4 additions & 5 deletions examples/learning_rl/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ The following are examples of reinforcement learning methods for robot learning.
-
-
-
* - `CURIQbSoftHandSynergyGrasp <https://github.com/Skylark0924/Rofunc/blob/main/rofunc/learning/RofuncRL/tasks/isaacgymenv/grasp/curi_qbhand_synergy_grasp.py>`_
- .. image:: ../../../img/CURIQbSoftHandSynergyGraspHammer.gif .. image:: ../../../img/CURIQbSoftHandSynergyGraspSpatula.gif .. image:: ../../../img/CURIQbSoftHandSynergyGraspPower_drill.gif .. image:: ../../../img/CURIQbSoftHandSynergyGraspPhillips_Screw_Driver.gif .. image:: ../../../img/CURIQbSoftHandSynergyGraspLarge_clamp.gif .. image:: ../../../img/CURIQbSoftHandSynergyGraspKnife.gif
-
- ✅
* - `Humanoid <https://github.com/Skylark0924/Rofunc/blob/main/rofunc/learning/RofuncRL/tasks/isaacgymenv/humanoid.py>`_
- .. image:: ../../../img/HumanoidRofuncRLPPO.gif
-
Expand Down Expand Up @@ -299,11 +303,6 @@ The following are examples of reinforcement learning methods for robot learning.
- ✅







.. tab:: OmniIsaacGym

.. tabs::
Expand Down
55 changes: 55 additions & 0 deletions rofunc/config/learning/model_zoo.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,61 @@
"name": "CURIQbSoftHandSynergyGraspHammerRofuncRLPPO.pth",
"md5": ""
},
"_CURIQbSoftHandSynergyGraspLarge_Clamp2RofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=1--hfNU1_o5x6tl2nb-lRJEzsEkcFD6_k&export=download",
"name": "CURIQbSoftHandSynergyGraspLarge_Clamp2RofuncRLPPO.pth",
"md5": ""
},
"CURIQbSoftHandSynergyGraspLarge_ClampRofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=1Se-ghKuTfYgPFK1rNXhyaNqejkCuwlZ6&export=download",
"name": "CURIQbSoftHandSynergyGraspLarge_ClampRofuncRLPPO.pth",
"md5": ""
},
"CURIQbSoftHandSynergyGraspPhillips_Screw_DriverRofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=1eM5m3qbhXIc9fZgI2AcFepwlcg7PAUEx&export=download",
"name": "CURIQbSoftHandSynergyGraspPhillips_Screw_DriverRofuncRLPPO.pth",
"md5": ""
},
"CURIQbSoftHandSynergyGraspLarge_MarkerRofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=1EeTB-8wQTizjB-17YUdpa1dpH6uw0cyQ&export=download",
"name": "CURIQbSoftHandSynergyGraspLarge_MarkerRofuncRLPPO.pth",
"md5": ""
},
"_CURIQbSoftHandSynergyGraspMug2RofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=1wI866QoCH8UTnh2X9SDeRh3pDH2R85-X&export=download",
"name": "CURIQbSoftHandSynergyGraspMug2RofuncRLPPO.pth",
"md5": ""
},
"_CURIQbSoftHandSynergyGraspMug3RofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=13KkV_d9CVNzFMksswRivVgvKf4DY3f4i&export=download",
"name": "CURIQbSoftHandSynergyGraspMug3RofuncRLPPO.pth",
"md5": ""
},
"CURIQbSoftHandSynergyGraspMugRofuncRLPPO.pth": {
"url": "",
"name": "CURIQbSoftHandSynergyGraspMugRofuncRLPPO.pth",
"md5": ""
},
"CURIQbSoftHandSynergyGraspPower_DrillRofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=1mxtw5GVEX_hDeGFTuXodeb5xBG2J5fBB&export=download",
"name": "CURIQbSoftHandSynergyGraspPower_DrillRofuncRLPPO.pth",
"md5": ""
},
"CURIQbSoftHandSynergyGraspKnifeRofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=1Nihlp3PaJtUzhQMsDl871z_0imhurY4M&export=download",
"name": "CURIQbSoftHandSynergyGraspKnifeRofuncRLPPO.pth",
"md5": ""
},
"CURIQbSoftHandSynergyGraspSpatulaRofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=15HdnTp_etpZFtp_b45cYoUFl8XLzsIbm&export=download",
"name": "CURIQbSoftHandSynergyGraspSpatulaRofuncRLPPO.pth",
"md5": ""
},
"CURIQbSoftHandSynergyGraspScissorsRofuncRLPPO.pth": {
"url": "https://drive.google.com/uc?id=1EeTB-8wQTizjB-17YUdpa1dpH6uw0cyQ&export=download",
"name": "CURIQbSoftHandSynergyGraspScissorsRofuncRLPPO.pth",
"md5": ""
},
"efficientsam_s_gpu.jit": {
"url": "https://drive.google.com/uc?id=1lMCUFOLeQOlIpuaIA00MB174lL7ZiuoS&export=download",
"name": "efficientsam_s_gpu.jit",
Expand Down
4 changes: 1 addition & 3 deletions rofunc/learning/RofuncRL/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def __init__(self, env_type="isaacgym"):
from .isaacgymenv.hands.bi_qbhand_synergy_grasp import BiQbSoftHandSynergyGraspTask
from .isaacgymenv.hands.qbhand_synergy_grasp import QbSoftHandSynergyGraspTask
from .isaacgymenv.hands.shadow_hand_grasp import ShadowHandGraspTask
from .isaacgymenv.grasp.lift_object import LiftObjectTask
from .isaacgymenv.hands.curi_qbhand_synergy_grasp import CURIQbSoftHandSynergyGraspTask
from .isaacgymenv.grasp.curi_qbhand_synergy_grasp import CURIQbSoftHandSynergyGraspTask

self.task_map = {
"Ant": AntTask,
Expand Down Expand Up @@ -92,7 +91,6 @@ def __init__(self, env_type="isaacgym"):
"BiQbSoftHandSynergyGrasp": BiQbSoftHandSynergyGraspTask,
"QbSoftHandSynergyGrasp": QbSoftHandSynergyGraspTask,
"ShadowHandGrasp": ShadowHandGraspTask,
"LiftObject": LiftObjectTask,
"CURIQbSoftHandSynergyGrasp": CURIQbSoftHandSynergyGraspTask,
}
elif env_type == "omniisaacgym":
Expand Down
Empty file.
Loading

0 comments on commit 2872f12

Please sign in to comment.