Exemplo n.º 1
0
    def _execute(self, desig):
        solution = desig.reference()
        if solution['cmd'] == "detecting":
            robot = BulletWorld.robot
            object_type = solution['object']
            cam_frame_name = solution['cam_frame']
            front_facing_axis = solution['front_facing_axis']

            objects = BulletWorld.current_bullet_world.get_objects_by_type(object_type)
            for obj in objects:
                if btr.visible(obj, robot.get_link_position_and_orientation(cam_frame_name), front_facing_axis):
                    return obj
Exemplo n.º 2
0
    def _execute(self, desig):
        solultion = desig.reference()
        if solultion['cmd'] == "detecting":
            robot = BulletWorld.robot
            object_type = solultion['object']
            cam_frame_name = solultion['cam_frame']

            objects = BulletWorld.current_bullet_world.objects
            visible_objects = []
            for obj in objects:
                if obj.type == "environment":
                    continue
                if btr.visible(obj, robot.get_link_position(cam_frame_name)):
                    visible_objects.append(obj)

            for obj in visible_objects:
                if obj.type == object_type:
                    return obj