From 76cce465e54aa562b91373b8cf11757e7a2fae5c Mon Sep 17 00:00:00 2001 From: John Turner <7strbass@gmail.com> Date: Fri, 27 Sep 2024 17:33:09 -0400 Subject: [PATCH] --rollback default link change --- .../utils/namespace/hsim_physics.py | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src_python/habitat_sim/utils/namespace/hsim_physics.py b/src_python/habitat_sim/utils/namespace/hsim_physics.py index b2c817567b..c9b248c483 100644 --- a/src_python/habitat_sim/utils/namespace/hsim_physics.py +++ b/src_python/habitat_sim/utils/namespace/hsim_physics.py @@ -220,7 +220,7 @@ def get_ao_default_link( habitat_sim.physics.JointType.Revolute, habitat_sim.physics.JointType.Prismatic, ] - lowest_links: List[int] = None + lowest_link = None lowest_y: int = None # compute the default link for link_id in ao.get_link_ids(): @@ -230,21 +230,11 @@ def get_ao_default_link( get_articulated_link_global_keypoints(ao, link_id), key=lambda x: x[1], )[1] - if ( - lowest_y is None - or link_lowest_y < lowest_y - or abs(lowest_y - link_lowest_y) < 0.01 - ): - if lowest_y is not None and abs(lowest_y - link_lowest_y) < 0.01: - # 1 cm or less difference - lowest_links.append(link_id) - else: - lowest_links = [link_id] + if lowest_y is None or link_lowest_y < lowest_y: lowest_y = link_lowest_y - - if lowest_links is not None: - # if multiple links could be confused as the default, use the lowest link index of the set - default_link = min(lowest_links) + lowest_link = link_id + if lowest_link is not None: + default_link = lowest_link # if found, set in metadata for next time ao.user_attributes.set("default_link", default_link)