本文整理汇总了Python中World.World.get_most_similar_obj方法的典型用法代码示例。如果您正苦于以下问题:Python World.get_most_similar_obj方法的具体用法?Python World.get_most_similar_obj怎么用?Python World.get_most_similar_obj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World.World
的用法示例。
在下文中一共展示了World.get_most_similar_obj方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_ref_frames
# 需要导入模块: from World import World [as 别名]
# 或者: from World.World import get_most_similar_obj [as 别名]
def update_ref_frames(self, ref_frame_list):
'''Updates and re-assigns coordinate frames when the world changes'''
# There is a new list of objects
# If the current frames are already assigned to object,
# we need to figure out the correspondences
ActionStepMarker._ref_object_list = ref_frame_list
arm_pose = self.get_target()
if (arm_pose.refFrame == ArmState.OBJECT):
prev_ref_obj = arm_pose.refFrameObject
new_ref_obj = World.get_most_similar_obj(prev_ref_obj,
ref_frame_list)
self.has_object = False
if (new_ref_obj != None):
self.has_object = True
arm_pose.refFrameObject = new_ref_obj
ActionStepMarker._ref_names = ['base_link']
for i in range(len(ActionStepMarker._ref_object_list)):
ActionStepMarker._ref_names.append(
ActionStepMarker._ref_object_list[i].name)
self._update_menu()