Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the scene / room id of SS1 environment. #117

Closed
dosssman opened this issue May 30, 2023 · 3 comments
Closed

How to get the scene / room id of SS1 environment. #117

dosssman opened this issue May 30, 2023 · 3 comments

Comments

@dosssman
Copy link

Hello again.
Sorry for the recent deluge of questions.

I am currently using SS1 version of SAVI to collect some dataset based on the oracle actions.
For each trajectory, I am also interested in knowing which scene / room the agent is current moving in.

To this end, I inspected the envs object created with the constuct_envs() function as in ppo_trainer.py, and came up with the following function to recover the scene id of a given environment:

def get_env_scene_id(envs, env_idx):
    # NOTE: might be different if using other wrapper like SYNC_ENV or VecEnv
    return envs.workers[env_idx]._env._env.current_episode.scene_id.split("/")[3]
    # return envs.workers[env_idx]._env._env._task._sim._current_scene.strip("data/scene_datasets/mp3d").split("/")[0]

However, when collection a few trajectories (around a 100), then plotting their top_down_map, the same scene id will sometime have different maps:

For example, there is the scene PX4nDJXEHrG which has give me two different maps, as per the screenshot below:
image

Or the scene E9uDoFAP3SH that also exhibits two different maps:
image

Would really appreciate if there was a more reliable method to recover the scene id from the running simulation.
Thanks a lot for your time.

@dosssman
Copy link
Author

Do some scene have multiple floors maybe ?

@ChanganVR
Copy link
Contributor

@dosssman yes, I think getting the id from scene_id makes sense and is probably what I would do.

Yes, some scenes do contain multiple floors, possibly why you are seeing multiple floors with the same environment ID.

@dosssman
Copy link
Author

Thanks a lot for the answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants