-
Notifications
You must be signed in to change notification settings - Fork 505
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
Filter deactivated sensors. #2078
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -111,6 +111,22 @@ def __init__( | |||||
else: | ||||||
self.number_of_episodes = None | ||||||
|
||||||
# Filter out inactive sensors from habitat-sim config. | ||||||
0mdc marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
if config.gym.cull_visual_sensors: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing this cull logic here in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. There is some unwrangling to do here. This pattern of changing configs on-the-fly is causing us headaches with sensors. @aclegg3 and @jturner65 are currently working on refactoring them. For example:
UUIDs get changed again when they are passed to sim here:
@aclegg3 let's consider this as we refactor agents and sensors. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what's your plan here? Are you going to make a change here before merging this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sensor refactor won't be "done" for a few weeks. I suggest you move forward with a stop-gap if you need this change to be around soon. If this is just living on a branch or not really needed in the short term then you could wait. A similar mechanism is planned to be included in the sensor refactor. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eundersander I would then go and merge this as-is. |
||||||
active_sensors = config.gym.obs_keys | ||||||
agent_configs = config.simulator.agents | ||||||
with read_write(agent_configs): | ||||||
for agent_name, agent_config in agent_configs.items(): | ||||||
active_sim_sensors = {} | ||||||
for ( | ||||||
sensor_key, | ||||||
sensor_config, | ||||||
) in agent_config.sim_sensors.items(): | ||||||
sensor_uuid = f"{agent_name}_{sensor_config.uuid}" | ||||||
if sensor_uuid in active_sensors: | ||||||
active_sim_sensors[sensor_key] = sensor_config | ||||||
agent_config.sim_sensors = active_sim_sensors | ||||||
|
||||||
self._sim = make_sim( | ||||||
id_sim=self._config.simulator.type, config=self._config.simulator | ||||||
) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
cull_unused_visual_sensors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a warning comment that explains the dependency issue. You can mention humanoid_detector_sensor and spot_head_stereo_depth_sensor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I would expect the comment for this flag to go above it, not below it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You right that in this file, only class docstrings are under the symbols, so I'll change accordingly.
However, comments above the attributes aren't recognized as docstrings.