Skip to content

Commit

Permalink
Initial implementation of a Floorplanner compositor and a unit test.
Browse files Browse the repository at this point in the history
The unit test might be useful on its own, without the composite part.

TODO: all the TODOs, add remaining ground truth images
TODO: remove the commented-out portions of the code
  • Loading branch information
mosra committed Mar 24, 2023
1 parent 2e17c2e commit 07d0b30
Show file tree
Hide file tree
Showing 55 changed files with 1,466 additions and 32 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 49 additions & 22 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@ find_package(
OPTIONAL_COMPONENTS GltfSceneConverter KtxImageConverter
)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure.h
)
# If Magnum is built as static (i.e., the bundled submodule), the plugin is
# static as well, and gets linked to the test. Otherwise it's dynamic and
# loaded through its filename.
if(MAGNUM_BUILD_STATIC)
set(HABITAT_IMPORTER_PLUGIN "HabitatImporter")
else()
set(HABITAT_IMPORTER_PLUGIN $<TARGET_FILE:HabitatImporter>)
endif()

# First replace ${} variables, then $<> generator expressions
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h.in)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/configure.h
INPUT ${CMAKE_CURRENT_BINARY_DIR}/configure.h.in)

corrade_add_test(
AttributesConfigsTest
Expand All @@ -20,7 +31,7 @@ corrade_add_test(
assets
metadata
)
target_include_directories(AttributesConfigsTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(AttributesConfigsTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(
AttributesManagersTest
Expand All @@ -30,7 +41,7 @@ corrade_add_test(
assets
metadata
)
target_include_directories(AttributesManagersTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(AttributesManagersTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(
GfxBatchRendererTest
Expand All @@ -43,7 +54,7 @@ corrade_add_test(
MagnumPlugins::KtxImporter
MagnumPlugins::StbImageImporter
)
target_include_directories(GfxBatchRendererTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(GfxBatchRendererTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
if(BUILD_WITH_CUDA)
target_include_directories(
GfxBatchRendererTest PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
Expand All @@ -56,10 +67,26 @@ if(MagnumPlugins_KtxImageConverter_FOUND)
target_link_libraries(GfxBatchRendererTest PRIVATE MagnumPlugins::KtxImageConverter)
endif()

corrade_add_test(
FloorplannerProcessingTest
FloorplannerProcessingTest.cpp
LIBRARIES
gfx_batch
Magnum::DebugTools
Magnum::AnySceneImporter
MagnumPlugins::GltfImporter
MagnumPlugins::KtxImporter
MagnumPlugins::StbImageImporter
)
target_include_directories(FloorplannerProcessingTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
if(MAGNUM_BUILD_STATIC)
target_link_libraries(FloorplannerProcessingTest PRIVATE HabitatImporter)
endif()

corrade_add_test(CoreTest CoreTest.cpp LIBRARIES core io)

corrade_add_test(CullingTest CullingTest.cpp LIBRARIES gfx)
target_include_directories(CullingTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(CullingTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(
DepthUnprojectionTest
Expand All @@ -73,7 +100,7 @@ corrade_add_test(
)

corrade_add_test(DrawableTest DrawableTest.cpp LIBRARIES gfx)
target_include_directories(DrawableTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(DrawableTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(GeoTest GeoTest.cpp LIBRARIES geo)

Expand All @@ -85,7 +112,7 @@ corrade_add_test(
gfx
sim
)
target_include_directories(GfxReplayTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(GfxReplayTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

if(BUILD_WITH_BACKGROUND_RENDERER)
corrade_add_test(
Expand All @@ -98,29 +125,29 @@ if(BUILD_WITH_BACKGROUND_RENDERER)
sim
)
target_include_directories(
BatchReplayRendererTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
BatchReplayRendererTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>
)
endif()

corrade_add_test(GibsonSceneTest GibsonSceneTest.cpp LIBRARIES scene sim)
target_include_directories(GibsonSceneTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(GibsonSceneTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(HM3DSceneTest HM3DSceneTest.cpp LIBRARIES scene sim)
target_include_directories(HM3DSceneTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(HM3DSceneTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(IOTest IOTest.cpp LIBRARIES io metadata)
target_include_directories(IOTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(IOTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(LoggingTest LoggingTest.cpp LIBRARIES core)
set_tests_properties(LoggingTest PROPERTIES ENVIRONMENT HABITAT_SIM_LOG="")

corrade_add_test(
MetadataMediatorTest MetadataMediatorTest.cpp LIBRARIES assets metadata
)
target_include_directories(MetadataMediatorTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(MetadataMediatorTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(Mp3dTest Mp3dTest.cpp LIBRARIES scene)
target_include_directories(Mp3dTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(Mp3dTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(
NavTest
Expand All @@ -131,7 +158,7 @@ corrade_add_test(
io
assets
)
target_include_directories(NavTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(NavTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(
PathFinderTest
Expand All @@ -141,10 +168,10 @@ corrade_add_test(
io
Corrade::Utility
)
target_include_directories(PathFinderTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(PathFinderTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(PhysicsTest PhysicsTest.cpp LIBRARIES physics)
target_include_directories(PhysicsTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(PhysicsTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(
ReplicaSceneTest
Expand All @@ -154,10 +181,10 @@ corrade_add_test(
assets
sim
)
target_include_directories(ReplicaSceneTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(ReplicaSceneTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(ResourceManagerTest ResourceManagerTest.cpp LIBRARIES assets)
target_include_directories(ResourceManagerTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(ResourceManagerTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

corrade_add_test(SceneGraphTest SceneGraphTest.cpp LIBRARIES scene)

Expand All @@ -172,7 +199,7 @@ corrade_add_test(
Magnum::AnyImageConverter
MagnumPlugins::StbImageImporter
)
target_include_directories(SimTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(SimTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)

if(BUILD_WITH_VHACD)
corrade_add_test(
Expand All @@ -186,7 +213,7 @@ if(BUILD_WITH_VHACD)
Magnum::AnyImageConverter
MagnumPlugins::StbImageImporter
)
target_include_directories(VoxelGridTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(VoxelGridTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
endif()

# Some tests are LOUD, we don't want to include their full log (but OTOH we
Expand Down
Loading

0 comments on commit 07d0b30

Please sign in to comment.