diff --git a/examples/learning_rl/IsaacGym_RofuncRL/example_FrankaCubeStack_RofuncRL.py b/examples/learning_rl/IsaacGym_RofuncRL/example_FrankaCubeStack_RofuncRL.py index a33b6041..c2e28aff 100644 --- a/examples/learning_rl/IsaacGym_RofuncRL/example_FrankaCubeStack_RofuncRL.py +++ b/examples/learning_rl/IsaacGym_RofuncRL/example_FrankaCubeStack_RofuncRL.py @@ -1,8 +1,8 @@ """ -FrankaCabinet (RofuncRL) +FrankaCubeStack (RofuncRL) ======================= -Open drawers with a Franka robot, trained by RofuncRL +FrankaCubeStack, trained by RofuncRL """ import isaacgym @@ -94,7 +94,7 @@ def inference(custom_args): parser.add_argument("--num_envs", type=int, default=4096) parser.add_argument("--device_id", type=int, default=gpu_id) parser.add_argument("--rl_device", type=str, default=f"cuda:{gpu_id}") - parser.add_argument("--headless", type=str, default="False") + parser.add_argument("--headless", type=str, default="True") 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() diff --git a/rofunc/learning/RofuncRL/tasks/__init__.py b/rofunc/learning/RofuncRL/tasks/__init__.py index 6ea0a477..ab0ff7dc 100644 --- a/rofunc/learning/RofuncRL/tasks/__init__.py +++ b/rofunc/learning/RofuncRL/tasks/__init__.py @@ -2,23 +2,23 @@ class Tasks: def __init__(self, env_type="isaacgym"): if env_type == "isaacgym": # Isaac Gym tasks - from .ant import AntTask - from .cartpole import CartpoleTask - from .curi_cabinet import CURICabinetTask - from .curi_cabinet_image import CURICabinetImageTask - from .curi_cabinet_bimanual import CURICabinetBimanualTask - from .curi_coffee_stirring import CURICoffeeStirringTask - from .franka_cabinet import FrankaCabinetTask - from .franka_cube_stack import FrankaCubeStackTask - from .humanoid import HumanoidTask - from .humanoid_amp import HumanoidAMPTask - from .ase.humanoid_amp_getup import HumanoidAMPGetupTask - from .ase.humanoid_perturb import HumanoidPerturbTask - from .ase.humanoid_heading import HumanoidHeadingTask - from .ase.humanoid_location import HumanoidLocationTask - from .ase.humanoid_reach import HumanoidReachTask - from .ase.humanoid_strike import HumanoidStrikeTask - from .ase.humanoid_view_motion import HumanoidViewMotionTask + from .isaacgym.ant import AntTask + from .isaacgym.cartpole import CartpoleTask + from .isaacgym.curi_cabinet import CURICabinetTask + from .isaacgym.curi_cabinet_image import CURICabinetImageTask + from .isaacgym.curi_cabinet_bimanual import CURICabinetBimanualTask + from .isaacgym.curi_coffee_stirring import CURICoffeeStirringTask + from .isaacgym.franka_cabinet import FrankaCabinetTask + from .isaacgym.franka_cube_stack import FrankaCubeStackTask + from .isaacgym.humanoid import HumanoidTask + from .isaacgym.humanoid_amp import HumanoidAMPTask + from .isaacgym.ase.humanoid_amp_getup import HumanoidAMPGetupTask + from .isaacgym.ase.humanoid_perturb import HumanoidPerturbTask + from .isaacgym.ase.humanoid_heading import HumanoidHeadingTask + from .isaacgym.ase.humanoid_location import HumanoidLocationTask + from .isaacgym.ase.humanoid_reach import HumanoidReachTask + from .isaacgym.ase.humanoid_strike import HumanoidStrikeTask + from .isaacgym.ase.humanoid_view_motion import HumanoidViewMotionTask self.task_map = { "Ant": AntTask, diff --git a/rofunc/learning/RofuncRL/tasks/ase/__init__.py b/rofunc/learning/RofuncRL/tasks/isaacgym/__init__.py similarity index 100% rename from rofunc/learning/RofuncRL/tasks/ase/__init__.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/__init__.py diff --git a/rofunc/learning/RofuncRL/tasks/amp/__init__.py b/rofunc/learning/RofuncRL/tasks/isaacgym/amp/__init__.py similarity index 100% rename from rofunc/learning/RofuncRL/tasks/amp/__init__.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/amp/__init__.py diff --git a/rofunc/learning/RofuncRL/tasks/amp/humanoid_amp_base.py b/rofunc/learning/RofuncRL/tasks/isaacgym/amp/humanoid_amp_base.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/amp/humanoid_amp_base.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/amp/humanoid_amp_base.py index eef04175..af69fa1a 100644 --- a/rofunc/learning/RofuncRL/tasks/amp/humanoid_amp_base.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/amp/humanoid_amp_base.py @@ -33,7 +33,7 @@ from isaacgym import gymtorch from rofunc.utils.oslab.path import get_rofunc_path -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils import * DOF_BODY_IDS = [1, 2, 3, 4, 6, 7, 9, 10, 11, 12, 13, 14] diff --git a/rofunc/learning/RofuncRL/tasks/amp/motion_lib.py b/rofunc/learning/RofuncRL/tasks/isaacgym/amp/motion_lib.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/amp/motion_lib.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/amp/motion_lib.py index d5ec49d6..e191a7ff 100644 --- a/rofunc/learning/RofuncRL/tasks/amp/motion_lib.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/amp/motion_lib.py @@ -32,7 +32,7 @@ from rofunc.utils.datalab.poselib.poselib.skeleton.skeleton3d import SkeletonMotion from rofunc.utils.datalab.poselib.poselib.core import quat_mul_norm, quat_inverse, quat_angle_axis -from rofunc.learning.RofuncRL.tasks.amp.humanoid_amp_base import DOF_BODY_IDS, DOF_OFFSETS +from rofunc.learning.RofuncRL.tasks.isaacgym.amp.humanoid_amp_base import DOF_BODY_IDS, DOF_OFFSETS from rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils import * diff --git a/rofunc/learning/RofuncRL/tasks/ant.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ant.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/ant.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ant.py index 548bdaed..d01bf0af 100644 --- a/rofunc/learning/RofuncRL/tasks/ant.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ant.py @@ -31,7 +31,7 @@ from isaacgym import gymapi from isaacgym import gymtorch -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils import * from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/anymal.py b/rofunc/learning/RofuncRL/tasks/isaacgym/anymal.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/anymal.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/anymal.py index 91abec1d..7c267d57 100644 --- a/rofunc/learning/RofuncRL/tasks/anymal.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/anymal.py @@ -33,7 +33,7 @@ from isaacgym import gymtorch from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask class Anymal(VecTask): diff --git a/rofunc/learning/RofuncRL/tasks/anymal_terrain.py b/rofunc/learning/RofuncRL/tasks/isaacgym/anymal_terrain.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/anymal_terrain.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/anymal_terrain.py index 03844e01..f6c5a049 100644 --- a/rofunc/learning/RofuncRL/tasks/anymal_terrain.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/anymal_terrain.py @@ -31,7 +31,7 @@ from isaacgym import gymtorch from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask class AnymalTerrain(VecTask): diff --git a/rofunc/learning/RofuncRL/tasks/isaacgym/ase/__init__.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid.py index 858bdfe5..717acc3c 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid.py @@ -33,7 +33,7 @@ from isaacgym.torch_utils import * from rofunc.utils.oslab.path import get_rofunc_path -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.learning.RofuncRL.tasks.utils import torch_jit_utils as torch_utils diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_amp.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp.py index fd1a030a..0df6a7ff 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp.py @@ -33,8 +33,8 @@ from isaacgym.torch_utils import * import rofunc as rf -from rofunc.learning.RofuncRL.tasks.ase.motion_lib import MotionLib -from rofunc.learning.RofuncRL.tasks.ase.humanoid import Humanoid, dof_to_obs +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.motion_lib import MotionLib +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid import Humanoid, dof_to_obs from rofunc.learning.RofuncRL.tasks.utils import torch_jit_utils as torch_utils diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp_getup.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp_getup.py similarity index 98% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_amp_getup.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp_getup.py index 4013cd57..84a71315 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp_getup.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp_getup.py @@ -29,7 +29,7 @@ from isaacgym import gymtorch from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.ase.humanoid_amp import HumanoidAMP +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid_amp import HumanoidAMP class HumanoidAMPGetupTask(HumanoidAMP): diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp_task.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp_task.py similarity index 97% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_amp_task.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp_task.py index 5f1564ed..e4ebe7d5 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_amp_task.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_amp_task.py @@ -28,7 +28,7 @@ import torch -from rofunc.learning.RofuncRL.tasks.ase.humanoid_amp import HumanoidAMP +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid_amp import HumanoidAMP class HumanoidAMPTask(HumanoidAMP): diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_heading.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_heading.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_heading.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_heading.py index 95ad73b1..47bf23bc 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_heading.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_heading.py @@ -32,7 +32,7 @@ from isaacgym.torch_utils import * from rofunc.utils.oslab.path import get_rofunc_path -from rofunc.learning.RofuncRL.tasks.ase.humanoid_amp_task import HumanoidAMPTask +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid_amp_task import HumanoidAMPTask from rofunc.learning.RofuncRL.tasks.utils import torch_jit_utils as torch_utils TAR_ACTOR_ID = 1 diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_location.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_location.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_location.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_location.py index 74902b75..6e1189a2 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_location.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_location.py @@ -32,7 +32,7 @@ from isaacgym.torch_utils import * from rofunc.utils.oslab.path import get_rofunc_path -from rofunc.learning.RofuncRL.tasks.ase.humanoid_amp_task import HumanoidAMPTask +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid_amp_task import HumanoidAMPTask from rofunc.learning.RofuncRL.tasks.utils import torch_jit_utils as torch_utils diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_perturb.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_perturb.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_perturb.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_perturb.py index 21c9d0a3..65e9635d 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_perturb.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_perturb.py @@ -32,7 +32,7 @@ from isaacgym.torch_utils import * from rofunc.utils.oslab.path import get_rofunc_path -from rofunc.learning.RofuncRL.tasks.ase.humanoid_amp import HumanoidAMP +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid_amp import HumanoidAMP # import env.tasks.humanoid_amp_getup as humanoid_amp_getup # # import env.tasks.humanoid_strike as humanoid_strike diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_reach.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_reach.py similarity index 98% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_reach.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_reach.py index 02fdf3f2..3f21683b 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_reach.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_reach.py @@ -32,7 +32,7 @@ from isaacgym.torch_utils import * from rofunc.utils.oslab.path import get_rofunc_path -from rofunc.learning.RofuncRL.tasks.ase.humanoid_amp_task import HumanoidAMPTask +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid_amp_task import HumanoidAMPTask from rofunc.learning.RofuncRL.tasks.utils import torch_jit_utils as torch_utils diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_strike.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_strike.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_strike.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_strike.py index f0504526..46e59934 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_strike.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_strike.py @@ -32,7 +32,7 @@ from isaacgym.torch_utils import * from rofunc.utils.oslab.path import get_rofunc_path -from rofunc.learning.RofuncRL.tasks.ase.humanoid_amp_task import HumanoidAMPTask +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid_amp_task import HumanoidAMPTask from rofunc.learning.RofuncRL.tasks.utils import torch_jit_utils as torch_utils diff --git a/rofunc/learning/RofuncRL/tasks/ase/humanoid_view_motion.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_view_motion.py similarity index 98% rename from rofunc/learning/RofuncRL/tasks/ase/humanoid_view_motion.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_view_motion.py index d448bef9..35d2123e 100644 --- a/rofunc/learning/RofuncRL/tasks/ase/humanoid_view_motion.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/humanoid_view_motion.py @@ -28,9 +28,9 @@ import torch -from isaacgym import gymtorch, gymapi +from isaacgym import gymtorch -from rofunc.learning.RofuncRL.tasks.ase.humanoid_amp import HumanoidAMP +from rofunc.learning.RofuncRL.tasks.isaacgym.ase.humanoid_amp import HumanoidAMP class HumanoidViewMotionTask(HumanoidAMP): diff --git a/rofunc/learning/RofuncRL/tasks/ase/motion_lib.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ase/motion_lib.py similarity index 100% rename from rofunc/learning/RofuncRL/tasks/ase/motion_lib.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ase/motion_lib.py diff --git a/rofunc/learning/RofuncRL/tasks/base/__init__.py b/rofunc/learning/RofuncRL/tasks/isaacgym/base/__init__.py similarity index 100% rename from rofunc/learning/RofuncRL/tasks/base/__init__.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/base/__init__.py diff --git a/rofunc/learning/RofuncRL/tasks/base/curi_base_task.py b/rofunc/learning/RofuncRL/tasks/isaacgym/base/curi_base_task.py similarity index 98% rename from rofunc/learning/RofuncRL/tasks/base/curi_base_task.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/base/curi_base_task.py index 09f121f6..ec80ce55 100644 --- a/rofunc/learning/RofuncRL/tasks/base/curi_base_task.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/base/curi_base_task.py @@ -15,7 +15,7 @@ from isaacgym import gymtorch, gymapi from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask class CURIBaseTask(VecTask): diff --git a/rofunc/learning/RofuncRL/tasks/base/dr_utils.py b/rofunc/learning/RofuncRL/tasks/isaacgym/base/dr_utils.py similarity index 100% rename from rofunc/learning/RofuncRL/tasks/base/dr_utils.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/base/dr_utils.py diff --git a/rofunc/learning/RofuncRL/tasks/base/vec_task.py b/rofunc/learning/RofuncRL/tasks/isaacgym/base/vec_task.py similarity index 97% rename from rofunc/learning/RofuncRL/tasks/base/vec_task.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/base/vec_task.py index 243d1ba7..13c81332 100644 --- a/rofunc/learning/RofuncRL/tasks/base/vec_task.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/base/vec_task.py @@ -31,8 +31,8 @@ import gym from gym import spaces -from isaacgym import gymtorch, gymapi -from rofunc.learning.RofuncRL.tasks.base.dr_utils import ( +from isaacgym import gymapi +from rofunc.learning.RofuncRL.tasks.isaacgym.base.dr_utils import ( get_property_setter_map, get_property_getter_map, get_default_setter_args, diff --git a/rofunc/learning/RofuncRL/tasks/cartpole.py b/rofunc/learning/RofuncRL/tasks/isaacgym/cartpole.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/cartpole.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/cartpole.py index 74ee9558..b929e8ff 100644 --- a/rofunc/learning/RofuncRL/tasks/cartpole.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/cartpole.py @@ -32,7 +32,7 @@ import torch from isaacgym import gymtorch, gymapi -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/curi_cabinet.py b/rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/curi_cabinet.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet.py index 7edad6d1..18c8d16f 100644 --- a/rofunc/learning/RofuncRL/tasks/curi_cabinet.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet.py @@ -17,7 +17,7 @@ from isaacgym import gymtorch, gymapi from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.base.curi_base_task import CURIBaseTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.curi_base_task import CURIBaseTask from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/curi_cabinet_bimanual.py b/rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet_bimanual.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/curi_cabinet_bimanual.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet_bimanual.py index 0d1d3f2d..721fd9be 100644 --- a/rofunc/learning/RofuncRL/tasks/curi_cabinet_bimanual.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet_bimanual.py @@ -17,7 +17,7 @@ from isaacgym import gymtorch, gymapi from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.base.curi_base_task import CURIBaseTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.curi_base_task import CURIBaseTask from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/curi_cabinet_image.py b/rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet_image.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/curi_cabinet_image.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet_image.py index 1b13b39f..9fccc69a 100644 --- a/rofunc/learning/RofuncRL/tasks/curi_cabinet_image.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/curi_cabinet_image.py @@ -18,8 +18,8 @@ from isaacgym.torch_utils import * import rofunc as rf -from rofunc.learning.RofuncRL.tasks.base.curi_base_task import CURIBaseTask -from rofunc.learning.RofuncRL.tasks.curi_cabinet import CURICabinetTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.curi_base_task import CURIBaseTask +from rofunc.learning.RofuncRL.tasks.isaacgym.curi_cabinet import CURICabinetTask from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/curi_coffee_stirring.py b/rofunc/learning/RofuncRL/tasks/isaacgym/curi_coffee_stirring.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/curi_coffee_stirring.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/curi_coffee_stirring.py index dab3bb30..8e5d5f51 100644 --- a/rofunc/learning/RofuncRL/tasks/curi_coffee_stirring.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/curi_coffee_stirring.py @@ -17,7 +17,7 @@ from isaacgym import gymtorch, gymapi from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/franka_cabinet.py b/rofunc/learning/RofuncRL/tasks/isaacgym/franka_cabinet.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/franka_cabinet.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/franka_cabinet.py index eb73e8ce..2f64b307 100644 --- a/rofunc/learning/RofuncRL/tasks/franka_cabinet.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/franka_cabinet.py @@ -31,7 +31,7 @@ from isaacgym import gymtorch, gymapi from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/franka_cube_stack.py b/rofunc/learning/RofuncRL/tasks/isaacgym/franka_cube_stack.py similarity index 98% rename from rofunc/learning/RofuncRL/tasks/franka_cube_stack.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/franka_cube_stack.py index 72f871e5..227d19c2 100644 --- a/rofunc/learning/RofuncRL/tasks/franka_cube_stack.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/franka_cube_stack.py @@ -31,22 +31,13 @@ from isaacgym import gymapi from isaacgym import gymtorch -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils import * from rofunc.utils.oslab.path import get_rofunc_path @torch.jit.script def axisangle2quat(vec, eps=1e-6): - """ - Converts scaled axis-angle to quat. - Args: - vec (tensor): (..., 3) tensor where final dim is (ax,ay,az) axis-angle exponential coordinates - eps (float): Stability value below which small values will be mapped to 0 - - Returns: - tensor: (..., 4) tensor where final dim is (x,y,z,w) vec4 float quaternion - """ # type: (Tensor, float) -> Tensor # store input shape and reshape input_shape = vec.shape[:-1] diff --git a/rofunc/learning/RofuncRL/tasks/furniture.py b/rofunc/learning/RofuncRL/tasks/isaacgym/furniture.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/furniture.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/furniture.py index 454ec295..54cd506b 100644 --- a/rofunc/learning/RofuncRL/tasks/furniture.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/furniture.py @@ -15,8 +15,8 @@ import yaml import mujoco_py -from . import transform_utils as T -from .base import EnvMeta +from rofunc.learning.RofuncRL.tasks import transform_utils as T +from rofunc.learning.RofuncRL.tasks.isaacgym.base import EnvMeta from .image_utils import color_segmentation from .mjcf_utils import xml_path_completion from .models import ( diff --git a/rofunc/learning/RofuncRL/tasks/furniture_baxter.py b/rofunc/learning/RofuncRL/tasks/isaacgym/furniture_baxter.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/furniture_baxter.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/furniture_baxter.py index e526c985..fb18bdce 100644 --- a/rofunc/learning/RofuncRL/tasks/furniture_baxter.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/furniture_baxter.py @@ -5,7 +5,7 @@ import numpy as np import gym.spaces -from . import transform_utils as T +from rofunc.learning.RofuncRL.tasks import transform_utils as T from .furniture import FurnitureEnv from ..util.logger import logger diff --git a/rofunc/learning/RofuncRL/tasks/humanoid.py b/rofunc/learning/RofuncRL/tasks/isaacgym/humanoid.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/humanoid.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/humanoid.py index 11ea7812..57fce9e4 100644 --- a/rofunc/learning/RofuncRL/tasks/humanoid.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/humanoid.py @@ -31,7 +31,7 @@ from isaacgym import gymapi from isaacgym import gymtorch -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils import * from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/humanoid_amp.py b/rofunc/learning/RofuncRL/tasks/isaacgym/humanoid_amp.py similarity index 98% rename from rofunc/learning/RofuncRL/tasks/humanoid_amp.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/humanoid_amp.py index a32b1bf5..a9b707c9 100644 --- a/rofunc/learning/RofuncRL/tasks/humanoid_amp.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/humanoid_amp.py @@ -33,8 +33,8 @@ from isaacgym import gymtorch import rofunc as rf -from rofunc.learning.RofuncRL.tasks.amp.humanoid_amp_base import HumanoidAMPBase, dof_to_obs -from rofunc.learning.RofuncRL.tasks.amp.motion_lib import MotionLib +from rofunc.learning.RofuncRL.tasks.isaacgym.amp.humanoid_amp_base import HumanoidAMPBase, dof_to_obs +from rofunc.learning.RofuncRL.tasks.isaacgym.amp.motion_lib import MotionLib from rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils import * NUM_AMP_OBS_PER_STEP = 13 + 52 + 28 + 12 # [root_h, root_rot, root_vel, root_ang_vel, dof_pos, dof_vel, key_body_pos] diff --git a/rofunc/learning/RofuncRL/tasks/ikea.py b/rofunc/learning/RofuncRL/tasks/isaacgym/ikea.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/ikea.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/ikea.py index 521f1565..01b95367 100644 --- a/rofunc/learning/RofuncRL/tasks/ikea.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/ikea.py @@ -17,7 +17,7 @@ from isaacgym import gymtorch, gymapi from isaacgym.torch_utils import * -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.utils.oslab.path import get_rofunc_path diff --git a/rofunc/learning/RofuncRL/tasks/shadow_hand.py b/rofunc/learning/RofuncRL/tasks/isaacgym/shadow_hand.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/shadow_hand.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/shadow_hand.py index 8206a5ae..8fae56ba 100644 --- a/rofunc/learning/RofuncRL/tasks/shadow_hand.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/shadow_hand.py @@ -31,7 +31,7 @@ from isaacgym import gymapi from isaacgym import gymtorch -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils import * diff --git a/rofunc/learning/RofuncRL/tasks/trifinger.py b/rofunc/learning/RofuncRL/tasks/isaacgym/trifinger.py similarity index 99% rename from rofunc/learning/RofuncRL/tasks/trifinger.py rename to rofunc/learning/RofuncRL/tasks/isaacgym/trifinger.py index d5d4aa83..68313f99 100644 --- a/rofunc/learning/RofuncRL/tasks/trifinger.py +++ b/rofunc/learning/RofuncRL/tasks/isaacgym/trifinger.py @@ -32,10 +32,10 @@ from isaacgym import gymapi from isaacgym import gymtorch -project_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +project_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')) from rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils import * -from rofunc.learning.RofuncRL.tasks.base.vec_task import VecTask +from rofunc.learning.RofuncRL.tasks.isaacgym.base.vec_task import VecTask from types import SimpleNamespace from collections import deque @@ -175,7 +175,7 @@ def __compute(self): class Trifinger(VecTask): # constants # directory where assets for the simulator are present - _trifinger_assets_dir = os.path.join(project_dir, "../", "assets", "trifinger") + _trifinger_assets_dir = os.path.join(project_dir, "../../", "assets", "trifinger") # robot urdf (path relative to `_trifinger_assets_dir`) _robot_urdf_file = "robot_properties_fingers/urdf/pro/trifingerpro.urdf" # stage urdf (path relative to `_trifinger_assets_dir`)