From 4d287759d282a597c83fd1c09490c4f1ef8c3162 Mon Sep 17 00:00:00 2001 From: John Turner <7strbass@gmail.com> Date: Tue, 6 Feb 2024 14:03:15 -0500 Subject: [PATCH] --fix bbox bindings issue --- examples/demo_runner.py | 8 ++++---- examples/tutorials/nb_python/ECCV_2020_Navigation.py | 8 ++++---- .../tutorials/notebooks/ECCV_2020_Navigation.ipynb | 8 ++++---- src/esp/bindings/Bindings.cpp | 12 ------------ src_python/habitat_sim/geo.py | 3 +-- src_python/habitat_sim/utils/data/data_extractor.py | 2 +- tests/test_semantic_scene.py | 2 +- 7 files changed, 15 insertions(+), 28 deletions(-) diff --git a/examples/demo_runner.py b/examples/demo_runner.py index 42219c0cfe..9f3ea565a7 100644 --- a/examples/demo_runner.py +++ b/examples/demo_runner.py @@ -302,21 +302,21 @@ def do_time_steps(self): def print_semantic_scene(self): if self._sim_settings["print_semantic_scene"]: scene = self._sim.semantic_scene - print(f"House center:{scene.aabb.center} dims:{scene.aabb.sizes}") + print(f"House center:{scene.aabb.center} dims:{scene.aabb.size}") for level in scene.levels: print( f"Level id:{level.id}, center:{level.aabb.center}," - f" dims:{level.aabb.sizes}" + f" dims:{level.aabb.size}" ) for region in level.regions: print( f"Region id:{region.id}, category:{region.category.name()}," - f" center:{region.aabb.center}, dims:{region.aabb.sizes}" + f" center:{region.aabb.center}, dims:{region.aabb.size}" ) for obj in region.objects: print( f"Object id:{obj.id}, category:{obj.category.name()}," - f" center:{obj.aabb.center}, dims:{obj.aabb.sizes}" + f" center:{obj.aabb.center}, dims:{obj.aabb.size}" ) input("Press Enter to continue...") diff --git a/examples/tutorials/nb_python/ECCV_2020_Navigation.py b/examples/tutorials/nb_python/ECCV_2020_Navigation.py index 9e8b8a5b7a..93c9d3d48e 100644 --- a/examples/tutorials/nb_python/ECCV_2020_Navigation.py +++ b/examples/tutorials/nb_python/ECCV_2020_Navigation.py @@ -375,23 +375,23 @@ def print_scene_recur(scene, limit_output=10): print( f"House has {len(scene.levels)} levels, {len(scene.regions)} regions and {len(scene.objects)} objects" ) - print(f"House center:{scene.aabb.center} dims:{scene.aabb.sizes}") + print(f"House center:{scene.aabb.center} dims:{scene.aabb.size}") count = 0 for level in scene.levels: print( f"Level id:{level.id}, center:{level.aabb.center}," - f" dims:{level.aabb.sizes}" + f" dims:{level.aabb.size}" ) for region in level.regions: print( f"Region id:{region.id}, category:{region.category.name()}," - f" center:{region.aabb.center}, dims:{region.aabb.sizes}" + f" center:{region.aabb.center}, dims:{region.aabb.size}" ) for obj in region.objects: print( f"Object id:{obj.id}, category:{obj.category.name()}," - f" center:{obj.aabb.center}, dims:{obj.aabb.sizes}" + f" center:{obj.aabb.center}, dims:{obj.aabb.size}" ) count += 1 if count >= limit_output: diff --git a/examples/tutorials/notebooks/ECCV_2020_Navigation.ipynb b/examples/tutorials/notebooks/ECCV_2020_Navigation.ipynb index 2bf4f42aed..9bc639f254 100644 --- a/examples/tutorials/notebooks/ECCV_2020_Navigation.ipynb +++ b/examples/tutorials/notebooks/ECCV_2020_Navigation.ipynb @@ -450,23 +450,23 @@ " print(\n", " f\"House has {len(scene.levels)} levels, {len(scene.regions)} regions and {len(scene.objects)} objects\"\n", " )\n", - " print(f\"House center:{scene.aabb.center} dims:{scene.aabb.sizes}\")\n", + " print(f\"House center:{scene.aabb.center} dims:{scene.aabb.size}\")\n", "\n", " count = 0\n", " for level in scene.levels:\n", " print(\n", " f\"Level id:{level.id}, center:{level.aabb.center},\"\n", - " f\" dims:{level.aabb.sizes}\"\n", + " f\" dims:{level.aabb.size}\"\n", " )\n", " for region in level.regions:\n", " print(\n", " f\"Region id:{region.id}, category:{region.category.name()},\"\n", - " f\" center:{region.aabb.center}, dims:{region.aabb.sizes}\"\n", + " f\" center:{region.aabb.center}, dims:{region.aabb.size}\"\n", " )\n", " for obj in region.objects:\n", " print(\n", " f\"Object id:{obj.id}, category:{obj.category.name()},\"\n", - " f\" center:{obj.aabb.center}, dims:{obj.aabb.sizes}\"\n", + " f\" center:{obj.aabb.center}, dims:{obj.aabb.size}\"\n", " )\n", " count += 1\n", " if count >= limit_output:\n", diff --git a/src/esp/bindings/Bindings.cpp b/src/esp/bindings/Bindings.cpp index 6ce2c21280..327a6fbd16 100644 --- a/src/esp/bindings/Bindings.cpp +++ b/src/esp/bindings/Bindings.cpp @@ -12,17 +12,6 @@ namespace py = pybind11; using py::literals::operator""_a; -namespace esp { - -void initEspBindings(py::module& m) { - // ==== Range3D ==== - py::class_(m, "BBox") - .def_property_readonly("sizes", &Magnum::Range3D::size) - .def_property_readonly("center", &Magnum::Range3D::center); -} - -} // namespace esp - PYBIND11_MODULE(habitat_sim_bindings, m) { m.attr("cuda_enabled") = #ifdef ESP_BUILD_WITH_CUDA @@ -59,7 +48,6 @@ PYBIND11_MODULE(habitat_sim_bindings, m) { // NOTE(msb) These need to be run in dependency order. // TODO(msb) gfx, scene, and sensor should not cross-depend // TODO(msb) sim and sensor should not cross-depend - esp::initEspBindings(m); esp::core::config::initConfigBindings(m); esp::core::initCoreBindings(m); esp::geo::initGeoBindings(m); diff --git a/src_python/habitat_sim/geo.py b/src_python/habitat_sim/geo.py index d7005188b3..ee912e3072 100644 --- a/src_python/habitat_sim/geo.py +++ b/src_python/habitat_sim/geo.py @@ -6,7 +6,7 @@ Encapsulates global geometry utilities. """ -from habitat_sim._ext.habitat_sim_bindings import OBB, BBox, Ray +from habitat_sim._ext.habitat_sim_bindings import OBB, Ray from habitat_sim._ext.habitat_sim_bindings.geo import ( BACK, FRONT, @@ -20,7 +20,6 @@ ) __all__ = [ - "BBox", "OBB", "UP", "GRAVITY", diff --git a/src_python/habitat_sim/utils/data/data_extractor.py b/src_python/habitat_sim/utils/data/data_extractor.py index 33e4e5f80f..db7977f4e1 100644 --- a/src_python/habitat_sim/utils/data/data_extractor.py +++ b/src_python/habitat_sim/utils/data/data_extractor.py @@ -246,7 +246,7 @@ def _generate_label_map(self, scene, verbose=False): print( f"House has {len(scene.levels)} levels, {len(scene.regions)} regions and {len(scene.objects)} objects" ) - print(f"House center:{scene.aabb.center} dims:{scene.aabb.sizes}") + print(f"House center:{scene.aabb.center} dims:{scene.aabb.size}") instance_id_to_name = {} for obj in scene.objects: diff --git a/tests/test_semantic_scene.py b/tests/test_semantic_scene.py index db150968bf..5b4e846b1a 100644 --- a/tests/test_semantic_scene.py +++ b/tests/test_semantic_scene.py @@ -165,7 +165,7 @@ def test_semantic_scene(scene, make_cfg_settings): scene = sim.semantic_scene for obj in scene.objects: obj.aabb - obj.aabb.sizes + obj.aabb.size obj.aabb.center obj.id obj.obb.rotation