Skip to content

Commit

Permalink
Remove tuck/untuck for Franka
Browse files Browse the repository at this point in the history
  • Loading branch information
wensi-ai committed Oct 16, 2023
1 parent f00ad62 commit e5ba3db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 47 deletions.
25 changes: 1 addition & 24 deletions omnigibson/robots/franka.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
from omnigibson.robots.manipulation_robot import ManipulationRobot


RESET_JOINT_OPTIONS = {
"tuck",
"untuck",
}


class FrankaPanda(ManipulationRobot):
"""
The Franka Emika Panda robot
Expand Down Expand Up @@ -97,15 +91,6 @@ def __init__(
kwargs (dict): Additional keyword arguments that are used for other super() calls from subclasses, allowing
for flexible compositions of various object subclasses (e.g.: Robot is USDObject + ControllableObject).
"""
# Parse reset joint pos if specifying special string
if isinstance(reset_joint_pos, str):
assert (
reset_joint_pos in RESET_JOINT_OPTIONS
), "reset_joint_pos should be one of {} if using a string!".format(RESET_JOINT_OPTIONS)
reset_joint_pos = (
self.tucked_default_joint_pos if reset_joint_pos == "tuck" else self.untucked_default_joint_pos
)

# Run super init
super().__init__(
prim_path=prim_path,
Expand Down Expand Up @@ -135,14 +120,6 @@ def __init__(
def model_name(self):
return "FrankaPanda"

@property
def tucked_default_joint_pos(self):
return np.zeros(9)

@property
def untucked_default_joint_pos(self):
return np.array([0.00, -1.3, 0.00, -2.87, 0.00, 2.00, 0.75, 0.00, 0.00])

@property
def discrete_action_list(self):
# Not supported for this robot
Expand Down Expand Up @@ -181,7 +158,7 @@ def _default_controllers(self):

@property
def default_joint_pos(self):
return self.untucked_default_joint_pos
return np.array([0.00, -1.3, 0.00, -2.87, 0.00, 2.00, 0.75, 0.00, 0.00])

@property
def finger_lengths(self):
Expand Down
25 changes: 2 additions & 23 deletions omnigibson/robots/franka_allegro.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
from omnigibson.macros import gm
from omnigibson.robots.manipulation_robot import ManipulationRobot

RESET_JOINT_OPTIONS = {
"tuck",
"untuck",
}


class FrankaAllegro(ManipulationRobot):
"""
Expand Down Expand Up @@ -96,14 +91,6 @@ def __init__(
kwargs (dict): Additional keyword arguments that are used for other super() calls from subclasses, allowing
for flexible compositions of various object subclasses (e.g.: Robot is USDObject + ControllableObject).
"""
# Parse reset joint pos if specifying special string
if isinstance(reset_joint_pos, str):
assert (
reset_joint_pos in RESET_JOINT_OPTIONS
), "reset_joint_pos should be one of {} if using a string!".format(RESET_JOINT_OPTIONS)
reset_joint_pos = (
self.tucked_default_joint_pos if reset_joint_pos == "tuck" else self.untucked_default_joint_pos
)

# Run super init
super().__init__(
Expand Down Expand Up @@ -134,15 +121,6 @@ def __init__(
def model_name(self):
return "FrankaAllegro"

@property
def tucked_default_joint_pos(self):
return np.zeros(23)

@property
def untucked_default_joint_pos(self):
# position where the hand is parallel to the ground
return np.r_[[0.86, -0.27, -0.68, -1.52, -0.18, 1.29, 1.72], np.zeros(16)]

@property
def discrete_action_list(self):
# Not supported for this robot
Expand Down Expand Up @@ -187,7 +165,8 @@ def _default_controllers(self):

@property
def default_joint_pos(self):
return self.untucked_default_joint_pos
# position where the hand is parallel to the ground
return np.r_[[0.86, -0.27, -0.68, -1.52, -0.18, 1.29, 1.72], np.zeros(16)]

@property
def finger_lengths(self):
Expand Down

0 comments on commit e5ba3db

Please sign in to comment.