From e2295a409a9f6d71958e5ef7c76a450b4ad8239c Mon Sep 17 00:00:00 2001 From: vince-ai Date: Mon, 20 Nov 2023 12:47:46 -0800 Subject: [PATCH] Update xr import logic, update FrankaLeap --- omnigibson/__init__.py | 1 - omnigibson/robots/__init__.py | 2 +- omnigibson/robots/franka_leap.py | 27 ++++++++++++++++++++++++--- omnigibson/utils/xr_utils.py | 4 ++++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/omnigibson/__init__.py b/omnigibson/__init__.py index 3412380d80..b25689a46e 100644 --- a/omnigibson/__init__.py +++ b/omnigibson/__init__.py @@ -86,7 +86,6 @@ def create_app(): from omni.isaac.core.utils.extensions import enable_extension enable_extension("omni.flowusd") enable_extension("omni.particle.system.bundle") - enable_extension("omni.kit.xr.profile.vr") # Additional import for windows if os.name == "nt": diff --git a/omnigibson/robots/__init__.py b/omnigibson/robots/__init__.py index 44cf5a0c72..bb106ad8c0 100644 --- a/omnigibson/robots/__init__.py +++ b/omnigibson/robots/__init__.py @@ -11,5 +11,5 @@ from omnigibson.robots.two_wheel_robot import TwoWheelRobot from omnigibson.robots.franka import FrankaPanda from omnigibson.robots.franka_allegro import FrankaAllegro -from omnigibson.robots.franka_leap import FrankaLeap +from omnigibson.robots.franka_leap import FrankaLeap, FrankaLeapLeft from omnigibson.robots.behaviorbot import Behaviorbot diff --git a/omnigibson/robots/franka_leap.py b/omnigibson/robots/franka_leap.py index 4df54b1841..7595e046cd 100644 --- a/omnigibson/robots/franka_leap.py +++ b/omnigibson/robots/franka_leap.py @@ -9,7 +9,7 @@ class FrankaLeap(ManipulationRobot): """ - Franka Robot with Leap hand + Franka Robot with Leap right hand """ def __init__( @@ -193,7 +193,7 @@ def finger_joint_names(self): @property def usd_path(self): - return os.path.join(gm.ASSET_PATH, "models/franka/franka_leap.usd") + return os.path.join(gm.ASSET_PATH, "models/franka/franka_panda_leap.usd") @property def robot_arm_descriptor_yamls(self): @@ -201,7 +201,7 @@ def robot_arm_descriptor_yamls(self): @property def urdf_path(self): - return os.path.join(gm.ASSET_PATH, "models/franka/franka_leap.urdf") + return os.path.join(gm.ASSET_PATH, "models/franka/franka_panda_leap.urdf") @property def gripper_urdf_path(self): @@ -217,3 +217,24 @@ def gen_action_from_vr_data(self, vr_data: dict): action[:6] = action_from_controller[:6] action[6:] = action_from_controller[6] return action + + +class FrankaLeapLeft(FrankaLeap): + """ + Franka Robot with Leap left hand + """ + @property + def model_name(self): + return "FrankaLeapLeft" + + @property + def usd_path(self): + return os.path.join(gm.ASSET_PATH, "models/franka/franka_panda_leap_left.usd") + + @property + def robot_arm_descriptor_yamls(self): + return {self.default_arm: os.path.join(gm.ASSET_PATH, "models/franka/franka_leap_description.yaml")} + + @property + def urdf_path(self): + return os.path.join(gm.ASSET_PATH, "models/franka/franka_panda_leap_left.urdf") \ No newline at end of file diff --git a/omnigibson/utils/xr_utils.py b/omnigibson/utils/xr_utils.py index a6b9d0d8d6..1dbfe485ce 100644 --- a/omnigibson/utils/xr_utils.py +++ b/omnigibson/utils/xr_utils.py @@ -33,6 +33,10 @@ def __init__( NOTE: enable_touchpad_movement and align_anchor_to_robot_base cannot be enabled at the same time. The former is to enable free movement of the VR system (i.e. the user), while the latter is constraining the VR system to the robot pose. """ + # enable xr extension + from omni.isaac.core.utils.extensions import enable_extension + enable_extension("omni.kit.xr.profile.vr") + # get xr core and profile self.xr_core = XRCore.get_singleton() self.vr_profile = self.xr_core.get_profile("vr") self.disable_display_output = disable_display_output