Skip to content

Commit

Permalink
Add a depth camera example (#467)
Browse files Browse the repository at this point in the history
* [Metal] add a depth_camera example

- Add example for a depth camera.
- Based on the segmentation_camera and thermal_camera examples.
- Includes code for converting images to grayscale copied from ign-senors.

Signed-off-by: Rhys Mainwaring <[email protected]>

* [Metal] document the depth_camera example

- Add markup for code snippets.
- Add a tutorial page and image.
- Update the main tutorials page.

Signed-off-by: Rhys Mainwaring <[email protected]>

* [Metal] improve documentation

- Incorporate review feedback from @iche033

Signed-off-by: Rhys Mainwaring <[email protected]>

Co-authored-by: Ian Chen <[email protected]>
  • Loading branch information
srmainwaring and iche033 authored Nov 11, 2021
1 parent 5a5cdf1 commit 04a50f8
Show file tree
Hide file tree
Showing 10 changed files with 909 additions and 0 deletions.
39 changes: 39 additions & 0 deletions examples/depth_camera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-rendering-depth-camera)
find_package(ignition-rendering6 REQUIRED)

include_directories(SYSTEM
${PROJECT_BINARY_DIR}
)

find_package(GLUT REQUIRED)
include_directories(SYSTEM ${GLUT_INCLUDE_DIRS})
link_directories(${GLUT_LIBRARY_DIRS})

find_package(OpenGL REQUIRED)
include_directories(SYSTEM ${OpenGL_INCLUDE_DIRS})
link_directories(${OpenGL_LIBRARY_DIRS})

if (NOT APPLE)
find_package(GLEW REQUIRED)
include_directories(SYSTEM ${GLEW_INCLUDE_DIRS})
link_directories(${GLEW_LIBRARY_DIRS})
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")

configure_file (example_config.hh.in ${PROJECT_BINARY_DIR}/example_config.hh)

add_executable(depth_camera Main.cc GlutWindow.cc)

target_link_libraries(depth_camera
${GLUT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${IGNITION-RENDERING_LIBRARIES}
)

add_custom_command(TARGET depth_camera POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/media
$<TARGET_FILE_DIR:depth_camera>/media)
Loading

0 comments on commit 04a50f8

Please sign in to comment.