Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit 8e5315a

Browse files
committed
Fix for ZED SDK 2.2 and Cuda 9
1 parent 04a7864 commit 8e5315a

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,17 @@ endfunction(checkPackage)
2222
find_package(ZED 2.1)
2323
checkPackage("ZED" "ZED SDK not found, install it from:\n https://www.stereolabs.com/developers/")
2424

25-
##For Jetson, OpenCV4Tegra is based on OpenCV2.4
2625
exec_program(uname ARGS -p OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2)
27-
if ( CMAKE_SYSTEM_NAME2 MATCHES "aarch64" ) # Jetson TX1
28-
SET(OCV_VERSION "2.4")
29-
SET(CUDA_VERSION "8.0")
26+
if ( CMAKE_SYSTEM_NAME2 MATCHES "aarch64" ) # Jetson TX
3027
SET(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
31-
else() # Ubuntu Desktop
32-
SET(OCV_VERSION "3.1")
33-
SET(CUDA_VERSION "8.0")
3428
endif()
3529

36-
find_package(OpenCV ${OCV_VERSION} COMPONENTS core highgui imgproc)
30+
find_package(OpenCV COMPONENTS core highgui imgproc)
3731
checkPackage("OPENCV_CORE" "OpenCV core not found, install it from the tutorial at:\n https://www.stereolabs.com/documentation/overview/getting-started/getting-started.html")
3832
checkPackage("OPENCV_HIGHGUI" "OpenCV highgui not found, install it from the tutorial at:\n https://www.stereolabs.com/documentation/overview/getting-started/getting-started.html")
3933
checkPackage("OPENCV_IMGPROC" "OpenCV imgproc not found, install it from the tutorial at:\n https://www.stereolabs.com/documentation/overview/getting-started/getting-started.html")
4034

41-
find_package(CUDA ${CUDA_VERSION})
35+
find_package(CUDA)
4236
checkPackage("CUDA" "CUDA not found, install it from:\n https://developer.nvidia.com/cuda-downloads")
4337

4438
find_package(PCL)
@@ -104,12 +98,19 @@ link_directories(${PCL_LIBRARY_DIRS})
10498
###############################################################################
10599
# EXECUTABLE
106100

101+
102+
if(NOT DEFINED CUDA_NPP_LIBRARIES_ZED)
103+
#To deal with cuda 9 nppi libs and previous versions of ZED SDK
104+
set(CUDA_NPP_LIBRARIES_ZED ${CUDA_npp_LIBRARY} ${CUDA_npps_LIBRARY} ${CUDA_nppi_LIBRARY})
105+
endif()
106+
107+
107108
add_definitions(-std=c++11)
108109
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4") ## if using from pcl package (pcl/vtk bug)
109110
set(LINK_LIBRARIES
110111
${catkin_LIBRARIES}
111112
${ZED_LIBRARIES}
112-
${CUDA_LIBRARIES} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY}
113+
${CUDA_LIBRARIES} ${CUDA_NPP_LIBRARIES_ZED}
113114
${OpenCV_LIBS}
114115
${PCL_LIBRARIES})
115116

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This package lets you use the ZED stereo camera with ROS. It outputs the camera
1111
### Prerequisites
1212

1313
- Ubuntu 16.04
14-
- [ZED SDK **2.1**](https://www.stereolabs.com/developers/) and its dependencies ([OpenCV](http://docs.opencv.org/3.1.0/d7/d9f/tutorial_linux_install.html), [CUDA](https://developer.nvidia.com/cuda-downloads))
14+
- [ZED SDK **2.1**](https://www.stereolabs.com/developers/) and its dependencies ([OpenCV](http://docs.opencv.org/3.1.0/d7/d9f/tutorial_linux_install.html), [CUDA](https://developer.nvidia.com/cuda-downloads))
1515
- [ROS Kinetic](http://wiki.ros.org/kinetic/Installation/Ubuntu)
1616
- [Point Cloud Library (PCL)](https://github.com/PointCloudLibrary/pcl)
1717

0 commit comments

Comments
 (0)