def make_equiv_action(self, a_t, perm_obs, perm_idx=None, traj=None):
    '\n        Interface between Panoramic view and Egocentric view \n        It will convert the action panoramic view action a_t to equivalent egocentric view actions for the simulator\n        '

    def take_action(i, idx, name):
        if (type(name) is int):
            self.env.env.sims[idx].makeAction(name, 0, 0)
        else:
            self.env.env.sims[idx].makeAction(*self.env_actions[name])
        state = self.env.env.sims[idx].getState()
        if (traj is not None):
            traj[i]['path'].append((state.location.viewpointId, state.heading, state.elevation))
    if (perm_idx is None):
        perm_idx = range(len(perm_obs))
    for (i, idx) in enumerate(perm_idx):
        action = a_t[i]
        if (action != (- 1)):
            select_candidate = perm_obs[i]['candidate'][action]
            src_point = perm_obs[i]['viewIndex']
            trg_point = select_candidate['pointId']
            src_level = (src_point // 12)
            trg_level = (trg_point // 12)
            while (src_level < trg_level):
                take_action(i, idx, 'up')
                src_level += 1
            while (src_level > trg_level):
                take_action(i, idx, 'down')
                src_level -= 1
            while (self.env.env.sims[idx].getState().viewIndex != trg_point):
                take_action(i, idx, 'right')
            assert (select_candidate['viewpointId'] == self.env.env.sims[idx].getState().navigableLocations[select_candidate['idx']].viewpointId)
            take_action(i, idx, select_candidate['idx'])
Interface between Panoramic view and Egocentric view 
It will convert the action panoramic view action a_t to equivalent egocentric view actions for the simulator
def make_equiv_action(self, a_t, perm_obs, perm_idx=None, traj=None):
    '\n        Interface between Panoramic view and Egocentric view \n        It will convert the action panoramic view action a_t to equivalent egocentric view actions for the simulator\n        '

    def take_action(i, idx, name):
        if (type(name) is int):
            self.env.env.sims[idx].makeAction(name, 0, 0)
        else:
            self.env.env.sims[idx].makeAction(*self.env_actions[name])
        state = self.env.env.sims[idx].getState()
        if (traj is not None):
            traj[i]['path'].append((state.location.viewpointId, state.heading, state.elevation))
    if (perm_idx is None):
        perm_idx = range(len(perm_obs))
    for (i, idx) in enumerate(perm_idx):
        action = a_t[i]
        if (action != (- 1)):
            select_candidate = perm_obs[i]['candidate'][action]
            src_point = perm_obs[i]['viewIndex']
            trg_point = select_candidate['pointId']
            src_level = (src_point // 12)
            trg_level = (trg_point // 12)
            while (src_level < trg_level):
                take_action(i, idx, 'up')
                src_level += 1
            while (src_level > trg_level):
                take_action(i, idx, 'down')
                src_level -= 1
            while (self.env.env.sims[idx].getState().viewIndex != trg_point):
                take_action(i, idx, 'right')
            assert (select_candidate['viewpointId'] == self.env.env.sims[idx].getState().navigableLocations[select_candidate['idx']].viewpointId)
            take_action(i, idx, select_candidate['idx'])