File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
challenge_storing_groceries/src/challenge_storing_groceries Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11import rospy
22
33from ed .entity import Entity
4- from robot_smach_states .util .designators import Designator
4+ from robot_smach_states .util .designators import Designator , EntityByIdDesignator
55
66
77class SimilarEntityDesignator (Designator ):
@@ -25,9 +25,12 @@ def _resolve(self):
2525 original = self .original .resolve ()
2626 entity_list = self .entity_list .resolve ()
2727 match = find_similar_entity (original , entity_list , self .knowledge )
28- if match :
29- rospy .loginfo ("Selected {}, as it is similar to {}" .format (match , original ))
30- return self .robot .ed .get_entity (uuid = match .uuid )
28+ for match_entity in entity_list :
29+ if match_entity .uuid == match .uuid :
30+ match_des = EntityByIdDesignator (self .robot , uuid = match .uuid )
31+ match_uuid_ds = match_des .resolve ()
32+ rospy .loginfo ("Selected {}, as it is similar to {}" .format (match , original ))
33+ return self .robot .ed .get_entity (uuid = match_uuid_ds .uuid )
3134 return None
3235
3336
You can’t perform that action at this time.
0 commit comments