Decouple Agents and Sensors; default GUI+Bullet#2621
Merged
Conversation
…public API Agent-Sensor Decoupling: - Extract Sensor class from simulator.py into sensors/sensor_wrapper.py, fully decoupled from Agent (no agent reference needed) - Flat sensor registry on Simulator (sim.sensors, create_sensor, remove_sensor, get_sensor, render_sensors) - Agent.sensors is now a live property backed by C++ subtree propagation - Backward-compat aliases preserved (_sensors, add_sensor, get_sensor_observations) Build Defaults: - Default HABITAT_BUILD_GUI_VIEWERS=ON and HABITAT_WITH_BULLET=ON across pyproject.toml, build.sh, and CMakeLists.txt - Updated BUILD_FROM_SOURCE.md, setup.py, CONTRIBUTING.md, and viewer example headers to reflect new defaults Example Migration: - Replace all internal API patterns (_sensors, _sensor_object, _spec, _Simulator__sensors) with public API (sensors, sensor_object, spec, node) across all viewer examples, Python tutorials, and Jupyter notebooks Tests: - New tests for sensor subtree discovery, create/remove lifecycle, render_sensors, registry consistency, and backward-compat aliases
jturner65
approved these changes
Feb 19, 2026
Contributor
jturner65
left a comment
There was a problem hiding this comment.
LGTM if it passes all the test and such.
| self.step_world(dt) | ||
|
|
||
|
|
||
| class Sensor: |
Contributor
Author
|
All tests passing on sim. We expect lab tests to fail as this is a breaking change. I'll put up a lab PR to accompany this one and test off that. |
aclegg3
added a commit
to facebookresearch/habitat-lab
that referenced
this pull request
Feb 20, 2026
Adapt habitat-lab to the new public sensor API from habitat-sim PR #2621 (agent-sensor-decoupling branch). Key changes: - Replace all private _sensors dict access with public sim.sensors property - Replace _sim._sensors[name]._sensor_object with sim.get_sensor(name).sensor_object - Replace agent._sensors with agent.sensors (live C++ subtree view) - Simplify instance_image_nav_task sensor lifecycle to use sim.remove_sensor() instead of manual multi-dict cleanup - Remove Python name-mangling (_Simulator__sensors) from debug_visualizer and its tests; use sim.sensors registry directly - Update CI workflow to build habitat-sim from the PR branch Companion to: facebookresearch/habitat-sim#2621
Merged
5 tasks
aclegg3
added a commit
to facebookresearch/habitat-lab
that referenced
this pull request
Feb 20, 2026
Adapt habitat-lab to the new public sensor API from habitat-sim PR #2621 (agent-sensor-decoupling branch). Key changes: - Replace all private _sensors dict access with public sim.sensors property - Replace _sim._sensors[name]._sensor_object with sim.get_sensor(name).sensor_object - Replace agent._sensors with agent.sensors (live C++ subtree view) - Simplify instance_image_nav_task sensor lifecycle to use sim.remove_sensor() instead of manual multi-dict cleanup - Remove Python name-mangling (_Simulator__sensors) from debug_visualizer and its tests; use sim.sensors registry directly - Update CI workflow to build habitat-sim from the PR branch Companion to: facebookresearch/habitat-sim#2621
aclegg3
added a commit
to facebookresearch/habitat-lab
that referenced
this pull request
Feb 21, 2026
* Migrate habitat-lab to habitat-sim agent-sensor-decoupling API Adapt habitat-lab to the new public sensor API from habitat-sim PR #2621 (agent-sensor-decoupling branch). Key changes: - Replace all private _sensors dict access with public sim.sensors property - Replace _sim._sensors[name]._sensor_object with sim.get_sensor(name).sensor_object - Replace agent._sensors with agent.sensors (live C++ subtree view) - Simplify instance_image_nav_task sensor lifecycle to use sim.remove_sensor() instead of manual multi-dict cleanup - Remove Python name-mangling (_Simulator__sensors) from debug_visualizer and its tests; use sim.sensors registry directly - Update CI workflow to build habitat-sim from the PR branch Companion to: facebookresearch/habitat-sim#2621 --------- Co-authored-by: Alexander William Clegg <alexclegg@meta.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Agent-Sensor Decoupling:
Build Defaults:
Example Migration:
How Has This Been Tested
Tests:
Types of changes
Checklist