Skip to content

Add a octomap rendering sample #1247

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@
[submodule "third_party/tracy"]
path = third_party/tracy
url = https://github.com/wolfpld/tracy.git
[submodule "samples/complex/render_octmap/octomap"]
path = samples/complex/render_octmap/octomap
url = https://github.com/OctoMap/octomap.git
2 changes: 1 addition & 1 deletion assets
Submodule assets updated 42 files
+0 −7 README.md
+0 −8 scenes/Buggy/README.md
+0 −15,818 scenes/Buggy/glTF-Embedded/Buggy.gltf
+ scenes/Buggy/screenshot/screenshot.png
+0 −29 scenes/morpheus_team/LICENSE.txt
+0 −616 scenes/morpheus_team/lego_ball_phone/mlp.json
+0 −140 scenes/morpheus_team/lego_ball_phone/shape0.gltf
+0 −6 scenes/morpheus_team/lego_ball_phone/shape0.mtl
+0 −3 scenes/morpheus_team/lego_ball_phone/shape0.obj
+ scenes/morpheus_team/lego_ball_phone/shape0.pngfeat0.png
+ scenes/morpheus_team/lego_ball_phone/shape0.pngfeat1.png
+0 −616 scenes/morpheus_team/lego_boba_fett_phone/mlp.json
+0 −140 scenes/morpheus_team/lego_boba_fett_phone/shape0.gltf
+0 −6 scenes/morpheus_team/lego_boba_fett_phone/shape0.mtl
+0 −3 scenes/morpheus_team/lego_boba_fett_phone/shape0.obj
+ scenes/morpheus_team/lego_boba_fett_phone/shape0.pngfeat0.png
+ scenes/morpheus_team/lego_boba_fett_phone/shape0.pngfeat1.png
+0 −616 scenes/morpheus_team/lego_monster_truck_phone/mlp.json
+0 −140 scenes/morpheus_team/lego_monster_truck_phone/shape0.gltf
+0 −6 scenes/morpheus_team/lego_monster_truck_phone/shape0.mtl
+0 −3 scenes/morpheus_team/lego_monster_truck_phone/shape0.obj
+ scenes/morpheus_team/lego_monster_truck_phone/shape0.pngfeat0.png
+ scenes/morpheus_team/lego_monster_truck_phone/shape0.pngfeat1.png
+0 −616 scenes/morpheus_team/lego_tractor_phone/mlp.json
+0 −140 scenes/morpheus_team/lego_tractor_phone/shape0.gltf
+0 −6 scenes/morpheus_team/lego_tractor_phone/shape0.mtl
+0 −3 scenes/morpheus_team/lego_tractor_phone/shape0.obj
+ scenes/morpheus_team/lego_tractor_phone/shape0.pngfeat0.png
+ scenes/morpheus_team/lego_tractor_phone/shape0.pngfeat1.png
+ scenes/octMap.bin
+0 −11 scenes/pica_pica_robot/license.txt
+ scenes/pica_pica_robot/scene.bin
+0 −1,801 scenes/pica_pica_robot/scene.gltf
+0 −15 scenes/primitives/LICENSE.md
+0 −7 scenes/primitives/README.md
+0 −611 scenes/primitives/primitives.gltf
+0 −2,667 scenes/subpass_scene_opaque.gltf
+0 −665 scenes/subpass_scene_transparent.gltf
+0 −15 scenes/terrain/LICENSE.md
+0 −5 scenes/terrain/README.md
+0 −121 scenes/terrain/terrain.gltf
+ textures/transparent_glass_rgba.ktx
3 changes: 3 additions & 0 deletions samples/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ include::./extensions/README.adoc[]

[[tooling-samples]]
include::./tooling/README.adoc[]

[[complex-samples]]
include::../complex/README.adoc[]
35 changes: 35 additions & 0 deletions samples/complex/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
////
- Copyright (c) 2021-2024, The Khronos Group
-
- SPDX-License-Identifier: Apache-2.0
-
- Licensed under the Apache License, Version 2.0 the "License";
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
////
ifndef::complex_samplespath[:complex_samplespath:]

== Complex samples

The goal of these samples is to demonstrate how to use Vulkan in a real world scenario. These are meant to be demonstrations of how to use Vulkan as a whole instead of a singular item within Vulkan.

This format for samples is to demonstrate how to work with other libraries or setup projects. Some of the samples may or may not use the Framework as needed.

While the Vulkan concepts found here aren't complex, the interaction and unique benefit with the real-world use cases they work with are meant to be. Examples of what might eventually be found here include AI, OpenXR, GLTF, etc. Topics which don't belong in the other sample categories by themselves yet are useful in many areas.

=== xref:./{complex_samplespath}render_octmap/README.adoc[Render an Octo-Map]

*Instancing*: https://docs.vulkan.org/spec/latest/chapters/drawing.html#vkCmdDrawIndexed[`vkCmdDrawIndexed`]

Uses instancing to render octmaps generated in realtime by ARCore and ARKit then saved, and joined together using Point Cloud Registration into one shared map.

These maps are commonly used by Robot Operating System (ROS) and this is a solution showing how to render the map created. This is a topic of interest to SLAM and AI with OpenXR for map understanding and joining.
43 changes: 43 additions & 0 deletions samples/complex/render_octomap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH)
get_filename_component(CATEGORY_NAME ${PARENT_DIR} NAME)

add_library( octomath STATIC
octomap/octomap/src/math/Vector3.cpp
octomap/octomap/src/math/Quaternion.cpp
octomap/octomap/src/math/Pose6D.cpp
)
target_include_directories(octomath PUBLIC ${CMAKE_CURRENT_LIST_DIR}/octomap/octomap/include)

add_library(octomap SHARED
octomap/octomap/src/AbstractOcTree.cpp
octomap/octomap/src/AbstractOccupancyOcTree.cpp
octomap/octomap/src/Pointcloud.cpp
octomap/octomap/src/ScanGraph.cpp
octomap/octomap/src/CountingOcTree.cpp
octomap/octomap/src/OcTree.cpp
octomap/octomap/src/OcTreeNode.cpp
octomap/octomap/src/OcTreeStamped.cpp
octomap/octomap/src/ColorOcTree.cpp
)
target_link_libraries(octomap PUBLIC octomath)

add_library(dynamicEDT3d SHARED octomap/dynamicEDT3D/src/dynamicEDT3D.cpp)
target_include_directories(dynamicEDT3d PUBLIC octomap/dynamicEDT3D/include)
target_link_libraries(dynamicEDT3d PUBLIC octomap)

add_sample_with_tags(
ID ${FOLDER_NAME}
CATEGORY ${CATEGORY_NAME}
AUTHOR "Holochip"
NAME "Octmap rendering"
DESCRIPTION "Demonstration of how to render an OctMap which was generated from ICP combining ARCore and ARKit SLAM maps"
FILES
ImGUIUtil.cpp
Screens/MapView.cpp
SHADER_FILES_GLSL
"render_octomap/glsl/render.vert"
"render_octomap/glsl/render.frag"
LIBS
dynamicEDT3d
)
Loading
Loading