From d3a99b7fc87727905d046034a8ab83fc28eccd47 Mon Sep 17 00:00:00 2001 From: Joseph Schornak Date: Tue, 25 Feb 2020 16:27:45 -0600 Subject: [PATCH 01/14] Convert to pure CMake, remove ROS node --- CMakeLists.txt | 173 +++++++++++------------- cmake/gl_depth_sim-config.cmake.in | 15 ++ include/gl_depth_sim/mesh.h | 2 + include/gl_depth_sim/shader_program.h | 2 + include/gl_depth_sim/sim_depth_camera.h | 4 + package.xml | 14 +- 6 files changed, 106 insertions(+), 104 deletions(-) create mode 100644 cmake/gl_depth_sim-config.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 9945ebb..280f109 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,72 +1,57 @@ -cmake_minimum_required(VERSION 2.8.3) -project(gl_depth_sim) - -add_compile_options(-std=c++14 -Wall -Wextra) - -find_package(catkin REQUIRED COMPONENTS - roscpp # Used for ROS examples - pcl_ros # Used for interfaces extension - tf2_ros # Used for ROS example - tf2_eigen # Used for ROS example - visualization_msgs # Used for ROS example -) +cmake_minimum_required(VERSION 3.5.0) +project(gl_depth_sim VERSION 0.2.0 LANGUAGES C CXX) # Required for core functionality find_package(glfw3 REQUIRED) find_package(OpenGL REQUIRED) find_package(Eigen3 REQUIRED) +find_package(PCL REQUIRED) # Extensions find_package(assimp REQUIRED) # Just used for loading models in mesh_loader.h find_package(OpenCV REQUIRED) # Used for interface extension -catkin_package( - INCLUDE_DIRS include - LIBRARIES ${PROJECT_NAME} ${PROJECT_NAME}_interfaces - CATKIN_DEPENDS - roscpp - pcl_ros - tf2_ros - tf2_eigen - visualization_msgs - DEPENDS OpenCV -) - -include_directories( - include - ${catkin_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIRS} -) +add_library(glad SHARED src/${PROJECT_NAME}/glad.c) +target_include_directories(glad PRIVATE + "$" + "$") # Primary rendering library # Independent of ROS, but does need glfw3 and assimp for model loading -add_library(${PROJECT_NAME} +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 - src/${PROJECT_NAME}/glad.c - src/${PROJECT_NAME}/glfw_guard.cpp -) -add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) -target_link_libraries(${PROJECT_NAME} - ${OPENGL_LIBRARIES} + src/${PROJECT_NAME}/glfw_guard.cpp) +target_compile_options(${PROJECT_NAME} PRIVATE -std=c++11) +target_include_directories(${PROJECT_NAME} PUBLIC + "$" + "$") +target_link_libraries(${PROJECT_NAME} PUBLIC ${ASSIMP_LIBRARIES} + OpenGL::OpenGL + glad dl glfw -) + Eigen3::Eigen + ) # Libaries for interfacing with opencv and pcl -add_library(${PROJECT_NAME}_interfaces +add_library(${PROJECT_NAME}_interfaces SHARED src/interfaces/pcl_interface.cpp - src/interfaces/opencv_interface.cpp -) -add_dependencies(${PROJECT_NAME}_interfaces ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) -target_link_libraries(${PROJECT_NAME}_interfaces + src/interfaces/opencv_interface.cpp) +target_compile_options(${PROJECT_NAME}_interfaces PRIVATE -std=c++11) +target_include_directories(${PROJECT_NAME} PUBLIC + "$" + "$") +target_include_directories(${PROJECT_NAME}_interfaces SYSTEM PUBLIC + ${PCL_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME}_interfaces PUBLIC ${PROJECT_NAME} - ${catkin_LIBRARIES} ${OpenCV_LIBRARIES} + ${PCL_LIBRARIES} ) # Simulated laser scanner library @@ -82,65 +67,63 @@ target_link_libraries(${PROJECT_NAME}_sim_laser_scanner # Example showing basic usage add_executable(${PROJECT_NAME}_test src/usage_example.cpp) +target_compile_options(${PROJECT_NAME}_test PRIVATE -std=c++11) set_target_properties(${PROJECT_NAME}_test PROPERTIES OUTPUT_NAME depth_example PREFIX "") -target_link_libraries(${PROJECT_NAME}_test +target_include_directories(${PROJECT_NAME}_test PUBLIC + "$" + "$") +target_link_libraries(${PROJECT_NAME}_test PUBLIC ${PROJECT_NAME} - ${PROJECT_NAME}_interfaces - ${catkin_LIBRARIES} -) + ${PROJECT_NAME}_interfaces) # Example showing an orbiting camera add_executable(${PROJECT_NAME}_orbit src/camera_orbit_example.cpp) +target_compile_options(${PROJECT_NAME}_orbit PRIVATE -std=c++11) set_target_properties(${PROJECT_NAME}_orbit PROPERTIES OUTPUT_NAME orbit_example PREFIX "") -target_link_libraries(${PROJECT_NAME}_orbit +target_include_directories(${PROJECT_NAME}_orbit PUBLIC + "$" + "$") +target_link_libraries(${PROJECT_NAME}_orbit PUBLIC ${PROJECT_NAME} - ${PROJECT_NAME}_interfaces - ${catkin_LIBRARIES} -) - -# Example showing orbiting camera with point cloud publishing in ROS -add_executable(${PROJECT_NAME}_ros_orbit src/camera_ros_example.cpp) -set_target_properties(${PROJECT_NAME}_ros_orbit PROPERTIES OUTPUT_NAME ros_example PREFIX "") -target_link_libraries(${PROJECT_NAME}_ros_orbit - ${PROJECT_NAME} - ${PROJECT_NAME}_interfaces - ${catkin_LIBRARIES} -) + ${PROJECT_NAME}_interfaces) -# Example showing sweeping laser scan with point cloud publishing in ROS -add_executable(${PROJECT_NAME}_laser_example src/laser_example.cpp) -set_target_properties(${PROJECT_NAME}_laser_example PROPERTIES OUTPUT_NAME laser_example PREFIX "") -target_link_libraries(${PROJECT_NAME}_laser_example - ${PROJECT_NAME}_sim_laser_scanner - ${catkin_LIBRARIES} -) +#add_executable(${PROJECT_NAME}_laser_example src/laser_example.cpp) +#set_target_properties(${PROJECT_NAME}_laser_example PROPERTIES OUTPUT_NAME laser_example PREFIX "") +#target_link_libraries(${PROJECT_NAME}_laser_example +# ${PROJECT_NAME}_sim_laser_scanner +# ${catkin_LIBRARIES} +#) -install( - TARGETS - ${PROJECT_NAME} - ${PROJECT_NAME}_interfaces - ${PROJECT_NAME}_sim_laser_scanner - ${PROJECT_NAME}_test - ${PROJECT_NAME}_orbit - ${PROJECT_NAME}_ros_orbit - ${PROJECT_NAME}_laser_example - ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -) +install(DIRECTORY include/${PROJECT_NAME} + DESTINATION include) -install(DIRECTORY include/${PROJECT_NAME}/ - DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -) - -############# -## Testing ## -############# -#if(CATKIN_ENABLE_TESTING) -# find_package(rostest REQUIRED) -# catkin_add_gtest(utest_node test/utest.cpp) -# target_link_libraries(utest_node -# ${catkin_LIBRARIES} -# ${PROJECT_NAME}_sim_laser_scanner -# ) -#endif() +install(TARGETS + glad + ${PROJECT_NAME} + ${PROJECT_NAME}_interfaces + ${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) diff --git a/cmake/gl_depth_sim-config.cmake.in b/cmake/gl_depth_sim-config.cmake.in new file mode 100644 index 0000000..683229b --- /dev/null +++ b/cmake/gl_depth_sim-config.cmake.in @@ -0,0 +1,15 @@ +@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(glfw3) + + +include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") diff --git a/include/gl_depth_sim/mesh.h b/include/gl_depth_sim/mesh.h index 6d4c545..ccdab8c 100644 --- a/include/gl_depth_sim/mesh.h +++ b/include/gl_depth_sim/mesh.h @@ -14,6 +14,8 @@ using EigenAlignedVec = std::vector>; class Mesh { public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + Mesh(const EigenAlignedVec& vertices, const std::vector& indices); std::size_t numIndices() const { return indices_.size(); } diff --git a/include/gl_depth_sim/shader_program.h b/include/gl_depth_sim/shader_program.h index 05cbbf1..20df837 100644 --- a/include/gl_depth_sim/shader_program.h +++ b/include/gl_depth_sim/shader_program.h @@ -10,6 +10,8 @@ namespace gl_depth_sim class ShaderProgram { public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + ShaderProgram(const std::string& vertex_shader, const std::string& frag_shader); ~ShaderProgram(); diff --git a/include/gl_depth_sim/sim_depth_camera.h b/include/gl_depth_sim/sim_depth_camera.h index 404955a..f0eef0c 100644 --- a/include/gl_depth_sim/sim_depth_camera.h +++ b/include/gl_depth_sim/sim_depth_camera.h @@ -23,6 +23,7 @@ struct RenderableObjectState { std::unique_ptr mesh; Eigen::Isometry3d pose; + EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; /** @@ -82,6 +83,9 @@ class SimDepthCamera GLFWwindow* window_; std::unique_ptr depth_program_; unsigned int fbo_; + +public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; } diff --git a/package.xml b/package.xml index 5518c5c..f575f12 100644 --- a/package.xml +++ b/package.xml @@ -8,18 +8,14 @@ LGPLv3 - catkin - roscpp - - - tf2_ros - tf2_eigen - pcl_ros - visualization_msgs - libglfw3-dev + assimp libopencv-dev + eigen + + cmake + From 7ac65be3714046a9d1d2bdf048dfc90f7c75edbd Mon Sep 17 00:00:00 2001 From: Joseph Schornak Date: Wed, 26 Feb 2020 13:12:47 -0600 Subject: [PATCH 02/14] Use EigenAlignedVec for RenderableObjectState --- include/gl_depth_sim/mesh.h | 5 ++--- include/gl_depth_sim/shader_program.h | 4 ++-- include/gl_depth_sim/sim_depth_camera.h | 18 +++++++++++------- src/gl_depth_sim/sim_depth_camera.cpp | 4 ++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/include/gl_depth_sim/mesh.h b/include/gl_depth_sim/mesh.h index ccdab8c..5e59d7c 100644 --- a/include/gl_depth_sim/mesh.h +++ b/include/gl_depth_sim/mesh.h @@ -10,12 +10,9 @@ namespace gl_depth_sim template using EigenAlignedVec = std::vector>; - class Mesh { public: - EIGEN_MAKE_ALIGNED_OPERATOR_NEW - Mesh(const EigenAlignedVec& vertices, const std::vector& indices); std::size_t numIndices() const { return indices_.size(); } @@ -24,6 +21,8 @@ class Mesh const std::vector& indices() const { return indices_; } const EigenAlignedVec& vertices() const { return vertices_; } + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + private: EigenAlignedVec vertices_; std::vector indices_; diff --git a/include/gl_depth_sim/shader_program.h b/include/gl_depth_sim/shader_program.h index 20df837..908f964 100644 --- a/include/gl_depth_sim/shader_program.h +++ b/include/gl_depth_sim/shader_program.h @@ -10,8 +10,6 @@ namespace gl_depth_sim class ShaderProgram { public: - EIGEN_MAKE_ALIGNED_OPERATOR_NEW - ShaderProgram(const std::string& vertex_shader, const std::string& frag_shader); ~ShaderProgram(); @@ -21,6 +19,8 @@ class ShaderProgram void setInt(const std::string& attr, int val); void setUniformMat4(const std::string &attr, const Eigen::Matrix4f& mat); + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + private: unsigned int id_; }; diff --git a/include/gl_depth_sim/sim_depth_camera.h b/include/gl_depth_sim/sim_depth_camera.h index f0eef0c..218e46a 100644 --- a/include/gl_depth_sim/sim_depth_camera.h +++ b/include/gl_depth_sim/sim_depth_camera.h @@ -1,10 +1,12 @@ #ifndef GL_DEPTH_SIM_SIM_DEPTH_CAMERA_H #define GL_DEPTH_SIM_SIM_DEPTH_CAMERA_H -#include "gl_depth_sim/camera_properties.h" -#include "gl_depth_sim/glfw_guard.h" -#include "gl_depth_sim/renderable_mesh.h" -#include "gl_depth_sim/shader_program.h" +#include +#include +#include +#include + +#include #include #include @@ -16,6 +18,9 @@ struct GLFWwindow; namespace gl_depth_sim { +template +using EigenAlignedVec = std::vector>; + /** * @brief Utility data structure used internally by @class SimDepthCamera */ @@ -39,6 +44,8 @@ struct RenderableObjectState class SimDepthCamera { public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + /** * @brief Creates an OpenGL context and window using the given camera parameters. Only one of these should be created * at a time. @@ -83,9 +90,6 @@ class SimDepthCamera GLFWwindow* window_; std::unique_ptr depth_program_; unsigned int fbo_; - -public: - EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; } diff --git a/src/gl_depth_sim/sim_depth_camera.cpp b/src/gl_depth_sim/sim_depth_camera.cpp index 599e407..74a263f 100644 --- a/src/gl_depth_sim/sim_depth_camera.cpp +++ b/src/gl_depth_sim/sim_depth_camera.cpp @@ -44,8 +44,8 @@ static Eigen::Matrix4d createProjectionMatrix(const gl_depth_sim::CameraProperti } gl_depth_sim::SimDepthCamera::SimDepthCamera(const gl_depth_sim::CameraProperties& camera) - : camera_{camera} - , proj_{createProjectionMatrix(camera)} + : camera_(camera) + , proj_(createProjectionMatrix(camera)) { // Load GLFW and OpenGL libraries; create window; create extensions initGLFW(); From 9f32685b37a5854c71e863c01b20e4545077cc37 Mon Sep 17 00:00:00 2001 From: Joseph Schornak Date: Wed, 26 Feb 2020 13:13:22 -0600 Subject: [PATCH 03/14] Disable AVX as workaround for Eigen alignment issue, default to C++14 --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 280f109..59c5669 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,8 @@ add_library(${PROJECT_NAME} SHARED src/${PROJECT_NAME}/renderable_mesh.cpp src/${PROJECT_NAME}/shader_program.cpp src/${PROJECT_NAME}/glfw_guard.cpp) -target_compile_options(${PROJECT_NAME} PRIVATE -std=c++11) +target_compile_options(${PROJECT_NAME} PRIVATE -std=c++14) +target_compile_options(${PROJECT_NAME} PUBLIC -mno-avx) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$") @@ -42,7 +43,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC add_library(${PROJECT_NAME}_interfaces SHARED src/interfaces/pcl_interface.cpp src/interfaces/opencv_interface.cpp) -target_compile_options(${PROJECT_NAME}_interfaces PRIVATE -std=c++11) +target_compile_options(${PROJECT_NAME}_interfaces PRIVATE -std=c++14) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$") @@ -67,7 +68,7 @@ target_link_libraries(${PROJECT_NAME}_sim_laser_scanner # Example showing basic usage add_executable(${PROJECT_NAME}_test src/usage_example.cpp) -target_compile_options(${PROJECT_NAME}_test PRIVATE -std=c++11) +target_compile_options(${PROJECT_NAME}_test PRIVATE -std=c++14) set_target_properties(${PROJECT_NAME}_test PROPERTIES OUTPUT_NAME depth_example PREFIX "") target_include_directories(${PROJECT_NAME}_test PUBLIC "$" @@ -78,7 +79,7 @@ target_link_libraries(${PROJECT_NAME}_test PUBLIC # Example showing an orbiting camera add_executable(${PROJECT_NAME}_orbit src/camera_orbit_example.cpp) -target_compile_options(${PROJECT_NAME}_orbit PRIVATE -std=c++11) +target_compile_options(${PROJECT_NAME}_orbit PRIVATE -std=c++14) set_target_properties(${PROJECT_NAME}_orbit PROPERTIES OUTPUT_NAME orbit_example PREFIX "") target_include_directories(${PROJECT_NAME}_orbit PUBLIC "$" From ad6193837b4b918740fabe761f1f82a0dbaf9d6d Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Tue, 15 Sep 2020 12:06:07 -0500 Subject: [PATCH 04/14] add optional package for roscpp demos --- CMakeLists.txt => gl_depth_sim/CMakeLists.txt | 11 +--- .../cmake}/gl_depth_sim-config.cmake.in | 0 {docs => gl_depth_sim/docs}/depth.gif | Bin {docs => gl_depth_sim/docs}/laser.gif | Bin .../include}/gl_depth_sim/KHR/khrplatform.h | 0 .../include}/gl_depth_sim/camera_properties.h | 0 .../include}/gl_depth_sim/glad/glad.h | 0 .../include}/gl_depth_sim/glfw_guard.h | 0 .../interfaces/opencv_interface.h | 0 .../gl_depth_sim/interfaces/pcl_interface.h | 0 .../include}/gl_depth_sim/mesh.h | 0 .../include}/gl_depth_sim/mesh_loader.h | 0 .../include}/gl_depth_sim/renderable_mesh.h | 0 .../include}/gl_depth_sim/shader_program.h | 0 .../include}/gl_depth_sim/sim_depth_camera.h | 0 .../include}/gl_depth_sim/sim_laser_scanner.h | 0 .../launch}/laser_example.launch | 0 .../launch}/laser_example.rviz | 0 package.xml => gl_depth_sim/package.xml | 0 .../src}/camera_orbit_example.cpp | 0 {src => gl_depth_sim/src}/gl_depth_sim/glad.c | 0 .../src}/gl_depth_sim/glfw_guard.cpp | 0 .../src}/gl_depth_sim/mesh.cpp | 0 .../src}/gl_depth_sim/mesh_loader.cpp | 0 .../src}/gl_depth_sim/renderable_mesh.cpp | 0 .../src}/gl_depth_sim/shader_program.cpp | 0 .../src}/gl_depth_sim/sim_depth_camera.cpp | 0 .../src}/gl_depth_sim/sim_laser_scanner.cpp | 0 .../src}/interfaces/opencv_interface.cpp | 0 .../src}/interfaces/pcl_interface.cpp | 0 {src => gl_depth_sim/src}/usage_example.cpp | 0 {test => gl_depth_sim/test}/cylinder_r1.stl | Bin .../test}/stanford_dragon.stl | Bin {test => gl_depth_sim/test}/utest.cpp | 0 roscpp_gl_depth_sim_demos/CMakeLists.txt | 48 ++++++++++++++++++ roscpp_gl_depth_sim_demos/package.xml | 21 ++++++++ .../src/camera_example.cpp | 0 .../src}/laser_example.cpp | 0 38 files changed, 70 insertions(+), 10 deletions(-) rename CMakeLists.txt => gl_depth_sim/CMakeLists.txt (90%) rename {cmake => gl_depth_sim/cmake}/gl_depth_sim-config.cmake.in (100%) rename {docs => gl_depth_sim/docs}/depth.gif (100%) rename {docs => gl_depth_sim/docs}/laser.gif (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/KHR/khrplatform.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/camera_properties.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/glad/glad.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/glfw_guard.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/interfaces/opencv_interface.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/interfaces/pcl_interface.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/mesh.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/mesh_loader.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/renderable_mesh.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/shader_program.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/sim_depth_camera.h (100%) rename {include => gl_depth_sim/include}/gl_depth_sim/sim_laser_scanner.h (100%) rename {launch => gl_depth_sim/launch}/laser_example.launch (100%) rename {launch => gl_depth_sim/launch}/laser_example.rviz (100%) rename package.xml => gl_depth_sim/package.xml (100%) rename {src => gl_depth_sim/src}/camera_orbit_example.cpp (100%) rename {src => gl_depth_sim/src}/gl_depth_sim/glad.c (100%) rename {src => gl_depth_sim/src}/gl_depth_sim/glfw_guard.cpp (100%) rename {src => gl_depth_sim/src}/gl_depth_sim/mesh.cpp (100%) rename {src => gl_depth_sim/src}/gl_depth_sim/mesh_loader.cpp (100%) rename {src => gl_depth_sim/src}/gl_depth_sim/renderable_mesh.cpp (100%) rename {src => gl_depth_sim/src}/gl_depth_sim/shader_program.cpp (100%) rename {src => gl_depth_sim/src}/gl_depth_sim/sim_depth_camera.cpp (100%) rename {src => gl_depth_sim/src}/gl_depth_sim/sim_laser_scanner.cpp (100%) rename {src => gl_depth_sim/src}/interfaces/opencv_interface.cpp (100%) rename {src => gl_depth_sim/src}/interfaces/pcl_interface.cpp (100%) rename {src => gl_depth_sim/src}/usage_example.cpp (100%) rename {test => gl_depth_sim/test}/cylinder_r1.stl (100%) rename {test => gl_depth_sim/test}/stanford_dragon.stl (100%) rename {test => gl_depth_sim/test}/utest.cpp (100%) create mode 100644 roscpp_gl_depth_sim_demos/CMakeLists.txt create mode 100644 roscpp_gl_depth_sim_demos/package.xml rename src/camera_ros_example.cpp => roscpp_gl_depth_sim_demos/src/camera_example.cpp (100%) rename {src => roscpp_gl_depth_sim_demos/src}/laser_example.cpp (100%) diff --git a/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt similarity index 90% rename from CMakeLists.txt rename to gl_depth_sim/CMakeLists.txt index 59c5669..34076c3 100644 --- a/CMakeLists.txt +++ b/gl_depth_sim/CMakeLists.txt @@ -59,9 +59,7 @@ target_link_libraries(${PROJECT_NAME}_interfaces PUBLIC add_library(${PROJECT_NAME}_sim_laser_scanner src/${PROJECT_NAME}/sim_laser_scanner.cpp ) -add_dependencies(${PROJECT_NAME}_interfaces ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) target_link_libraries(${PROJECT_NAME}_sim_laser_scanner - ${catkin_LIBRARIES} ${PROJECT_NAME} ${PROJECT_NAME}_interfaces ) @@ -71,7 +69,7 @@ add_executable(${PROJECT_NAME}_test src/usage_example.cpp) target_compile_options(${PROJECT_NAME}_test PRIVATE -std=c++14) set_target_properties(${PROJECT_NAME}_test PROPERTIES OUTPUT_NAME depth_example PREFIX "") target_include_directories(${PROJECT_NAME}_test PUBLIC - "$" + "$" "$") target_link_libraries(${PROJECT_NAME}_test PUBLIC ${PROJECT_NAME} @@ -88,13 +86,6 @@ target_link_libraries(${PROJECT_NAME}_orbit PUBLIC ${PROJECT_NAME} ${PROJECT_NAME}_interfaces) -#add_executable(${PROJECT_NAME}_laser_example src/laser_example.cpp) -#set_target_properties(${PROJECT_NAME}_laser_example PROPERTIES OUTPUT_NAME laser_example PREFIX "") -#target_link_libraries(${PROJECT_NAME}_laser_example -# ${PROJECT_NAME}_sim_laser_scanner -# ${catkin_LIBRARIES} -#) - install(DIRECTORY include/${PROJECT_NAME} DESTINATION include) diff --git a/cmake/gl_depth_sim-config.cmake.in b/gl_depth_sim/cmake/gl_depth_sim-config.cmake.in similarity index 100% rename from cmake/gl_depth_sim-config.cmake.in rename to gl_depth_sim/cmake/gl_depth_sim-config.cmake.in diff --git a/docs/depth.gif b/gl_depth_sim/docs/depth.gif similarity index 100% rename from docs/depth.gif rename to gl_depth_sim/docs/depth.gif diff --git a/docs/laser.gif b/gl_depth_sim/docs/laser.gif similarity index 100% rename from docs/laser.gif rename to gl_depth_sim/docs/laser.gif diff --git a/include/gl_depth_sim/KHR/khrplatform.h b/gl_depth_sim/include/gl_depth_sim/KHR/khrplatform.h similarity index 100% rename from include/gl_depth_sim/KHR/khrplatform.h rename to gl_depth_sim/include/gl_depth_sim/KHR/khrplatform.h diff --git a/include/gl_depth_sim/camera_properties.h b/gl_depth_sim/include/gl_depth_sim/camera_properties.h similarity index 100% rename from include/gl_depth_sim/camera_properties.h rename to gl_depth_sim/include/gl_depth_sim/camera_properties.h diff --git a/include/gl_depth_sim/glad/glad.h b/gl_depth_sim/include/gl_depth_sim/glad/glad.h similarity index 100% rename from include/gl_depth_sim/glad/glad.h rename to gl_depth_sim/include/gl_depth_sim/glad/glad.h diff --git a/include/gl_depth_sim/glfw_guard.h b/gl_depth_sim/include/gl_depth_sim/glfw_guard.h similarity index 100% rename from include/gl_depth_sim/glfw_guard.h rename to gl_depth_sim/include/gl_depth_sim/glfw_guard.h diff --git a/include/gl_depth_sim/interfaces/opencv_interface.h b/gl_depth_sim/include/gl_depth_sim/interfaces/opencv_interface.h similarity index 100% rename from include/gl_depth_sim/interfaces/opencv_interface.h rename to gl_depth_sim/include/gl_depth_sim/interfaces/opencv_interface.h diff --git a/include/gl_depth_sim/interfaces/pcl_interface.h b/gl_depth_sim/include/gl_depth_sim/interfaces/pcl_interface.h similarity index 100% rename from include/gl_depth_sim/interfaces/pcl_interface.h rename to gl_depth_sim/include/gl_depth_sim/interfaces/pcl_interface.h diff --git a/include/gl_depth_sim/mesh.h b/gl_depth_sim/include/gl_depth_sim/mesh.h similarity index 100% rename from include/gl_depth_sim/mesh.h rename to gl_depth_sim/include/gl_depth_sim/mesh.h diff --git a/include/gl_depth_sim/mesh_loader.h b/gl_depth_sim/include/gl_depth_sim/mesh_loader.h similarity index 100% rename from include/gl_depth_sim/mesh_loader.h rename to gl_depth_sim/include/gl_depth_sim/mesh_loader.h diff --git a/include/gl_depth_sim/renderable_mesh.h b/gl_depth_sim/include/gl_depth_sim/renderable_mesh.h similarity index 100% rename from include/gl_depth_sim/renderable_mesh.h rename to gl_depth_sim/include/gl_depth_sim/renderable_mesh.h diff --git a/include/gl_depth_sim/shader_program.h b/gl_depth_sim/include/gl_depth_sim/shader_program.h similarity index 100% rename from include/gl_depth_sim/shader_program.h rename to gl_depth_sim/include/gl_depth_sim/shader_program.h diff --git a/include/gl_depth_sim/sim_depth_camera.h b/gl_depth_sim/include/gl_depth_sim/sim_depth_camera.h similarity index 100% rename from include/gl_depth_sim/sim_depth_camera.h rename to gl_depth_sim/include/gl_depth_sim/sim_depth_camera.h diff --git a/include/gl_depth_sim/sim_laser_scanner.h b/gl_depth_sim/include/gl_depth_sim/sim_laser_scanner.h similarity index 100% rename from include/gl_depth_sim/sim_laser_scanner.h rename to gl_depth_sim/include/gl_depth_sim/sim_laser_scanner.h diff --git a/launch/laser_example.launch b/gl_depth_sim/launch/laser_example.launch similarity index 100% rename from launch/laser_example.launch rename to gl_depth_sim/launch/laser_example.launch diff --git a/launch/laser_example.rviz b/gl_depth_sim/launch/laser_example.rviz similarity index 100% rename from launch/laser_example.rviz rename to gl_depth_sim/launch/laser_example.rviz diff --git a/package.xml b/gl_depth_sim/package.xml similarity index 100% rename from package.xml rename to gl_depth_sim/package.xml diff --git a/src/camera_orbit_example.cpp b/gl_depth_sim/src/camera_orbit_example.cpp similarity index 100% rename from src/camera_orbit_example.cpp rename to gl_depth_sim/src/camera_orbit_example.cpp diff --git a/src/gl_depth_sim/glad.c b/gl_depth_sim/src/gl_depth_sim/glad.c similarity index 100% rename from src/gl_depth_sim/glad.c rename to gl_depth_sim/src/gl_depth_sim/glad.c diff --git a/src/gl_depth_sim/glfw_guard.cpp b/gl_depth_sim/src/gl_depth_sim/glfw_guard.cpp similarity index 100% rename from src/gl_depth_sim/glfw_guard.cpp rename to gl_depth_sim/src/gl_depth_sim/glfw_guard.cpp diff --git a/src/gl_depth_sim/mesh.cpp b/gl_depth_sim/src/gl_depth_sim/mesh.cpp similarity index 100% rename from src/gl_depth_sim/mesh.cpp rename to gl_depth_sim/src/gl_depth_sim/mesh.cpp diff --git a/src/gl_depth_sim/mesh_loader.cpp b/gl_depth_sim/src/gl_depth_sim/mesh_loader.cpp similarity index 100% rename from src/gl_depth_sim/mesh_loader.cpp rename to gl_depth_sim/src/gl_depth_sim/mesh_loader.cpp diff --git a/src/gl_depth_sim/renderable_mesh.cpp b/gl_depth_sim/src/gl_depth_sim/renderable_mesh.cpp similarity index 100% rename from src/gl_depth_sim/renderable_mesh.cpp rename to gl_depth_sim/src/gl_depth_sim/renderable_mesh.cpp diff --git a/src/gl_depth_sim/shader_program.cpp b/gl_depth_sim/src/gl_depth_sim/shader_program.cpp similarity index 100% rename from src/gl_depth_sim/shader_program.cpp rename to gl_depth_sim/src/gl_depth_sim/shader_program.cpp diff --git a/src/gl_depth_sim/sim_depth_camera.cpp b/gl_depth_sim/src/gl_depth_sim/sim_depth_camera.cpp similarity index 100% rename from src/gl_depth_sim/sim_depth_camera.cpp rename to gl_depth_sim/src/gl_depth_sim/sim_depth_camera.cpp diff --git a/src/gl_depth_sim/sim_laser_scanner.cpp b/gl_depth_sim/src/gl_depth_sim/sim_laser_scanner.cpp similarity index 100% rename from src/gl_depth_sim/sim_laser_scanner.cpp rename to gl_depth_sim/src/gl_depth_sim/sim_laser_scanner.cpp diff --git a/src/interfaces/opencv_interface.cpp b/gl_depth_sim/src/interfaces/opencv_interface.cpp similarity index 100% rename from src/interfaces/opencv_interface.cpp rename to gl_depth_sim/src/interfaces/opencv_interface.cpp diff --git a/src/interfaces/pcl_interface.cpp b/gl_depth_sim/src/interfaces/pcl_interface.cpp similarity index 100% rename from src/interfaces/pcl_interface.cpp rename to gl_depth_sim/src/interfaces/pcl_interface.cpp diff --git a/src/usage_example.cpp b/gl_depth_sim/src/usage_example.cpp similarity index 100% rename from src/usage_example.cpp rename to gl_depth_sim/src/usage_example.cpp diff --git a/test/cylinder_r1.stl b/gl_depth_sim/test/cylinder_r1.stl similarity index 100% rename from test/cylinder_r1.stl rename to gl_depth_sim/test/cylinder_r1.stl diff --git a/test/stanford_dragon.stl b/gl_depth_sim/test/stanford_dragon.stl similarity index 100% rename from test/stanford_dragon.stl rename to gl_depth_sim/test/stanford_dragon.stl diff --git a/test/utest.cpp b/gl_depth_sim/test/utest.cpp similarity index 100% rename from test/utest.cpp rename to gl_depth_sim/test/utest.cpp diff --git a/roscpp_gl_depth_sim_demos/CMakeLists.txt b/roscpp_gl_depth_sim_demos/CMakeLists.txt new file mode 100644 index 0000000..03a0560 --- /dev/null +++ b/roscpp_gl_depth_sim_demos/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.5.0) +project(roscpp_gl_depth_sim_demos) + +if (NOT $ENV{ROS_VERSION} EQUAL "1") + message(WARNING "ROS Version 1 not found, skipping project ${PROJECT_NAME}") + return() +endif() + +find_package(catkin REQUIRED COMPONENTS + roscpp + tf2_ros + tf2_eigen + visualization_msgs +) + +catkin_package( + CATKIN_DEPENDS + roscpp + tf2_ros + tf2_eigen + visualization_msgs + DEPENDS gl_depth_sim +) + +find_package(gl_depth_sim REQUIRED) + +add_executable(${PROJECT_NAME}_laser_example src/laser_example.cpp) +set_target_properties(${PROJECT_NAME}_laser_example PROPERTIES OUTPUT_NAME laser_example PREFIX "") +target_link_libraries(${PROJECT_NAME}_laser_example + ${catkin_LIBRARIES} + gl_depth_sim::gl_depth_sim_sim_laser_scanner +) + +add_executable(${PROJECT_NAME}_camera_example src/camera_example.cpp) +set_target_properties(${PROJECT_NAME}_camera_example PROPERTIES OUTPUT_NAME camera_example PREFIX "") +target_link_libraries(${PROJECT_NAME}_camera_example + ${catkin_LIBRARIES} + gl_depth_sim::gl_depth_interfaces +) + +install( + TARGETS + ${PROJECT_NAME}_camera_example + ${PROJECT_NAME}_laser_example + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) diff --git a/roscpp_gl_depth_sim_demos/package.xml b/roscpp_gl_depth_sim_demos/package.xml new file mode 100644 index 0000000..5e5542a --- /dev/null +++ b/roscpp_gl_depth_sim_demos/package.xml @@ -0,0 +1,21 @@ + + + gl_depth_sim + 0.0.1 + The roscpp_gl_depth_sim_demos package + + Jonathan Meyer + + LGPLv3 + + catkin + roscpp + + gl_depth_sim + tf2_ros + tf2_eigen + pcl_ros + visualization_msgs + + + diff --git a/src/camera_ros_example.cpp b/roscpp_gl_depth_sim_demos/src/camera_example.cpp similarity index 100% rename from src/camera_ros_example.cpp rename to roscpp_gl_depth_sim_demos/src/camera_example.cpp diff --git a/src/laser_example.cpp b/roscpp_gl_depth_sim_demos/src/laser_example.cpp similarity index 100% rename from src/laser_example.cpp rename to roscpp_gl_depth_sim_demos/src/laser_example.cpp From 7c26eb7994b18bff5e2ae7dbdc23b76fbf5aece2 Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Tue, 15 Sep 2020 12:09:18 -0500 Subject: [PATCH 05/14] add missing PCL dependency --- gl_depth_sim/CMakeLists.txt | 1 + gl_depth_sim/package.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/gl_depth_sim/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt index 34076c3..5704146 100644 --- a/gl_depth_sim/CMakeLists.txt +++ b/gl_depth_sim/CMakeLists.txt @@ -6,6 +6,7 @@ find_package(glfw3 REQUIRED) find_package(OpenGL REQUIRED) find_package(Eigen3 REQUIRED) find_package(PCL REQUIRED) +find_package(OpenCV REQUIRED) # Extensions find_package(assimp REQUIRED) # Just used for loading models in mesh_loader.h diff --git a/gl_depth_sim/package.xml b/gl_depth_sim/package.xml index f575f12..dfa3564 100644 --- a/gl_depth_sim/package.xml +++ b/gl_depth_sim/package.xml @@ -13,6 +13,7 @@ assimp libopencv-dev + libpcl-all-dev eigen From 371f4d806539b390368a6b3dc96b113f35b8156e Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Tue, 15 Sep 2020 12:17:05 -0500 Subject: [PATCH 06/14] fix wrong package name in package.xml --- roscpp_gl_depth_sim_demos/package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roscpp_gl_depth_sim_demos/package.xml b/roscpp_gl_depth_sim_demos/package.xml index 5e5542a..d5ee9d8 100644 --- a/roscpp_gl_depth_sim_demos/package.xml +++ b/roscpp_gl_depth_sim_demos/package.xml @@ -1,6 +1,6 @@ - gl_depth_sim + roscpp_gl_depth_sim_demos 0.0.1 The roscpp_gl_depth_sim_demos package From 8ff9467e4ee24191814ea605701cecbc48f58305 Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Tue, 15 Sep 2020 12:27:25 -0500 Subject: [PATCH 07/14] fix exported target names, missing laser_scanner library, and find_package order --- gl_depth_sim/CMakeLists.txt | 9 +++++++-- roscpp_gl_depth_sim_demos/CMakeLists.txt | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gl_depth_sim/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt index 5704146..dba86d5 100644 --- a/gl_depth_sim/CMakeLists.txt +++ b/gl_depth_sim/CMakeLists.txt @@ -57,10 +57,14 @@ target_link_libraries(${PROJECT_NAME}_interfaces PUBLIC ) # Simulated laser scanner library -add_library(${PROJECT_NAME}_sim_laser_scanner +add_library(${PROJECT_NAME}_laser_scanner src/${PROJECT_NAME}/sim_laser_scanner.cpp ) -target_link_libraries(${PROJECT_NAME}_sim_laser_scanner +target_include_directories(${PROJECT_NAME} PUBLIC + "$" + "$" +) +target_link_libraries(${PROJECT_NAME}_laser_scanner ${PROJECT_NAME} ${PROJECT_NAME}_interfaces ) @@ -94,6 +98,7 @@ install(TARGETS glad ${PROJECT_NAME} ${PROJECT_NAME}_interfaces + ${PROJECT_NAME}_laser_scanner ${PROJECT_NAME}_test ${PROJECT_NAME}_orbit EXPORT ${PROJECT_NAME}-targets diff --git a/roscpp_gl_depth_sim_demos/CMakeLists.txt b/roscpp_gl_depth_sim_demos/CMakeLists.txt index 03a0560..daaf548 100644 --- a/roscpp_gl_depth_sim_demos/CMakeLists.txt +++ b/roscpp_gl_depth_sim_demos/CMakeLists.txt @@ -6,6 +6,8 @@ if (NOT $ENV{ROS_VERSION} EQUAL "1") return() endif() +find_package(gl_depth_sim REQUIRED) + find_package(catkin REQUIRED COMPONENTS roscpp tf2_ros @@ -22,20 +24,18 @@ catkin_package( DEPENDS gl_depth_sim ) -find_package(gl_depth_sim REQUIRED) - add_executable(${PROJECT_NAME}_laser_example src/laser_example.cpp) set_target_properties(${PROJECT_NAME}_laser_example PROPERTIES OUTPUT_NAME laser_example PREFIX "") target_link_libraries(${PROJECT_NAME}_laser_example ${catkin_LIBRARIES} - gl_depth_sim::gl_depth_sim_sim_laser_scanner + gl_depth_sim::gl_depth_sim_laser_scanner ) add_executable(${PROJECT_NAME}_camera_example src/camera_example.cpp) set_target_properties(${PROJECT_NAME}_camera_example PROPERTIES OUTPUT_NAME camera_example PREFIX "") target_link_libraries(${PROJECT_NAME}_camera_example ${catkin_LIBRARIES} - gl_depth_sim::gl_depth_interfaces + gl_depth_sim::gl_depth_sim_interfaces ) install( From 0439a1f8675d0d903cabe44d98b7b415ed778c4a Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Tue, 15 Sep 2020 12:55:19 -0500 Subject: [PATCH 08/14] fix missing include dirs and pcl deps --- roscpp_gl_depth_sim_demos/CMakeLists.txt | 8 ++++++++ roscpp_gl_depth_sim_demos/package.xml | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/roscpp_gl_depth_sim_demos/CMakeLists.txt b/roscpp_gl_depth_sim_demos/CMakeLists.txt index daaf548..9b37f34 100644 --- a/roscpp_gl_depth_sim_demos/CMakeLists.txt +++ b/roscpp_gl_depth_sim_demos/CMakeLists.txt @@ -9,6 +9,8 @@ endif() find_package(gl_depth_sim REQUIRED) find_package(catkin REQUIRED COMPONENTS + pcl_conversions + pcl_ros roscpp tf2_ros tf2_eigen @@ -17,6 +19,8 @@ find_package(catkin REQUIRED COMPONENTS catkin_package( CATKIN_DEPENDS + pcl_conversions + pcl_ros roscpp tf2_ros tf2_eigen @@ -26,6 +30,8 @@ catkin_package( add_executable(${PROJECT_NAME}_laser_example src/laser_example.cpp) set_target_properties(${PROJECT_NAME}_laser_example PROPERTIES OUTPUT_NAME laser_example PREFIX "") +target_include_directories(${PROJECT_NAME}_laser_example SYSTEM PUBLIC + ${catkin_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME}_laser_example ${catkin_LIBRARIES} gl_depth_sim::gl_depth_sim_laser_scanner @@ -33,6 +39,8 @@ target_link_libraries(${PROJECT_NAME}_laser_example add_executable(${PROJECT_NAME}_camera_example src/camera_example.cpp) set_target_properties(${PROJECT_NAME}_camera_example PROPERTIES OUTPUT_NAME camera_example PREFIX "") +target_include_directories(${PROJECT_NAME}_camera_example SYSTEM PUBLIC + ${catkin_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME}_camera_example ${catkin_LIBRARIES} gl_depth_sim::gl_depth_sim_interfaces diff --git a/roscpp_gl_depth_sim_demos/package.xml b/roscpp_gl_depth_sim_demos/package.xml index d5ee9d8..0ab7018 100644 --- a/roscpp_gl_depth_sim_demos/package.xml +++ b/roscpp_gl_depth_sim_demos/package.xml @@ -9,13 +9,13 @@ LGPLv3 catkin - roscpp gl_depth_sim + pcl_conversions + pcl_ros + roscpp tf2_ros tf2_eigen - pcl_ros visualization_msgs - From 72baf622857e495462c03d11a13648cd83a51e27 Mon Sep 17 00:00:00 2001 From: Joseph Schornak Date: Mon, 21 Sep 2020 17:21:47 -0500 Subject: [PATCH 09/14] make roscpp demo deps conditional on ROS1 --- roscpp_gl_depth_sim_demos/package.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/roscpp_gl_depth_sim_demos/package.xml b/roscpp_gl_depth_sim_demos/package.xml index 0ab7018..3b1ad58 100644 --- a/roscpp_gl_depth_sim_demos/package.xml +++ b/roscpp_gl_depth_sim_demos/package.xml @@ -1,5 +1,5 @@ - + roscpp_gl_depth_sim_demos 0.0.1 The roscpp_gl_depth_sim_demos package @@ -8,14 +8,14 @@ LGPLv3 - catkin + catkin - gl_depth_sim - pcl_conversions - pcl_ros - roscpp - tf2_ros - tf2_eigen - visualization_msgs + gl_depth_sim + pcl_conversions + pcl_ros + roscpp + tf2_ros + tf2_eigen + visualization_msgs From 27bcfe493d8b359ceb092423bf5964961efff4c1 Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Wed, 23 Sep 2020 10:46:55 -0500 Subject: [PATCH 10/14] make laser_scanner library shared and its linked libraries public --- gl_depth_sim/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gl_depth_sim/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt index dba86d5..aece88e 100644 --- a/gl_depth_sim/CMakeLists.txt +++ b/gl_depth_sim/CMakeLists.txt @@ -57,14 +57,14 @@ target_link_libraries(${PROJECT_NAME}_interfaces PUBLIC ) # Simulated laser scanner library -add_library(${PROJECT_NAME}_laser_scanner +add_library(${PROJECT_NAME}_laser_scanner SHARED src/${PROJECT_NAME}/sim_laser_scanner.cpp ) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$" ) -target_link_libraries(${PROJECT_NAME}_laser_scanner +target_link_libraries(${PROJECT_NAME}_laser_scanner PUBLIC ${PROJECT_NAME} ${PROJECT_NAME}_interfaces ) From f5af5f5bfa5e413ff80a4e5c16350f2d67256c10 Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Wed, 23 Sep 2020 10:54:30 -0500 Subject: [PATCH 11/14] use old-style Eigen3 linking for Xenial compatibility --- gl_depth_sim/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gl_depth_sim/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt index aece88e..2267455 100644 --- a/gl_depth_sim/CMakeLists.txt +++ b/gl_depth_sim/CMakeLists.txt @@ -31,13 +31,14 @@ target_compile_options(${PROJECT_NAME} PUBLIC -mno-avx) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$") +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC + ${EIGEN3_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} PUBLIC ${ASSIMP_LIBRARIES} OpenGL::OpenGL glad dl glfw - Eigen3::Eigen ) # Libaries for interfacing with opencv and pcl From a3cea4272f99baceab4bfdeb78cc6386fca13a44 Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Wed, 23 Sep 2020 11:19:25 -0500 Subject: [PATCH 12/14] revert to use --- gl_depth_sim/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gl_depth_sim/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt index 2267455..7eb1e2d 100644 --- a/gl_depth_sim/CMakeLists.txt +++ b/gl_depth_sim/CMakeLists.txt @@ -35,7 +35,7 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} PUBLIC ${ASSIMP_LIBRARIES} - OpenGL::OpenGL + ${OPENGL_LIBRARIES} glad dl glfw From 2a257de4f7e59cdacef5409d5314e0cad0af8512 Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Wed, 23 Sep 2020 11:28:21 -0500 Subject: [PATCH 13/14] set compile options to use c++14 --- gl_depth_sim/CMakeLists.txt | 1 + roscpp_gl_depth_sim_demos/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/gl_depth_sim/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt index 7eb1e2d..7500c01 100644 --- a/gl_depth_sim/CMakeLists.txt +++ b/gl_depth_sim/CMakeLists.txt @@ -61,6 +61,7 @@ target_link_libraries(${PROJECT_NAME}_interfaces PUBLIC add_library(${PROJECT_NAME}_laser_scanner SHARED src/${PROJECT_NAME}/sim_laser_scanner.cpp ) +target_compile_options(${PROJECT_NAME}_laser_scanner PRIVATE -std=c++14) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$" diff --git a/roscpp_gl_depth_sim_demos/CMakeLists.txt b/roscpp_gl_depth_sim_demos/CMakeLists.txt index 9b37f34..eb86e66 100644 --- a/roscpp_gl_depth_sim_demos/CMakeLists.txt +++ b/roscpp_gl_depth_sim_demos/CMakeLists.txt @@ -30,6 +30,7 @@ catkin_package( add_executable(${PROJECT_NAME}_laser_example src/laser_example.cpp) set_target_properties(${PROJECT_NAME}_laser_example PROPERTIES OUTPUT_NAME laser_example PREFIX "") +target_compile_options(${PROJECT_NAME}_laser_example PRIVATE -std=c++14) target_include_directories(${PROJECT_NAME}_laser_example SYSTEM PUBLIC ${catkin_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME}_laser_example @@ -39,6 +40,7 @@ target_link_libraries(${PROJECT_NAME}_laser_example add_executable(${PROJECT_NAME}_camera_example src/camera_example.cpp) set_target_properties(${PROJECT_NAME}_camera_example PROPERTIES OUTPUT_NAME camera_example PREFIX "") +target_compile_options(${PROJECT_NAME}_camera_example PRIVATE -std=c++14) target_include_directories(${PROJECT_NAME}_camera_example SYSTEM PUBLIC ${catkin_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME}_camera_example From e9e85136858c2db98201227477b52e3d4d8b78fc Mon Sep 17 00:00:00 2001 From: Joe Schornak Date: Wed, 23 Sep 2020 11:45:40 -0500 Subject: [PATCH 14/14] add pthread library --- gl_depth_sim/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gl_depth_sim/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt index 7500c01..da71465 100644 --- a/gl_depth_sim/CMakeLists.txt +++ b/gl_depth_sim/CMakeLists.txt @@ -8,6 +8,9 @@ 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 @@ -27,7 +30,7 @@ add_library(${PROJECT_NAME} SHARED src/${PROJECT_NAME}/shader_program.cpp src/${PROJECT_NAME}/glfw_guard.cpp) target_compile_options(${PROJECT_NAME} PRIVATE -std=c++14) -target_compile_options(${PROJECT_NAME} PUBLIC -mno-avx) +target_compile_options(${PROJECT_NAME} PUBLIC -mno-avx -pthread) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$")