diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 9945ebb..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,146 +0,0 @@ -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 -) - -# Required for core functionality -find_package(glfw3 REQUIRED) -find_package(OpenGL REQUIRED) -find_package(Eigen3 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} -) - -# Primary rendering library -# Independent of ROS, but does need glfw3 and assimp for model loading -add_library(${PROJECT_NAME} - 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} - ${ASSIMP_LIBRARIES} - dl - glfw -) - -# Libaries for interfacing with opencv and pcl -add_library(${PROJECT_NAME}_interfaces - 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 - ${PROJECT_NAME} - ${catkin_LIBRARIES} - ${OpenCV_LIBRARIES} -) - -# Simulated laser scanner library -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 -) - -# 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_link_libraries(${PROJECT_NAME}_test - ${PROJECT_NAME} - ${PROJECT_NAME}_interfaces - ${catkin_LIBRARIES} -) - -# 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_link_libraries(${PROJECT_NAME}_orbit - ${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} -) - -# 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} -) - -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 ${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() diff --git a/gl_depth_sim/CMakeLists.txt b/gl_depth_sim/CMakeLists.txt new file mode 100644 index 0000000..da71465 --- /dev/null +++ b/gl_depth_sim/CMakeLists.txt @@ -0,0 +1,132 @@ +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) +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}/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} 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}/glfw_guard.cpp) +target_compile_options(${PROJECT_NAME} PRIVATE -std=c++14) +target_compile_options(${PROJECT_NAME} PUBLIC -mno-avx -pthread) +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_LIBRARIES} + glad + dl + glfw + ) + +# Libaries for interfacing with opencv and pcl +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++14) +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} + ${OpenCV_LIBRARIES} + ${PCL_LIBRARIES} +) + +# Simulated laser scanner library +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 + "$" + "$" +) +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) +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} + ${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++14) +set_target_properties(${PROJECT_NAME}_orbit PROPERTIES OUTPUT_NAME orbit_example PREFIX "") +target_include_directories(${PROJECT_NAME}_orbit PUBLIC + "$" + "$") +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) diff --git a/gl_depth_sim/cmake/gl_depth_sim-config.cmake.in b/gl_depth_sim/cmake/gl_depth_sim-config.cmake.in new file mode 100644 index 0000000..683229b --- /dev/null +++ b/gl_depth_sim/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/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 95% rename from include/gl_depth_sim/mesh.h rename to gl_depth_sim/include/gl_depth_sim/mesh.h index 6d4c545..5e59d7c 100644 --- a/include/gl_depth_sim/mesh.h +++ b/gl_depth_sim/include/gl_depth_sim/mesh.h @@ -10,7 +10,6 @@ namespace gl_depth_sim template using EigenAlignedVec = std::vector>; - class Mesh { public: @@ -22,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/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 93% rename from include/gl_depth_sim/shader_program.h rename to gl_depth_sim/include/gl_depth_sim/shader_program.h index 05cbbf1..908f964 100644 --- a/include/gl_depth_sim/shader_program.h +++ b/gl_depth_sim/include/gl_depth_sim/shader_program.h @@ -19,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/gl_depth_sim/include/gl_depth_sim/sim_depth_camera.h similarity index 88% rename from include/gl_depth_sim/sim_depth_camera.h rename to gl_depth_sim/include/gl_depth_sim/sim_depth_camera.h index 404955a..218e46a 100644 --- a/include/gl_depth_sim/sim_depth_camera.h +++ b/gl_depth_sim/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 */ @@ -23,6 +28,7 @@ struct RenderableObjectState { std::unique_ptr mesh; Eigen::Isometry3d pose; + EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; /** @@ -38,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. 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 62% rename from package.xml rename to gl_depth_sim/package.xml index 5518c5c..dfa3564 100644 --- a/package.xml +++ b/gl_depth_sim/package.xml @@ -8,18 +8,15 @@ LGPLv3 - catkin - roscpp - - - tf2_ros - tf2_eigen - pcl_ros - visualization_msgs - libglfw3-dev + assimp libopencv-dev + libpcl-all-dev + eigen + + cmake + 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 99% rename from src/gl_depth_sim/sim_depth_camera.cpp rename to gl_depth_sim/src/gl_depth_sim/sim_depth_camera.cpp index 599e407..74a263f 100644 --- a/src/gl_depth_sim/sim_depth_camera.cpp +++ b/gl_depth_sim/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(); 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..eb86e66 --- /dev/null +++ b/roscpp_gl_depth_sim_demos/CMakeLists.txt @@ -0,0 +1,58 @@ +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(gl_depth_sim REQUIRED) + +find_package(catkin REQUIRED COMPONENTS + pcl_conversions + pcl_ros + roscpp + tf2_ros + tf2_eigen + visualization_msgs +) + +catkin_package( + CATKIN_DEPENDS + pcl_conversions + pcl_ros + roscpp + tf2_ros + tf2_eigen + visualization_msgs + DEPENDS gl_depth_sim +) + +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 + ${catkin_LIBRARIES} + 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_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 + ${catkin_LIBRARIES} + gl_depth_sim::gl_depth_sim_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..3b1ad58 --- /dev/null +++ b/roscpp_gl_depth_sim_demos/package.xml @@ -0,0 +1,21 @@ + + + roscpp_gl_depth_sim_demos + 0.0.1 + The roscpp_gl_depth_sim_demos package + + Jonathan Meyer + + LGPLv3 + + catkin + + gl_depth_sim + pcl_conversions + pcl_ros + roscpp + tf2_ros + tf2_eigen + 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