finshi press action
This commit is contained in:
@@ -49,9 +49,9 @@ class OmniObject:
|
||||
"direction": np.array([-1, 0, 0.3]),
|
||||
},
|
||||
],
|
||||
'click': {
|
||||
'press': {
|
||||
"part": "finger edge",
|
||||
"task": "click",
|
||||
"task": "press",
|
||||
"xyz": np.array([0, 0, 0]),
|
||||
"direction": np.array([0, 0, 1]),
|
||||
},
|
||||
@@ -80,7 +80,6 @@ class OmniObject:
|
||||
if "interaction" in obj_info:
|
||||
obj_info = obj_info
|
||||
interaction_info = obj_info["interaction"]
|
||||
part_joint_limits_info = obj_info.get("part_joint_limits", None)
|
||||
|
||||
else:
|
||||
|
||||
@@ -93,7 +92,6 @@ class OmniObject:
|
||||
obj_info = json.load(open(obj_info_file))
|
||||
interaction_data = json.load(open(interaction_label_file))
|
||||
interaction_info = interaction_data['interaction']
|
||||
part_joint_limits_info = interaction_data.get("part_joint_limits", None)
|
||||
|
||||
obj = cls(
|
||||
name=obj_info['object_id'],
|
||||
@@ -104,10 +102,9 @@ class OmniObject:
|
||||
if os.path.exists(mesh_file):
|
||||
obj_info['mesh_file'] = mesh_file
|
||||
|
||||
obj.part_joint_limits = part_joint_limits_info
|
||||
|
||||
''' Load interaction labels '''
|
||||
obj.part_ids = []
|
||||
|
||||
for type in ['active', 'passive']:
|
||||
if type not in interaction_info:
|
||||
continue
|
||||
@@ -197,15 +194,14 @@ class OmniObject:
|
||||
action_info[grasp_part] = grasp_data
|
||||
|
||||
interaction_info[type][action] = action_info
|
||||
else:
|
||||
for primitive in action_info:
|
||||
for primitive_info in action_info[primitive]:
|
||||
if 'part_id' in primitive_info:
|
||||
obj.part_ids.append(primitive_info['part_id'])
|
||||
obj.is_articulated = obj_info.get("is_articulated", False)
|
||||
if obj.is_articulated:
|
||||
obj.parts_info = obj_info["parts_info"]
|
||||
obj.joints_info = obj_info["joints_info"]
|
||||
obj.elements = interaction_info
|
||||
obj.info = obj_info
|
||||
# import ipdb;ipdb.set_trace()
|
||||
obj.is_articulated = True if part_joint_limits_info is not None else False
|
||||
|
||||
return obj
|
||||
|
||||
def set_element(self, element):
|
||||
|
||||
Reference in New Issue
Block a user