Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d3a99b7
Convert to pure CMake, remove ROS node
schornakj Feb 25, 2020
7ac65be
Use EigenAlignedVec for RenderableObjectState
schornakj Feb 26, 2020
9f32685
Disable AVX as workaround for Eigen alignment issue, default to C++14
schornakj Feb 26, 2020
ad61938
add optional package for roscpp demos
schornakj Sep 15, 2020
7c26eb7
add missing PCL dependency
schornakj Sep 15, 2020
371f4d8
fix wrong package name in package.xml
schornakj Sep 15, 2020
8ff9467
fix exported target names, missing laser_scanner library, and find_pa…
schornakj Sep 15, 2020
0439a1f
fix missing include dirs and pcl deps
schornakj Sep 15, 2020
72baf62
make roscpp demo deps conditional on ROS1
schornakj Sep 21, 2020
27bcfe4
make laser_scanner library shared and its linked libraries public
schornakj Sep 23, 2020
f5af5f5
use old-style Eigen3 linking for Xenial compatibility
schornakj Sep 23, 2020
a3cea42
revert to use
schornakj Sep 23, 2020
2a257de
set compile options to use c++14
schornakj Sep 23, 2020
e9e8513
add pthread library
schornakj Sep 23, 2020
b164ca0
Merge pull request #1 from ascentai/feature/pure-cmake
haudren May 12, 2021
4e756e6
New glad for EGL + GLES
haudren May 7, 2021
725e935
First "working" version
haudren May 7, 2021
0edd11c
Store the EGL display
haudren May 7, 2021
745ff94
Reload EGL + BindAPI
haudren May 7, 2021
12d931a
Use PyRender's attributes for context
haudren May 7, 2021
187cbd5
Update to have GL_CLIP_CONTROL
haudren May 10, 2021
4c6c05e
Switch back to regular OpenGL
haudren May 10, 2021
637b243
Remove remainder of GLFW functionality
haudren May 10, 2021
a35167f
Throw an error if EGL bind fails
haudren May 10, 2021
c78608d
Try to create an EGL surface
haudren May 10, 2021
f661a0e
Remove all references to GLFW
haudren May 10, 2021
6e7c91e
Store display/context/surface and dispose them
haudren May 10, 2021
b834869
Rename initGLFW to initEGL
haudren May 10, 2021
f8cd400
Merge pull request #2 from ascentai/feature/EGL-round-2
haudren May 12, 2021
bdf163c
Use more targets, don't find OpenGL
haudren May 11, 2021
e7c5f8b
Add PCL dependency to config.cmake
haudren May 11, 2021
ca1b59e
Merge pull request #3 from ascentai/feature/modernize-cmake
haudren May 12, 2021
e9810c1
Add option for orthographic projections to sim depth cameras
thomascent Mar 10, 2022
4946cdb
Apply suggestions from code review
thomascent May 19, 2022
526e07b
Merge pull request #4 from ascentai/orthographic
danielcranston Jan 6, 2023
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
146 changes: 0 additions & 146 deletions CMakeLists.txt

This file was deleted.

125 changes: 125 additions & 0 deletions gl_depth_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
cmake_minimum_required(VERSION 3.5.0)
project(gl_depth_sim VERSION 0.2.0 LANGUAGES C CXX)

SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_EXTENSIONS OFF)

# Required for core functionality
find_package(Eigen3 REQUIRED)
find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)

find_package(Threads REQUIRED)
set(THREADS_PREFER_PTHREAD_FLAG ON)

# Extensions
find_package(assimp REQUIRED) # Just used for loading models in mesh_loader.h
find_package(OpenCV REQUIRED) # Used for interface extension

add_library(glad SHARED src/${PROJECT_NAME}/egl.c src/${PROJECT_NAME}/gl.c)
target_include_directories(glad PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

# Primary rendering library
# Independent of ROS, but does need glfw3 and assimp for model loading
add_library(${PROJECT_NAME} SHARED
src/${PROJECT_NAME}/sim_depth_camera.cpp
src/${PROJECT_NAME}/mesh_loader.cpp
src/${PROJECT_NAME}/mesh.cpp
src/${PROJECT_NAME}/renderable_mesh.cpp
src/${PROJECT_NAME}/shader_program.cpp)
target_compile_options(${PROJECT_NAME} PUBLIC -mno-avx)
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_link_libraries(${PROJECT_NAME} PUBLIC
${ASSIMP_LIBRARIES}
glad
dl
Threads::Threads
Eigen3::Eigen
)

# Libaries for interfacing with opencv and pcl
add_library(${PROJECT_NAME}_interfaces SHARED
src/interfaces/pcl_interface.cpp
src/interfaces/opencv_interface.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_include_directories(${PROJECT_NAME}_interfaces SYSTEM PUBLIC
${PCL_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME}_interfaces PUBLIC
${PROJECT_NAME}
${OpenCV_LIBRARIES}
${PCL_LIBRARIES}
)

# Simulated laser scanner library
add_library(${PROJECT_NAME}_laser_scanner SHARED
src/${PROJECT_NAME}/sim_laser_scanner.cpp
)
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
target_link_libraries(${PROJECT_NAME}_laser_scanner PUBLIC
${PROJECT_NAME}
${PROJECT_NAME}_interfaces
)

# Example showing basic usage
add_executable(${PROJECT_NAME}_test src/usage_example.cpp)
set_target_properties(${PROJECT_NAME}_test PROPERTIES OUTPUT_NAME depth_example PREFIX "")
target_include_directories(${PROJECT_NAME}_test PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCEDIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_link_libraries(${PROJECT_NAME}_test PUBLIC
${PROJECT_NAME}
${PROJECT_NAME}_interfaces)

# Example showing an orbiting camera
add_executable(${PROJECT_NAME}_orbit src/camera_orbit_example.cpp)
set_target_properties(${PROJECT_NAME}_orbit PROPERTIES OUTPUT_NAME orbit_example PREFIX "")
target_include_directories(${PROJECT_NAME}_orbit PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
target_link_libraries(${PROJECT_NAME}_orbit PUBLIC
${PROJECT_NAME}
${PROJECT_NAME}_interfaces)

install(DIRECTORY include/${PROJECT_NAME}
DESTINATION include)

install(TARGETS
glad
${PROJECT_NAME}
${PROJECT_NAME}_interfaces
${PROJECT_NAME}_laser_scanner
${PROJECT_NAME}_test
${PROJECT_NAME}_orbit
EXPORT ${PROJECT_NAME}-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(EXPORT ${PROJECT_NAME}-targets NAMESPACE gl_depth_sim:: DESTINATION lib/cmake/${PROJECT_NAME})

install(FILES package.xml DESTINATION share/${PROJECT_NAME})

# Create cmake config files
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/${PROJECT_NAME}-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}
NO_CHECK_REQUIRED_COMPONENTS_MACRO)

write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
DESTINATION lib/cmake/${PROJECT_NAME})

export(EXPORT ${PROJECT_NAME}-targets NAMESPACE gl_depth_sim:: FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake)
14 changes: 14 additions & 0 deletions gl_depth_sim/cmake/gl_depth_sim-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@PACKAGE_INIT@

set(@PROJECT_NAME@_FOUND ON)
set_and_check(@PROJECT_NAME@_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include")
set_and_check(@PROJECT_NAME@_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/lib")

include(CMakeFindDependencyMacro)
find_dependency(Eigen3)
find_dependency(assimp)
find_dependency(OpenCV)
find_dependency(OpenGL)
find_dependency(PCL)

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
File renamed without changes
File renamed without changes
Loading