def get_beacon_position()

in envs/thor_beacons.py [0:0]


    def get_beacon_position(self, state, act_info):

        depth, P, agent_y = state['depth'], state['P'], state['agent_y']
        targets = act_info['target']

        # dummy object at the center of the screen for marking
        if targets['int_target']=='dummy':
            center_x, center_y = act_info['target']['int_pt']
            center_p = P[0, :, center_x, center_y].tolist()
            center_depth = depth[center_x, center_y]

            # place dummy marker within a certain distance
            on_floor = np.abs(center_p[1]-agent_y) < 1
            if (not on_floor and center_depth>=1.1) or (center_depth>=5 or center_depth<0.5) or (on_floor and center_depth>2):
                return None

            target_obj = {'position':{'x':center_p[0],
                                      'y':center_p[1],
                                      'z':center_p[2]},
                          'rotation':{'x':0, 'y':0, 'z':0},
                          'objectId': 'dummy', 
                         }
            act_info['target']['dummy'] = target_obj

        # calculate the marker location
        sel_x, sel_y = targets['int_pt']
        world_pt = tuple(P[0, :, sel_x, sel_y].tolist())

        target_obj = targets[targets['int_target']]
        p = (target_obj['position']['x'], -target_obj['position']['y'], target_obj['position']['z'])
        rot = (target_obj['rotation']['x'], target_obj['rotation']['y'], target_obj['rotation']['z'])

        return {'pt':world_pt, 'p':p, 'rot': rot, 'target':{'objectId':target_obj['objectId']}}