@@ -4,8 +4,20 @@ project(ed_sensor_integration)
44add_compile_options (-Wall -Werror=all )
55add_compile_options (-Wextra -Werror=extra)
66
7+ find_package (Python COMPONENTS Interpreter REQUIRED)
8+ execute_process (
9+ COMMAND ${PYTHON_EXECUTABLE} -c "import torch; print(torch.__path__[0])"
10+ OUTPUT_VARIABLE TORCH_LIBRARY_PATH
11+ OUTPUT_STRIP_TRAILING_WHITESPACE
12+ ERROR_QUIET
13+ )
14+ message (VERBOSE "TORCH_LIBRARY_PATH: ${TORCH_LIBRARY_PATH} " )
15+
716find_package (OpenCV REQUIRED)
817find_package (PCL REQUIRED COMPONENTS common kdtree)
18+ find_package (Torch 1.10 REQUIRED
19+ PATHS "${TORCH_LIBRARY_PATH} /share/cmake"
20+ )
921find_package (catkin REQUIRED COMPONENTS
1022 code_profiler
1123 ed
@@ -31,7 +43,7 @@ catkin_package(
3143 INCLUDE_DIRS include
3244 LIBRARIES ed_kinect
3345 CATKIN_DEPENDS code_profiler ed ${PROJECT_NAME} _msgs geolib2 image_geometry rgbd rgbd_image_buffer roscpp tue_config visualization_msgs
34- DEPENDS OpenCV PCL
46+ DEPENDS OpenCV PCL Torch
3547)
3648
3749# ------------------------------------------------------------------------------------------------
@@ -42,6 +54,7 @@ include_directories(
4254 include
4355 SYSTEM
4456 ${OpenCV_INCLUDE_DIRS}
57+ ${TORCH_INCLUDE_DIRS}
4558 ${catkin_INCLUDE_DIRS}
4659)
4760
@@ -121,6 +134,9 @@ target_link_libraries(ed_clearer_plugin ${catkin_LIBRARIES})
121134# TOOLS
122135# ------------------------------------------------------------------------------------------------
123136
137+ add_executable (test_torch tools/test_torch.cpp)
138+ target_link_libraries (test_torch ${TORCH_LIBRARIES} )
139+
124140add_executable (ed_image_saver tools/image_saver.cpp)
125141target_link_libraries (ed_image_saver ${catkin_LIBRARIES} )
126142add_dependencies (ed_image_saver ${catkin_EXPORTED_TARGETS} )
@@ -168,6 +184,7 @@ install(
168184 ed_fitter_live
169185 ed_image_saver
170186 ed_segmenter
187+ test_torch
171188 DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
172189)
173190
@@ -184,6 +201,3 @@ if (CATKIN_ENABLE_TESTING)
184201 catkin_add_gtest(test_laser_fitting test /test_laser_segmenter.cpp)
185202 target_link_libraries (test_laser_fitting ${PROJECT_NAME} _console_bridge ed_laser ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} )
186203endif ()
187-
188-
189-
0 commit comments