Skip to content

Commit

Permalink
Update xr import logic, update FrankaLeap
Browse files Browse the repository at this point in the history
  • Loading branch information
wensi-ai committed Nov 20, 2023
1 parent ca024ce commit e2295a4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
1 change: 0 additions & 1 deletion omnigibson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion omnigibson/robots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 24 additions & 3 deletions omnigibson/robots/franka_leap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class FrankaLeap(ManipulationRobot):
"""
Franka Robot with Leap hand
Franka Robot with Leap right hand
"""

def __init__(
Expand Down Expand Up @@ -193,15 +193,15 @@ 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):
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_leap.urdf")
return os.path.join(gm.ASSET_PATH, "models/franka/franka_panda_leap.urdf")

@property
def gripper_urdf_path(self):
Expand All @@ -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")
4 changes: 4 additions & 0 deletions omnigibson/utils/xr_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2295a4

Please sign in to comment.