Skip to content

Disable sim sensors when using the batch renderer.#2031

Merged
0mdc merged 3 commits intomainfrom
batch-renderer-disable-sim-sensors
Mar 16, 2023
Merged

Disable sim sensors when using the batch renderer.#2031
0mdc merged 3 commits intomainfrom
batch-renderer-disable-sim-sensors

Conversation

@0mdc
Copy link
Copy Markdown
Contributor

@0mdc 0mdc commented Mar 14, 2023

Motivation and Context

This change prevents the simulators to allocate sensor memory and render them when using the batch renderer.

How Has This Been Tested

Tested locally from habitat-lab.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@0mdc 0mdc requested review from aclegg3 and eundersander March 14, 2023 19:32
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 14, 2023
Comment thread src_python/habitat_sim/simulator.py
Copy link
Copy Markdown
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments. Have a look and try to address, but basically LGTM.

sensor.draw_observation()

# Get observations.
for agent_id in agent_ids:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what's going on here? How can we safely call get_observation if we haven't rendered here? Is this relying on some external code to have already triggered rendering?

Copy link
Copy Markdown
Contributor Author

@0mdc 0mdc Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When batch rendering, get_observation() returns None, creating an empty "placeholder" for this sensor uuid. The batch renderer replaces this value by the rendered data in post_step().

This is a bit of a hack as Habitat-Lab has checks to make sure that all sensors are present in observations between reset()/step() and post_step().

An alternative would be to skip those checks for visual sensors when batch renderer is activated, but I'm afraid that this is more confusing.

I admit that the behavior could be clearer here.

Comment thread src_python/habitat_sim/simulator.py Outdated
Comment thread src_python/habitat_sim/simulator.py
@0mdc 0mdc force-pushed the batch-renderer-disable-sim-sensors branch from c9f25a9 to 295825c Compare March 15, 2023 21:25
@0mdc 0mdc marked this pull request as ready for review March 15, 2023 21:26
@0mdc 0mdc merged commit 3df607c into main Mar 16, 2023
jturner65 added a commit that referenced this pull request Mar 22, 2023
jturner65 added a commit that referenced this pull request Mar 22, 2023
jturner65 added a commit that referenced this pull request Mar 30, 2023
jturner65 added a commit that referenced this pull request Apr 3, 2023
jturner65 added a commit that referenced this pull request Apr 3, 2023
jturner65 added a commit that referenced this pull request Apr 3, 2023
@0mdc 0mdc deleted the batch-renderer-disable-sim-sensors branch May 29, 2023 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants