├── Files ├── Install Scripts │ ├── ROS-Tegra.sh │ └── ROS-Ubuntu.sh ├── OpenCV4Tegra-ROSIndigo │ ├── Untitled Document~ │ ├── cv_bridge.pc │ ├── cv_bridgeConfig.cmake │ ├── cv_bridgeConfig.cmake~ │ ├── image_geometry.pc │ ├── image_geometry.pc~ │ ├── image_geometryConfig.cmake │ └── image_geometryConfig.cmake~ └── OpenCV4Tegra-ROSKinetic │ ├── cv_bridge.pc │ ├── cv_bridge.pc~ │ ├── cv_bridgeConfig.cmake │ ├── cv_bridgeConfig.cmake~ │ ├── image_geometry.pc │ ├── image_geometry.pc~ │ ├── image_geometryConfig.cmake │ └── image_geometryConfig.cmake~ ├── ROS Packages ├── roscuda_basic │ ├── CMakeLists.txt │ ├── package.xml │ ├── roscuda_basic.launch │ └── src │ │ ├── basic.cu │ │ └── main.cpp ├── roscuda_img_filter │ ├── CMakeLists.txt │ ├── CMakeLists.txt~ │ ├── image_raw.bag │ ├── opencvtest.launch~ │ ├── package.xml │ ├── package.xml~ │ ├── roscuda_img_filter.launch │ ├── roscuda_img_filter.launch~ │ └── src │ │ ├── main.cpp │ │ └── sobel.cu ├── roscuda_laserscan_filter │ ├── CMakeLists.txt │ ├── laserscan_noise.bag │ ├── package.xml │ ├── roscuda_laserscan_filter.launch │ └── src │ │ ├── laserfilter.cu │ │ └── main.cpp ├── roscuda_template │ ├── CMakeLists.txt │ ├── package.xml │ ├── roscuda_template.launch │ └── src │ │ ├── main.cpp │ │ └── template.cu └── roscuda_vectoradd │ ├── CMakeLists.txt │ ├── package.xml │ ├── roscuda_vectoradd.launch │ └── src │ ├── main.cpp │ └── vectoradd.cu ├── license.md └── readme.md /Files/Install Scripts/ROS-Tegra.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script made to go along with the tutorial chapter GPU and ROS for Springer ROS Book 2018 (Vol 3) 3 | # Created by Nicolas Dalmedico 4 | # This script will install ROS Kinetic on your Nvidia Tegra K1, X1 or X2 5 | # Downloaded from: https://github.com/air-lasca/ros-cuda 6 | # More information about this script can be found inside the chapter. 7 | # If any problem is found report at: https://github.com/air-lasca/ros-cuda/issues 8 | 9 | # Setup locale 10 | sudo update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX 11 | # Allow packages from packages.ros.org 12 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list' 13 | # Setup keys 14 | sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 15 | # Update package lists 16 | sudo apt-get update 17 | # Install ROS desktop 18 | sudo apt-get install ros-kinetic-desktop -y 19 | # Install rosdep, initialize and update 20 | sudo apt-get install python-rosdep -y 21 | sudo rosdep init 22 | rosdep update 23 | # Setup environment variables 24 | echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc 25 | source ~/.bashrc 26 | # Install rosinstall (required for some packages) 27 | sudo apt-get install python-rosinstall -y 28 | # Rviz will crash if this variable is set 29 | echo "unset GTK_IM_MODULE" >> ~/.bashrc 30 | # Create the workspace and init 31 | mkdir -p ~/catkin_ws/src 32 | cd ~/catkin_ws/ 33 | catkin_make 34 | # Allow ROS to find the packages 35 | echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc 36 | source ~/.bashrc 37 | 38 | -------------------------------------------------------------------------------- /Files/Install Scripts/ROS-Ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script made to go along with the tutorial chapter GPU and ROS for Springer ROS Book 2018 (Vol 3) 3 | # Created by Nicolas Dalmedico 4 | # This script will install ROS Kinetic on your Ubuntu 16.04 PC 5 | # Downloaded from: https://github.com/air-lasca/ros-cuda 6 | # More information about this script can be found inside the chapter. 7 | # If any problem is found report at: https://github.com/air-lasca/ros-cuda/issues 8 | 9 | # Allow packages from packages.ros.org 10 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 11 | # Setup keys 12 | sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 13 | # Update package lists 14 | sudo apt-get update 15 | # Install ROS desktop 16 | sudo apt-get install ros-kinetic-desktop-full -y 17 | # Initialize rosdep and update 18 | sudo rosdep init 19 | rosdep update 20 | # Setup environment variables 21 | echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc 22 | source ~/.bashrc 23 | # Create the workspace and init 24 | mkdir -p ~/catkin_ws/src 25 | cd ~/catkin_ws/ 26 | catkin_make 27 | # Allow ROS to find the packages 28 | echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc 29 | source ~/.bashrc 30 | 31 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSIndigo/Untitled Document~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UTFPR-Robotics/ros-cuda/033b87eb91e3d3de84e45f9544b9944a94dea2fa/Files/OpenCV4Tegra-ROSIndigo/Untitled Document~ -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSIndigo/cv_bridge.pc: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/indigo 2 | 3 | Name: cv_bridge 4 | Description: Description of cv_bridge 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/indigo/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/indigo/lib -lcv_bridge -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: rosconsole sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSIndigo/cv_bridgeConfig.cmake: -------------------------------------------------------------------------------- 1 | # generated from catkin/cmake/template/pkgConfig.cmake.in 2 | 3 | # append elements to a list and remove existing duplicates from the list 4 | # copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig 5 | # self contained 6 | macro(_list_append_deduplicate listname) 7 | if(NOT "${ARGN}" STREQUAL "") 8 | if(${listname}) 9 | list(REMOVE_ITEM ${listname} ${ARGN}) 10 | endif() 11 | list(APPEND ${listname} ${ARGN}) 12 | endif() 13 | endmacro() 14 | 15 | # append elements to a list if they are not already in the list 16 | # copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig 17 | # self contained 18 | macro(_list_append_unique listname) 19 | foreach(_item ${ARGN}) 20 | list(FIND ${listname} ${_item} _index) 21 | if(_index EQUAL -1) 22 | list(APPEND ${listname} ${_item}) 23 | endif() 24 | endforeach() 25 | endmacro() 26 | 27 | # pack a list of libraries with optional build configuration keywords 28 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 29 | # self contained 30 | macro(_pack_libraries_with_build_configuration VAR) 31 | set(${VAR} "") 32 | set(_argn ${ARGN}) 33 | list(LENGTH _argn _count) 34 | set(_index 0) 35 | while(${_index} LESS ${_count}) 36 | list(GET _argn ${_index} lib) 37 | if("${lib}" MATCHES "^debug|optimized|general$") 38 | math(EXPR _index "${_index} + 1") 39 | if(${_index} EQUAL ${_count}) 40 | message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") 41 | endif() 42 | list(GET _argn ${_index} library) 43 | list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") 44 | else() 45 | list(APPEND ${VAR} "${lib}") 46 | endif() 47 | math(EXPR _index "${_index} + 1") 48 | endwhile() 49 | endmacro() 50 | 51 | # unpack a list of libraries with optional build configuration keyword prefixes 52 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 53 | # self contained 54 | macro(_unpack_libraries_with_build_configuration VAR) 55 | set(${VAR} "") 56 | foreach(lib ${ARGN}) 57 | string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") 58 | list(APPEND ${VAR} "${lib}") 59 | endforeach() 60 | endmacro() 61 | 62 | 63 | if(cv_bridge_CONFIG_INCLUDED) 64 | return() 65 | endif() 66 | set(cv_bridge_CONFIG_INCLUDED TRUE) 67 | 68 | # set variables for source/devel/install prefixes 69 | if("FALSE" STREQUAL "TRUE") 70 | set(cv_bridge_SOURCE_PREFIX /tmp/buildd/ros-indigo-cv-bridge-1.11.6-0trusty-20141201-2058) 71 | set(cv_bridge_DEVEL_PREFIX /tmp/buildd/ros-indigo-cv-bridge-1.11.6-0trusty-20141201-2058/obj-arm-linux-gnueabihf/devel) 72 | set(cv_bridge_INSTALL_PREFIX "") 73 | set(cv_bridge_PREFIX ${cv_bridge_DEVEL_PREFIX}) 74 | else() 75 | set(cv_bridge_SOURCE_PREFIX "") 76 | set(cv_bridge_DEVEL_PREFIX "") 77 | set(cv_bridge_INSTALL_PREFIX /opt/ros/indigo) 78 | set(cv_bridge_PREFIX ${cv_bridge_INSTALL_PREFIX}) 79 | endif() 80 | 81 | # warn when using a deprecated package 82 | if(NOT "" STREQUAL "") 83 | set(_msg "WARNING: package 'cv_bridge' is deprecated") 84 | # append custom deprecation text if available 85 | if(NOT "" STREQUAL "TRUE") 86 | set(_msg "${_msg} ()") 87 | endif() 88 | message("${_msg}") 89 | endif() 90 | 91 | # flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project 92 | set(cv_bridge_FOUND_CATKIN_PROJECT TRUE) 93 | 94 | if(NOT "include;/usr/include/opencv;/usr/include" STREQUAL "") 95 | set(cv_bridge_INCLUDE_DIRS "") 96 | set(_include_dirs "include;/usr/include/opencv;/usr/include") 97 | foreach(idir ${_include_dirs}) 98 | if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir}) 99 | set(include ${idir}) 100 | elseif("${idir}" STREQUAL "include") 101 | get_filename_component(include "${cv_bridge_DIR}/../../../include" ABSOLUTE) 102 | if(NOT IS_DIRECTORY ${include}) 103 | message(FATAL_ERROR "Project 'cv_bridge' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 104 | endif() 105 | else() 106 | message(FATAL_ERROR "Project 'cv_bridge' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/opt/ros/indigo/${idir}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 107 | endif() 108 | _list_append_unique(cv_bridge_INCLUDE_DIRS ${include}) 109 | endforeach() 110 | endif() 111 | 112 | set(libraries "cv_bridge;/usr/lib/libopencv_videostab.so.2.4.12;/usr/lib/libopencv_video.so.2.4.12;/usr/lib/libopencv_superres.so.2.4.12;/usr/lib/libopencv_stitching.so.2.4.12;/usr/lib/libopencv_photo.so.2.4.12;/usr/lib/libopencv_objdetect.so.2.4.12;/usr/lib/libopencv_ml.so.2.4.12;/usr/lib/libopencv_legacy.so.2.4.12;/usr/lib/libopencv_imgproc.so.2.4.12;/usr/lib/libopencv_highgui.so.2.4.12;/usr/lib/libopencv_gpu.so.2.4.12;/usr/lib/libopencv_flann.so.2.4.12;/usr/lib/libopencv_features2d.so.2.4.12;/usr/lib/libopencv_core.so.2.4.12;/usr/lib/libopencv_contrib.so.2.4.12;/usr/lib/libopencv_calib3d.so.2.4.12") 113 | foreach(library ${libraries}) 114 | # keep build configuration keywords, target names and absolute libraries as-is 115 | if("${library}" MATCHES "^debug|optimized|general$") 116 | list(APPEND cv_bridge_LIBRARIES ${library}) 117 | elseif(TARGET ${library}) 118 | list(APPEND cv_bridge_LIBRARIES ${library}) 119 | elseif(IS_ABSOLUTE ${library}) 120 | list(APPEND cv_bridge_LIBRARIES ${library}) 121 | else() 122 | set(lib_path "") 123 | set(lib "${library}-NOTFOUND") 124 | # since the path where the library is found is returned we have to iterate over the paths manually 125 | foreach(path /opt/ros/indigo/lib;/opt/ros/indigo/lib) 126 | find_library(lib ${library} 127 | PATHS ${path} 128 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) 129 | if(lib) 130 | set(lib_path ${path}) 131 | break() 132 | endif() 133 | endforeach() 134 | if(lib) 135 | _list_append_unique(cv_bridge_LIBRARY_DIRS ${lib_path}) 136 | list(APPEND cv_bridge_LIBRARIES ${lib}) 137 | else() 138 | # as a fall back for non-catkin libraries try to search globally 139 | find_library(lib ${library}) 140 | if(NOT lib) 141 | message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project 'cv_bridge'? Did you find_package() it before the subdirectory containing its code is included?") 142 | endif() 143 | list(APPEND cv_bridge_LIBRARIES ${lib}) 144 | endif() 145 | endif() 146 | endforeach() 147 | 148 | set(cv_bridge_EXPORTED_TARGETS "") 149 | # create dummy targets for exported code generation targets to make life of users easier 150 | foreach(t ${cv_bridge_EXPORTED_TARGETS}) 151 | if(NOT TARGET ${t}) 152 | add_custom_target(${t}) 153 | endif() 154 | endforeach() 155 | 156 | set(depends "rosconsole;sensor_msgs") 157 | foreach(depend ${depends}) 158 | string(REPLACE " " ";" depend_list ${depend}) 159 | # the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls 160 | list(GET depend_list 0 cv_bridge_dep) 161 | list(LENGTH depend_list count) 162 | if(${count} EQUAL 1) 163 | # simple dependencies must only be find_package()-ed once 164 | if(NOT ${cv_bridge_dep}_FOUND) 165 | find_package(${cv_bridge_dep} REQUIRED) 166 | endif() 167 | else() 168 | # dependencies with components must be find_package()-ed again 169 | list(REMOVE_AT depend_list 0) 170 | find_package(${cv_bridge_dep} REQUIRED ${depend_list}) 171 | endif() 172 | _list_append_unique(cv_bridge_INCLUDE_DIRS ${${cv_bridge_dep}_INCLUDE_DIRS}) 173 | 174 | # merge build configuration keywords with library names to correctly deduplicate 175 | _pack_libraries_with_build_configuration(cv_bridge_LIBRARIES ${cv_bridge_LIBRARIES}) 176 | _pack_libraries_with_build_configuration(_libraries ${${cv_bridge_dep}_LIBRARIES}) 177 | _list_append_deduplicate(cv_bridge_LIBRARIES ${_libraries}) 178 | # undo build configuration keyword merging after deduplication 179 | _unpack_libraries_with_build_configuration(cv_bridge_LIBRARIES ${cv_bridge_LIBRARIES}) 180 | 181 | _list_append_unique(cv_bridge_LIBRARY_DIRS ${${cv_bridge_dep}_LIBRARY_DIRS}) 182 | list(APPEND cv_bridge_EXPORTED_TARGETS ${${cv_bridge_dep}_EXPORTED_TARGETS}) 183 | endforeach() 184 | 185 | set(pkg_cfg_extras "") 186 | foreach(extra ${pkg_cfg_extras}) 187 | if(NOT IS_ABSOLUTE ${extra}) 188 | set(extra ${cv_bridge_DIR}/${extra}) 189 | endif() 190 | include(${extra}) 191 | endforeach() 192 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSIndigo/cv_bridgeConfig.cmake~: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/indigo 2 | 3 | Name: image_geometry 4 | Description: Description of image_geometry 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/indigo/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/indigo/lib -limage_geometry -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSIndigo/image_geometry.pc: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/indigo 2 | 3 | Name: image_geometry 4 | Description: Description of image_geometry 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/indigo/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/indigo/lib -limage_geometry -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSIndigo/image_geometry.pc~: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/indigo 2 | 3 | Name: cv_bridge 4 | Description: Description of cv_bridge 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/indigo/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/indigo/lib -lcv_bridge -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: rosconsole sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSIndigo/image_geometryConfig.cmake: -------------------------------------------------------------------------------- 1 | # generated from catkin/cmake/template/pkgConfig.cmake.in 2 | 3 | # append elements to a list and remove existing duplicates from the list 4 | # copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig 5 | # self contained 6 | macro(_list_append_deduplicate listname) 7 | if(NOT "${ARGN}" STREQUAL "") 8 | if(${listname}) 9 | list(REMOVE_ITEM ${listname} ${ARGN}) 10 | endif() 11 | list(APPEND ${listname} ${ARGN}) 12 | endif() 13 | endmacro() 14 | 15 | # append elements to a list if they are not already in the list 16 | # copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig 17 | # self contained 18 | macro(_list_append_unique listname) 19 | foreach(_item ${ARGN}) 20 | list(FIND ${listname} ${_item} _index) 21 | if(_index EQUAL -1) 22 | list(APPEND ${listname} ${_item}) 23 | endif() 24 | endforeach() 25 | endmacro() 26 | 27 | # pack a list of libraries with optional build configuration keywords 28 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 29 | # self contained 30 | macro(_pack_libraries_with_build_configuration VAR) 31 | set(${VAR} "") 32 | set(_argn ${ARGN}) 33 | list(LENGTH _argn _count) 34 | set(_index 0) 35 | while(${_index} LESS ${_count}) 36 | list(GET _argn ${_index} lib) 37 | if("${lib}" MATCHES "^debug|optimized|general$") 38 | math(EXPR _index "${_index} + 1") 39 | if(${_index} EQUAL ${_count}) 40 | message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") 41 | endif() 42 | list(GET _argn ${_index} library) 43 | list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") 44 | else() 45 | list(APPEND ${VAR} "${lib}") 46 | endif() 47 | math(EXPR _index "${_index} + 1") 48 | endwhile() 49 | endmacro() 50 | 51 | # unpack a list of libraries with optional build configuration keyword prefixes 52 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 53 | # self contained 54 | macro(_unpack_libraries_with_build_configuration VAR) 55 | set(${VAR} "") 56 | foreach(lib ${ARGN}) 57 | string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") 58 | list(APPEND ${VAR} "${lib}") 59 | endforeach() 60 | endmacro() 61 | 62 | 63 | if(image_geometry_CONFIG_INCLUDED) 64 | return() 65 | endif() 66 | set(image_geometry_CONFIG_INCLUDED TRUE) 67 | 68 | # set variables for source/devel/install prefixes 69 | if("FALSE" STREQUAL "TRUE") 70 | set(image_geometry_SOURCE_PREFIX /tmp/buildd/ros-indigo-image-geometry-1.11.6-0trusty-20141201-2057) 71 | set(image_geometry_DEVEL_PREFIX /tmp/buildd/ros-indigo-image-geometry-1.11.6-0trusty-20141201-2057/obj-arm-linux-gnueabihf/devel) 72 | set(image_geometry_INSTALL_PREFIX "") 73 | set(image_geometry_PREFIX ${image_geometry_DEVEL_PREFIX}) 74 | else() 75 | set(image_geometry_SOURCE_PREFIX "") 76 | set(image_geometry_DEVEL_PREFIX "") 77 | set(image_geometry_INSTALL_PREFIX /opt/ros/indigo) 78 | set(image_geometry_PREFIX ${image_geometry_INSTALL_PREFIX}) 79 | endif() 80 | 81 | # warn when using a deprecated package 82 | if(NOT "" STREQUAL "") 83 | set(_msg "WARNING: package 'image_geometry' is deprecated") 84 | # append custom deprecation text if available 85 | if(NOT "" STREQUAL "TRUE") 86 | set(_msg "${_msg} ()") 87 | endif() 88 | message("${_msg}") 89 | endif() 90 | 91 | # flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project 92 | set(image_geometry_FOUND_CATKIN_PROJECT TRUE) 93 | 94 | if(NOT "include;/usr/include/opencv;/usr/include" STREQUAL "") 95 | set(image_geometry_INCLUDE_DIRS "") 96 | set(_include_dirs "include;/usr/include/opencv;/usr/include") 97 | foreach(idir ${_include_dirs}) 98 | if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir}) 99 | set(include ${idir}) 100 | elseif("${idir}" STREQUAL "include") 101 | get_filename_component(include "${image_geometry_DIR}/../../../include" ABSOLUTE) 102 | if(NOT IS_DIRECTORY ${include}) 103 | message(FATAL_ERROR "Project 'image_geometry' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 104 | endif() 105 | else() 106 | message(FATAL_ERROR "Project 'image_geometry' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/opt/ros/indigo/${idir}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 107 | endif() 108 | _list_append_unique(image_geometry_INCLUDE_DIRS ${include}) 109 | endforeach() 110 | endif() 111 | 112 | set(libraries "image_geometry;/usr/lib/libopencv_videostab.so.2.4.12;/usr/lib/libopencv_video.so.2.4.12;/usr/lib/libopencv_superres.so.2.4.12;/usr/lib/libopencv_stitching.so.2.4.12;/usr/lib/libopencv_photo.so.2.4.12;/usr/lib/libopencv_objdetect.so.2.4.12;/usr/lib/libopencv_ml.so.2.4.12;/usr/lib/libopencv_legacy.so.2.4.12;/usr/lib/libopencv_imgproc.so.2.4.12;/usr/lib/libopencv_highgui.so.2.4.12;/usr/lib/libopencv_gpu.so.2.4.12;/usr/lib/libopencv_flann.so.2.4.12;/usr/lib/libopencv_features2d.so.2.4.12;/usr/lib/libopencv_core.so.2.4.12;/usr/lib/libopencv_contrib.so.2.4.12;/usr/lib/libopencv_calib3d.so.2.4.12") 113 | foreach(library ${libraries}) 114 | # keep build configuration keywords, target names and absolute libraries as-is 115 | if("${library}" MATCHES "^debug|optimized|general$") 116 | list(APPEND image_geometry_LIBRARIES ${library}) 117 | elseif(TARGET ${library}) 118 | list(APPEND image_geometry_LIBRARIES ${library}) 119 | elseif(IS_ABSOLUTE ${library}) 120 | list(APPEND image_geometry_LIBRARIES ${library}) 121 | else() 122 | set(lib_path "") 123 | set(lib "${library}-NOTFOUND") 124 | # since the path where the library is found is returned we have to iterate over the paths manually 125 | foreach(path /opt/ros/indigo/lib;/opt/ros/indigo/lib) 126 | find_library(lib ${library} 127 | PATHS ${path} 128 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) 129 | if(lib) 130 | set(lib_path ${path}) 131 | break() 132 | endif() 133 | endforeach() 134 | if(lib) 135 | _list_append_unique(image_geometry_LIBRARY_DIRS ${lib_path}) 136 | list(APPEND image_geometry_LIBRARIES ${lib}) 137 | else() 138 | # as a fall back for non-catkin libraries try to search globally 139 | find_library(lib ${library}) 140 | if(NOT lib) 141 | message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project 'image_geometry'? Did you find_package() it before the subdirectory containing its code is included?") 142 | endif() 143 | list(APPEND image_geometry_LIBRARIES ${lib}) 144 | endif() 145 | endif() 146 | endforeach() 147 | 148 | set(image_geometry_EXPORTED_TARGETS "") 149 | # create dummy targets for exported code generation targets to make life of users easier 150 | foreach(t ${image_geometry_EXPORTED_TARGETS}) 151 | if(NOT TARGET ${t}) 152 | add_custom_target(${t}) 153 | endif() 154 | endforeach() 155 | 156 | set(depends "sensor_msgs") 157 | foreach(depend ${depends}) 158 | string(REPLACE " " ";" depend_list ${depend}) 159 | # the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls 160 | list(GET depend_list 0 image_geometry_dep) 161 | list(LENGTH depend_list count) 162 | if(${count} EQUAL 1) 163 | # simple dependencies must only be find_package()-ed once 164 | if(NOT ${image_geometry_dep}_FOUND) 165 | find_package(${image_geometry_dep} REQUIRED) 166 | endif() 167 | else() 168 | # dependencies with components must be find_package()-ed again 169 | list(REMOVE_AT depend_list 0) 170 | find_package(${image_geometry_dep} REQUIRED ${depend_list}) 171 | endif() 172 | _list_append_unique(image_geometry_INCLUDE_DIRS ${${image_geometry_dep}_INCLUDE_DIRS}) 173 | 174 | # merge build configuration keywords with library names to correctly deduplicate 175 | _pack_libraries_with_build_configuration(image_geometry_LIBRARIES ${image_geometry_LIBRARIES}) 176 | _pack_libraries_with_build_configuration(_libraries ${${image_geometry_dep}_LIBRARIES}) 177 | _list_append_deduplicate(image_geometry_LIBRARIES ${_libraries}) 178 | # undo build configuration keyword merging after deduplication 179 | _unpack_libraries_with_build_configuration(image_geometry_LIBRARIES ${image_geometry_LIBRARIES}) 180 | 181 | _list_append_unique(image_geometry_LIBRARY_DIRS ${${image_geometry_dep}_LIBRARY_DIRS}) 182 | list(APPEND image_geometry_EXPORTED_TARGETS ${${image_geometry_dep}_EXPORTED_TARGETS}) 183 | endforeach() 184 | 185 | set(pkg_cfg_extras "") 186 | foreach(extra ${pkg_cfg_extras}) 187 | if(NOT IS_ABSOLUTE ${extra}) 188 | set(extra ${image_geometry_DIR}/${extra}) 189 | endif() 190 | include(${extra}) 191 | endforeach() 192 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSIndigo/image_geometryConfig.cmake~: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/indigo 2 | 3 | Name: cv_bridge 4 | Description: Description of cv_bridge 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/indigo/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/indigo/lib -lcv_bridge -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: rosconsole sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSKinetic/cv_bridge.pc: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/kinetic 2 | 3 | Name: cv_bridge 4 | Description: Description of cv_bridge 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/kinetic/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/kinetic/lib -lcv_bridge -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: rosconsole sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSKinetic/cv_bridge.pc~: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/indigo 2 | 3 | Name: cv_bridge 4 | Description: Description of cv_bridge 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/indigo/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/indigo/lib -lcv_bridge -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: rosconsole sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSKinetic/cv_bridgeConfig.cmake: -------------------------------------------------------------------------------- 1 | # generated from catkin/cmake/template/pkgConfig.cmake.in 2 | 3 | # append elements to a list and remove existing duplicates from the list 4 | # copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig 5 | # self contained 6 | macro(_list_append_deduplicate listname) 7 | if(NOT "${ARGN}" STREQUAL "") 8 | if(${listname}) 9 | list(REMOVE_ITEM ${listname} ${ARGN}) 10 | endif() 11 | list(APPEND ${listname} ${ARGN}) 12 | endif() 13 | endmacro() 14 | 15 | # append elements to a list if they are not already in the list 16 | # copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig 17 | # self contained 18 | macro(_list_append_unique listname) 19 | foreach(_item ${ARGN}) 20 | list(FIND ${listname} ${_item} _index) 21 | if(_index EQUAL -1) 22 | list(APPEND ${listname} ${_item}) 23 | endif() 24 | endforeach() 25 | endmacro() 26 | 27 | # pack a list of libraries with optional build configuration keywords 28 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 29 | # self contained 30 | macro(_pack_libraries_with_build_configuration VAR) 31 | set(${VAR} "") 32 | set(_argn ${ARGN}) 33 | list(LENGTH _argn _count) 34 | set(_index 0) 35 | while(${_index} LESS ${_count}) 36 | list(GET _argn ${_index} lib) 37 | if("${lib}" MATCHES "^debug|optimized|general$") 38 | math(EXPR _index "${_index} + 1") 39 | if(${_index} EQUAL ${_count}) 40 | message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") 41 | endif() 42 | list(GET _argn ${_index} library) 43 | list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") 44 | else() 45 | list(APPEND ${VAR} "${lib}") 46 | endif() 47 | math(EXPR _index "${_index} + 1") 48 | endwhile() 49 | endmacro() 50 | 51 | # unpack a list of libraries with optional build configuration keyword prefixes 52 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 53 | # self contained 54 | macro(_unpack_libraries_with_build_configuration VAR) 55 | set(${VAR} "") 56 | foreach(lib ${ARGN}) 57 | string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") 58 | list(APPEND ${VAR} "${lib}") 59 | endforeach() 60 | endmacro() 61 | 62 | 63 | if(cv_bridge_CONFIG_INCLUDED) 64 | return() 65 | endif() 66 | set(cv_bridge_CONFIG_INCLUDED TRUE) 67 | 68 | # set variables for source/devel/install prefixes 69 | if("FALSE" STREQUAL "TRUE") 70 | set(cv_bridge_SOURCE_PREFIX /tmp/buildd/ros-kinetic-cv-bridge-1.11.6-0trusty-20141201-2058) 71 | set(cv_bridge_DEVEL_PREFIX /tmp/buildd/ros-kinetic-cv-bridge-1.11.6-0trusty-20141201-2058/obj-arm-linux-gnueabihf/devel) 72 | set(cv_bridge_INSTALL_PREFIX "") 73 | set(cv_bridge_PREFIX ${cv_bridge_DEVEL_PREFIX}) 74 | else() 75 | set(cv_bridge_SOURCE_PREFIX "") 76 | set(cv_bridge_DEVEL_PREFIX "") 77 | set(cv_bridge_INSTALL_PREFIX /opt/ros/kinetic) 78 | set(cv_bridge_PREFIX ${cv_bridge_INSTALL_PREFIX}) 79 | endif() 80 | 81 | # warn when using a deprecated package 82 | if(NOT "" STREQUAL "") 83 | set(_msg "WARNING: package 'cv_bridge' is deprecated") 84 | # append custom deprecation text if available 85 | if(NOT "" STREQUAL "TRUE") 86 | set(_msg "${_msg} ()") 87 | endif() 88 | message("${_msg}") 89 | endif() 90 | 91 | # flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project 92 | set(cv_bridge_FOUND_CATKIN_PROJECT TRUE) 93 | 94 | if(NOT "include;/usr/include/opencv;/usr/include" STREQUAL "") 95 | set(cv_bridge_INCLUDE_DIRS "") 96 | set(_include_dirs "include;/usr/include/opencv;/usr/include") 97 | foreach(idir ${_include_dirs}) 98 | if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir}) 99 | set(include ${idir}) 100 | elseif("${idir}" STREQUAL "include") 101 | get_filename_component(include "${cv_bridge_DIR}/../../../include" ABSOLUTE) 102 | if(NOT IS_DIRECTORY ${include}) 103 | message(FATAL_ERROR "Project 'cv_bridge' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 104 | endif() 105 | else() 106 | message(FATAL_ERROR "Project 'cv_bridge' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/opt/ros/kinetic/${idir}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 107 | endif() 108 | _list_append_unique(cv_bridge_INCLUDE_DIRS ${include}) 109 | endforeach() 110 | endif() 111 | 112 | set(libraries "cv_bridge;/usr/lib/libopencv_videostab.so.2.4.12;/usr/lib/libopencv_video.so.2.4.12;/usr/lib/libopencv_superres.so.2.4.12;/usr/lib/libopencv_stitching.so.2.4.12;/usr/lib/libopencv_photo.so.2.4.12;/usr/lib/libopencv_objdetect.so.2.4.12;/usr/lib/libopencv_ml.so.2.4.12;/usr/lib/libopencv_legacy.so.2.4.12;/usr/lib/libopencv_imgproc.so.2.4.12;/usr/lib/libopencv_highgui.so.2.4.12;/usr/lib/libopencv_gpu.so.2.4.12;/usr/lib/libopencv_flann.so.2.4.12;/usr/lib/libopencv_features2d.so.2.4.12;/usr/lib/libopencv_core.so.2.4.12;/usr/lib/libopencv_contrib.so.2.4.12;/usr/lib/libopencv_calib3d.so.2.4.12") 113 | foreach(library ${libraries}) 114 | # keep build configuration keywords, target names and absolute libraries as-is 115 | if("${library}" MATCHES "^debug|optimized|general$") 116 | list(APPEND cv_bridge_LIBRARIES ${library}) 117 | elseif(TARGET ${library}) 118 | list(APPEND cv_bridge_LIBRARIES ${library}) 119 | elseif(IS_ABSOLUTE ${library}) 120 | list(APPEND cv_bridge_LIBRARIES ${library}) 121 | else() 122 | set(lib_path "") 123 | set(lib "${library}-NOTFOUND") 124 | # since the path where the library is found is returned we have to iterate over the paths manually 125 | foreach(path /opt/ros/kinetic/lib;/opt/ros/kinetic/lib) 126 | find_library(lib ${library} 127 | PATHS ${path} 128 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) 129 | if(lib) 130 | set(lib_path ${path}) 131 | break() 132 | endif() 133 | endforeach() 134 | if(lib) 135 | _list_append_unique(cv_bridge_LIBRARY_DIRS ${lib_path}) 136 | list(APPEND cv_bridge_LIBRARIES ${lib}) 137 | else() 138 | # as a fall back for non-catkin libraries try to search globally 139 | find_library(lib ${library}) 140 | if(NOT lib) 141 | message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project 'cv_bridge'? Did you find_package() it before the subdirectory containing its code is included?") 142 | endif() 143 | list(APPEND cv_bridge_LIBRARIES ${lib}) 144 | endif() 145 | endif() 146 | endforeach() 147 | 148 | set(cv_bridge_EXPORTED_TARGETS "") 149 | # create dummy targets for exported code generation targets to make life of users easier 150 | foreach(t ${cv_bridge_EXPORTED_TARGETS}) 151 | if(NOT TARGET ${t}) 152 | add_custom_target(${t}) 153 | endif() 154 | endforeach() 155 | 156 | set(depends "rosconsole;sensor_msgs") 157 | foreach(depend ${depends}) 158 | string(REPLACE " " ";" depend_list ${depend}) 159 | # the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls 160 | list(GET depend_list 0 cv_bridge_dep) 161 | list(LENGTH depend_list count) 162 | if(${count} EQUAL 1) 163 | # simple dependencies must only be find_package()-ed once 164 | if(NOT ${cv_bridge_dep}_FOUND) 165 | find_package(${cv_bridge_dep} REQUIRED) 166 | endif() 167 | else() 168 | # dependencies with components must be find_package()-ed again 169 | list(REMOVE_AT depend_list 0) 170 | find_package(${cv_bridge_dep} REQUIRED ${depend_list}) 171 | endif() 172 | _list_append_unique(cv_bridge_INCLUDE_DIRS ${${cv_bridge_dep}_INCLUDE_DIRS}) 173 | 174 | # merge build configuration keywords with library names to correctly deduplicate 175 | _pack_libraries_with_build_configuration(cv_bridge_LIBRARIES ${cv_bridge_LIBRARIES}) 176 | _pack_libraries_with_build_configuration(_libraries ${${cv_bridge_dep}_LIBRARIES}) 177 | _list_append_deduplicate(cv_bridge_LIBRARIES ${_libraries}) 178 | # undo build configuration keyword merging after deduplication 179 | _unpack_libraries_with_build_configuration(cv_bridge_LIBRARIES ${cv_bridge_LIBRARIES}) 180 | 181 | _list_append_unique(cv_bridge_LIBRARY_DIRS ${${cv_bridge_dep}_LIBRARY_DIRS}) 182 | list(APPEND cv_bridge_EXPORTED_TARGETS ${${cv_bridge_dep}_EXPORTED_TARGETS}) 183 | endforeach() 184 | 185 | set(pkg_cfg_extras "") 186 | foreach(extra ${pkg_cfg_extras}) 187 | if(NOT IS_ABSOLUTE ${extra}) 188 | set(extra ${cv_bridge_DIR}/${extra}) 189 | endif() 190 | include(${extra}) 191 | endforeach() 192 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSKinetic/cv_bridgeConfig.cmake~: -------------------------------------------------------------------------------- 1 | # generated from catkin/cmake/template/pkgConfig.cmake.in 2 | 3 | # append elements to a list and remove existing duplicates from the list 4 | # copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig 5 | # self contained 6 | macro(_list_append_deduplicate listname) 7 | if(NOT "${ARGN}" STREQUAL "") 8 | if(${listname}) 9 | list(REMOVE_ITEM ${listname} ${ARGN}) 10 | endif() 11 | list(APPEND ${listname} ${ARGN}) 12 | endif() 13 | endmacro() 14 | 15 | # append elements to a list if they are not already in the list 16 | # copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig 17 | # self contained 18 | macro(_list_append_unique listname) 19 | foreach(_item ${ARGN}) 20 | list(FIND ${listname} ${_item} _index) 21 | if(_index EQUAL -1) 22 | list(APPEND ${listname} ${_item}) 23 | endif() 24 | endforeach() 25 | endmacro() 26 | 27 | # pack a list of libraries with optional build configuration keywords 28 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 29 | # self contained 30 | macro(_pack_libraries_with_build_configuration VAR) 31 | set(${VAR} "") 32 | set(_argn ${ARGN}) 33 | list(LENGTH _argn _count) 34 | set(_index 0) 35 | while(${_index} LESS ${_count}) 36 | list(GET _argn ${_index} lib) 37 | if("${lib}" MATCHES "^debug|optimized|general$") 38 | math(EXPR _index "${_index} + 1") 39 | if(${_index} EQUAL ${_count}) 40 | message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") 41 | endif() 42 | list(GET _argn ${_index} library) 43 | list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") 44 | else() 45 | list(APPEND ${VAR} "${lib}") 46 | endif() 47 | math(EXPR _index "${_index} + 1") 48 | endwhile() 49 | endmacro() 50 | 51 | # unpack a list of libraries with optional build configuration keyword prefixes 52 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 53 | # self contained 54 | macro(_unpack_libraries_with_build_configuration VAR) 55 | set(${VAR} "") 56 | foreach(lib ${ARGN}) 57 | string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") 58 | list(APPEND ${VAR} "${lib}") 59 | endforeach() 60 | endmacro() 61 | 62 | 63 | if(cv_bridge_CONFIG_INCLUDED) 64 | return() 65 | endif() 66 | set(cv_bridge_CONFIG_INCLUDED TRUE) 67 | 68 | # set variables for source/devel/install prefixes 69 | if("FALSE" STREQUAL "TRUE") 70 | set(cv_bridge_SOURCE_PREFIX /tmp/buildd/ros-indigo-cv-bridge-1.11.6-0trusty-20141201-2058) 71 | set(cv_bridge_DEVEL_PREFIX /tmp/buildd/ros-indigo-cv-bridge-1.11.6-0trusty-20141201-2058/obj-arm-linux-gnueabihf/devel) 72 | set(cv_bridge_INSTALL_PREFIX "") 73 | set(cv_bridge_PREFIX ${cv_bridge_DEVEL_PREFIX}) 74 | else() 75 | set(cv_bridge_SOURCE_PREFIX "") 76 | set(cv_bridge_DEVEL_PREFIX "") 77 | set(cv_bridge_INSTALL_PREFIX /opt/ros/indigo) 78 | set(cv_bridge_PREFIX ${cv_bridge_INSTALL_PREFIX}) 79 | endif() 80 | 81 | # warn when using a deprecated package 82 | if(NOT "" STREQUAL "") 83 | set(_msg "WARNING: package 'cv_bridge' is deprecated") 84 | # append custom deprecation text if available 85 | if(NOT "" STREQUAL "TRUE") 86 | set(_msg "${_msg} ()") 87 | endif() 88 | message("${_msg}") 89 | endif() 90 | 91 | # flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project 92 | set(cv_bridge_FOUND_CATKIN_PROJECT TRUE) 93 | 94 | if(NOT "include;/usr/include/opencv;/usr/include" STREQUAL "") 95 | set(cv_bridge_INCLUDE_DIRS "") 96 | set(_include_dirs "include;/usr/include/opencv;/usr/include") 97 | foreach(idir ${_include_dirs}) 98 | if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir}) 99 | set(include ${idir}) 100 | elseif("${idir}" STREQUAL "include") 101 | get_filename_component(include "${cv_bridge_DIR}/../../../include" ABSOLUTE) 102 | if(NOT IS_DIRECTORY ${include}) 103 | message(FATAL_ERROR "Project 'cv_bridge' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 104 | endif() 105 | else() 106 | message(FATAL_ERROR "Project 'cv_bridge' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/opt/ros/indigo/${idir}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 107 | endif() 108 | _list_append_unique(cv_bridge_INCLUDE_DIRS ${include}) 109 | endforeach() 110 | endif() 111 | 112 | set(libraries "cv_bridge;/usr/lib/libopencv_videostab.so.2.4.12;/usr/lib/libopencv_video.so.2.4.12;/usr/lib/libopencv_superres.so.2.4.12;/usr/lib/libopencv_stitching.so.2.4.12;/usr/lib/libopencv_photo.so.2.4.12;/usr/lib/libopencv_objdetect.so.2.4.12;/usr/lib/libopencv_ml.so.2.4.12;/usr/lib/libopencv_legacy.so.2.4.12;/usr/lib/libopencv_imgproc.so.2.4.12;/usr/lib/libopencv_highgui.so.2.4.12;/usr/lib/libopencv_gpu.so.2.4.12;/usr/lib/libopencv_flann.so.2.4.12;/usr/lib/libopencv_features2d.so.2.4.12;/usr/lib/libopencv_core.so.2.4.12;/usr/lib/libopencv_contrib.so.2.4.12;/usr/lib/libopencv_calib3d.so.2.4.12") 113 | foreach(library ${libraries}) 114 | # keep build configuration keywords, target names and absolute libraries as-is 115 | if("${library}" MATCHES "^debug|optimized|general$") 116 | list(APPEND cv_bridge_LIBRARIES ${library}) 117 | elseif(TARGET ${library}) 118 | list(APPEND cv_bridge_LIBRARIES ${library}) 119 | elseif(IS_ABSOLUTE ${library}) 120 | list(APPEND cv_bridge_LIBRARIES ${library}) 121 | else() 122 | set(lib_path "") 123 | set(lib "${library}-NOTFOUND") 124 | # since the path where the library is found is returned we have to iterate over the paths manually 125 | foreach(path /opt/ros/indigo/lib;/opt/ros/indigo/lib) 126 | find_library(lib ${library} 127 | PATHS ${path} 128 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) 129 | if(lib) 130 | set(lib_path ${path}) 131 | break() 132 | endif() 133 | endforeach() 134 | if(lib) 135 | _list_append_unique(cv_bridge_LIBRARY_DIRS ${lib_path}) 136 | list(APPEND cv_bridge_LIBRARIES ${lib}) 137 | else() 138 | # as a fall back for non-catkin libraries try to search globally 139 | find_library(lib ${library}) 140 | if(NOT lib) 141 | message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project 'cv_bridge'? Did you find_package() it before the subdirectory containing its code is included?") 142 | endif() 143 | list(APPEND cv_bridge_LIBRARIES ${lib}) 144 | endif() 145 | endif() 146 | endforeach() 147 | 148 | set(cv_bridge_EXPORTED_TARGETS "") 149 | # create dummy targets for exported code generation targets to make life of users easier 150 | foreach(t ${cv_bridge_EXPORTED_TARGETS}) 151 | if(NOT TARGET ${t}) 152 | add_custom_target(${t}) 153 | endif() 154 | endforeach() 155 | 156 | set(depends "rosconsole;sensor_msgs") 157 | foreach(depend ${depends}) 158 | string(REPLACE " " ";" depend_list ${depend}) 159 | # the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls 160 | list(GET depend_list 0 cv_bridge_dep) 161 | list(LENGTH depend_list count) 162 | if(${count} EQUAL 1) 163 | # simple dependencies must only be find_package()-ed once 164 | if(NOT ${cv_bridge_dep}_FOUND) 165 | find_package(${cv_bridge_dep} REQUIRED) 166 | endif() 167 | else() 168 | # dependencies with components must be find_package()-ed again 169 | list(REMOVE_AT depend_list 0) 170 | find_package(${cv_bridge_dep} REQUIRED ${depend_list}) 171 | endif() 172 | _list_append_unique(cv_bridge_INCLUDE_DIRS ${${cv_bridge_dep}_INCLUDE_DIRS}) 173 | 174 | # merge build configuration keywords with library names to correctly deduplicate 175 | _pack_libraries_with_build_configuration(cv_bridge_LIBRARIES ${cv_bridge_LIBRARIES}) 176 | _pack_libraries_with_build_configuration(_libraries ${${cv_bridge_dep}_LIBRARIES}) 177 | _list_append_deduplicate(cv_bridge_LIBRARIES ${_libraries}) 178 | # undo build configuration keyword merging after deduplication 179 | _unpack_libraries_with_build_configuration(cv_bridge_LIBRARIES ${cv_bridge_LIBRARIES}) 180 | 181 | _list_append_unique(cv_bridge_LIBRARY_DIRS ${${cv_bridge_dep}_LIBRARY_DIRS}) 182 | list(APPEND cv_bridge_EXPORTED_TARGETS ${${cv_bridge_dep}_EXPORTED_TARGETS}) 183 | endforeach() 184 | 185 | set(pkg_cfg_extras "") 186 | foreach(extra ${pkg_cfg_extras}) 187 | if(NOT IS_ABSOLUTE ${extra}) 188 | set(extra ${cv_bridge_DIR}/${extra}) 189 | endif() 190 | include(${extra}) 191 | endforeach() 192 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSKinetic/image_geometry.pc: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/kinetic 2 | 3 | Name: image_geometry 4 | Description: Description of image_geometry 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/kinetic/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/kinetic/lib -limage_geometry -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSKinetic/image_geometry.pc~: -------------------------------------------------------------------------------- 1 | prefix=/opt/ros/indigo 2 | 3 | Name: image_geometry 4 | Description: Description of image_geometry 5 | Version: 1.11.6 6 | Cflags: -I/opt/ros/indigo/include -I/usr/include/opencv -I/usr/include 7 | Libs: -L/opt/ros/indigo/lib -limage_geometry -l:/usr/lib/libopencv_videostab.so.2.4.12 -l:/usr/lib/libopencv_video.so.2.4.12 -l:/usr/lib/libopencv_superres.so.2.4.12 -l:/usr/lib/libopencv_stitching.so.2.4.12 -l:/usr/lib/libopencv_photo.so.2.4.12 -l:/usr/lib/libopencv_objdetect.so.2.4.12 -l:/usr/lib/libopencv_ml.so.2.4.12 -l:/usr/lib/libopencv_legacy.so.2.4.12 -l:/usr/lib/libopencv_imgproc.so.2.4.12 -l:/usr/lib/libopencv_highgui.so.2.4.12 -l:/usr/lib/libopencv_gpu.so.2.4.12 -l:/usr/lib/libopencv_flann.so.2.4.12 -l:/usr/lib/libopencv_features2d.so.2.4.12 -l:/usr/lib/libopencv_core.so.2.4.12 -l:/usr/lib/libopencv_contrib.so.2.4.12 -l:/usr/lib/libopencv_calib3d.so.2.4.12 8 | Requires: sensor_msgs 9 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSKinetic/image_geometryConfig.cmake: -------------------------------------------------------------------------------- 1 | # generated from catkin/cmake/template/pkgConfig.cmake.in 2 | 3 | # append elements to a list and remove existing duplicates from the list 4 | # copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig 5 | # self contained 6 | macro(_list_append_deduplicate listname) 7 | if(NOT "${ARGN}" STREQUAL "") 8 | if(${listname}) 9 | list(REMOVE_ITEM ${listname} ${ARGN}) 10 | endif() 11 | list(APPEND ${listname} ${ARGN}) 12 | endif() 13 | endmacro() 14 | 15 | # append elements to a list if they are not already in the list 16 | # copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig 17 | # self contained 18 | macro(_list_append_unique listname) 19 | foreach(_item ${ARGN}) 20 | list(FIND ${listname} ${_item} _index) 21 | if(_index EQUAL -1) 22 | list(APPEND ${listname} ${_item}) 23 | endif() 24 | endforeach() 25 | endmacro() 26 | 27 | # pack a list of libraries with optional build configuration keywords 28 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 29 | # self contained 30 | macro(_pack_libraries_with_build_configuration VAR) 31 | set(${VAR} "") 32 | set(_argn ${ARGN}) 33 | list(LENGTH _argn _count) 34 | set(_index 0) 35 | while(${_index} LESS ${_count}) 36 | list(GET _argn ${_index} lib) 37 | if("${lib}" MATCHES "^debug|optimized|general$") 38 | math(EXPR _index "${_index} + 1") 39 | if(${_index} EQUAL ${_count}) 40 | message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") 41 | endif() 42 | list(GET _argn ${_index} library) 43 | list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") 44 | else() 45 | list(APPEND ${VAR} "${lib}") 46 | endif() 47 | math(EXPR _index "${_index} + 1") 48 | endwhile() 49 | endmacro() 50 | 51 | # unpack a list of libraries with optional build configuration keyword prefixes 52 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 53 | # self contained 54 | macro(_unpack_libraries_with_build_configuration VAR) 55 | set(${VAR} "") 56 | foreach(lib ${ARGN}) 57 | string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") 58 | list(APPEND ${VAR} "${lib}") 59 | endforeach() 60 | endmacro() 61 | 62 | 63 | if(image_geometry_CONFIG_INCLUDED) 64 | return() 65 | endif() 66 | set(image_geometry_CONFIG_INCLUDED TRUE) 67 | 68 | # set variables for source/devel/install prefixes 69 | if("FALSE" STREQUAL "TRUE") 70 | set(image_geometry_SOURCE_PREFIX /tmp/buildd/ros-kinetic-image-geometry-1.11.6-0trusty-20141201-2057) 71 | set(image_geometry_DEVEL_PREFIX /tmp/buildd/ros-kinetic-image-geometry-1.11.6-0trusty-20141201-2057/obj-arm-linux-gnueabihf/devel) 72 | set(image_geometry_INSTALL_PREFIX "") 73 | set(image_geometry_PREFIX ${image_geometry_DEVEL_PREFIX}) 74 | else() 75 | set(image_geometry_SOURCE_PREFIX "") 76 | set(image_geometry_DEVEL_PREFIX "") 77 | set(image_geometry_INSTALL_PREFIX /opt/ros/kinetic) 78 | set(image_geometry_PREFIX ${image_geometry_INSTALL_PREFIX}) 79 | endif() 80 | 81 | # warn when using a deprecated package 82 | if(NOT "" STREQUAL "") 83 | set(_msg "WARNING: package 'image_geometry' is deprecated") 84 | # append custom deprecation text if available 85 | if(NOT "" STREQUAL "TRUE") 86 | set(_msg "${_msg} ()") 87 | endif() 88 | message("${_msg}") 89 | endif() 90 | 91 | # flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project 92 | set(image_geometry_FOUND_CATKIN_PROJECT TRUE) 93 | 94 | if(NOT "include;/usr/include/opencv;/usr/include" STREQUAL "") 95 | set(image_geometry_INCLUDE_DIRS "") 96 | set(_include_dirs "include;/usr/include/opencv;/usr/include") 97 | foreach(idir ${_include_dirs}) 98 | if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir}) 99 | set(include ${idir}) 100 | elseif("${idir}" STREQUAL "include") 101 | get_filename_component(include "${image_geometry_DIR}/../../../include" ABSOLUTE) 102 | if(NOT IS_DIRECTORY ${include}) 103 | message(FATAL_ERROR "Project 'image_geometry' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 104 | endif() 105 | else() 106 | message(FATAL_ERROR "Project 'image_geometry' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/opt/ros/kinetic/${idir}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 107 | endif() 108 | _list_append_unique(image_geometry_INCLUDE_DIRS ${include}) 109 | endforeach() 110 | endif() 111 | 112 | set(libraries "image_geometry;/usr/lib/libopencv_videostab.so.2.4.12;/usr/lib/libopencv_video.so.2.4.12;/usr/lib/libopencv_superres.so.2.4.12;/usr/lib/libopencv_stitching.so.2.4.12;/usr/lib/libopencv_photo.so.2.4.12;/usr/lib/libopencv_objdetect.so.2.4.12;/usr/lib/libopencv_ml.so.2.4.12;/usr/lib/libopencv_legacy.so.2.4.12;/usr/lib/libopencv_imgproc.so.2.4.12;/usr/lib/libopencv_highgui.so.2.4.12;/usr/lib/libopencv_gpu.so.2.4.12;/usr/lib/libopencv_flann.so.2.4.12;/usr/lib/libopencv_features2d.so.2.4.12;/usr/lib/libopencv_core.so.2.4.12;/usr/lib/libopencv_contrib.so.2.4.12;/usr/lib/libopencv_calib3d.so.2.4.12") 113 | foreach(library ${libraries}) 114 | # keep build configuration keywords, target names and absolute libraries as-is 115 | if("${library}" MATCHES "^debug|optimized|general$") 116 | list(APPEND image_geometry_LIBRARIES ${library}) 117 | elseif(TARGET ${library}) 118 | list(APPEND image_geometry_LIBRARIES ${library}) 119 | elseif(IS_ABSOLUTE ${library}) 120 | list(APPEND image_geometry_LIBRARIES ${library}) 121 | else() 122 | set(lib_path "") 123 | set(lib "${library}-NOTFOUND") 124 | # since the path where the library is found is returned we have to iterate over the paths manually 125 | foreach(path /opt/ros/kinetic/lib;/opt/ros/kinetic/lib) 126 | find_library(lib ${library} 127 | PATHS ${path} 128 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) 129 | if(lib) 130 | set(lib_path ${path}) 131 | break() 132 | endif() 133 | endforeach() 134 | if(lib) 135 | _list_append_unique(image_geometry_LIBRARY_DIRS ${lib_path}) 136 | list(APPEND image_geometry_LIBRARIES ${lib}) 137 | else() 138 | # as a fall back for non-catkin libraries try to search globally 139 | find_library(lib ${library}) 140 | if(NOT lib) 141 | message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project 'image_geometry'? Did you find_package() it before the subdirectory containing its code is included?") 142 | endif() 143 | list(APPEND image_geometry_LIBRARIES ${lib}) 144 | endif() 145 | endif() 146 | endforeach() 147 | 148 | set(image_geometry_EXPORTED_TARGETS "") 149 | # create dummy targets for exported code generation targets to make life of users easier 150 | foreach(t ${image_geometry_EXPORTED_TARGETS}) 151 | if(NOT TARGET ${t}) 152 | add_custom_target(${t}) 153 | endif() 154 | endforeach() 155 | 156 | set(depends "sensor_msgs") 157 | foreach(depend ${depends}) 158 | string(REPLACE " " ";" depend_list ${depend}) 159 | # the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls 160 | list(GET depend_list 0 image_geometry_dep) 161 | list(LENGTH depend_list count) 162 | if(${count} EQUAL 1) 163 | # simple dependencies must only be find_package()-ed once 164 | if(NOT ${image_geometry_dep}_FOUND) 165 | find_package(${image_geometry_dep} REQUIRED) 166 | endif() 167 | else() 168 | # dependencies with components must be find_package()-ed again 169 | list(REMOVE_AT depend_list 0) 170 | find_package(${image_geometry_dep} REQUIRED ${depend_list}) 171 | endif() 172 | _list_append_unique(image_geometry_INCLUDE_DIRS ${${image_geometry_dep}_INCLUDE_DIRS}) 173 | 174 | # merge build configuration keywords with library names to correctly deduplicate 175 | _pack_libraries_with_build_configuration(image_geometry_LIBRARIES ${image_geometry_LIBRARIES}) 176 | _pack_libraries_with_build_configuration(_libraries ${${image_geometry_dep}_LIBRARIES}) 177 | _list_append_deduplicate(image_geometry_LIBRARIES ${_libraries}) 178 | # undo build configuration keyword merging after deduplication 179 | _unpack_libraries_with_build_configuration(image_geometry_LIBRARIES ${image_geometry_LIBRARIES}) 180 | 181 | _list_append_unique(image_geometry_LIBRARY_DIRS ${${image_geometry_dep}_LIBRARY_DIRS}) 182 | list(APPEND image_geometry_EXPORTED_TARGETS ${${image_geometry_dep}_EXPORTED_TARGETS}) 183 | endforeach() 184 | 185 | set(pkg_cfg_extras "") 186 | foreach(extra ${pkg_cfg_extras}) 187 | if(NOT IS_ABSOLUTE ${extra}) 188 | set(extra ${image_geometry_DIR}/${extra}) 189 | endif() 190 | include(${extra}) 191 | endforeach() 192 | -------------------------------------------------------------------------------- /Files/OpenCV4Tegra-ROSKinetic/image_geometryConfig.cmake~: -------------------------------------------------------------------------------- 1 | # generated from catkin/cmake/template/pkgConfig.cmake.in 2 | 3 | # append elements to a list and remove existing duplicates from the list 4 | # copied from catkin/cmake/list_append_deduplicate.cmake to keep pkgConfig 5 | # self contained 6 | macro(_list_append_deduplicate listname) 7 | if(NOT "${ARGN}" STREQUAL "") 8 | if(${listname}) 9 | list(REMOVE_ITEM ${listname} ${ARGN}) 10 | endif() 11 | list(APPEND ${listname} ${ARGN}) 12 | endif() 13 | endmacro() 14 | 15 | # append elements to a list if they are not already in the list 16 | # copied from catkin/cmake/list_append_unique.cmake to keep pkgConfig 17 | # self contained 18 | macro(_list_append_unique listname) 19 | foreach(_item ${ARGN}) 20 | list(FIND ${listname} ${_item} _index) 21 | if(_index EQUAL -1) 22 | list(APPEND ${listname} ${_item}) 23 | endif() 24 | endforeach() 25 | endmacro() 26 | 27 | # pack a list of libraries with optional build configuration keywords 28 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 29 | # self contained 30 | macro(_pack_libraries_with_build_configuration VAR) 31 | set(${VAR} "") 32 | set(_argn ${ARGN}) 33 | list(LENGTH _argn _count) 34 | set(_index 0) 35 | while(${_index} LESS ${_count}) 36 | list(GET _argn ${_index} lib) 37 | if("${lib}" MATCHES "^debug|optimized|general$") 38 | math(EXPR _index "${_index} + 1") 39 | if(${_index} EQUAL ${_count}) 40 | message(FATAL_ERROR "_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library") 41 | endif() 42 | list(GET _argn ${_index} library) 43 | list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}") 44 | else() 45 | list(APPEND ${VAR} "${lib}") 46 | endif() 47 | math(EXPR _index "${_index} + 1") 48 | endwhile() 49 | endmacro() 50 | 51 | # unpack a list of libraries with optional build configuration keyword prefixes 52 | # copied from catkin/cmake/catkin_libraries.cmake to keep pkgConfig 53 | # self contained 54 | macro(_unpack_libraries_with_build_configuration VAR) 55 | set(${VAR} "") 56 | foreach(lib ${ARGN}) 57 | string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}") 58 | list(APPEND ${VAR} "${lib}") 59 | endforeach() 60 | endmacro() 61 | 62 | 63 | if(image_geometry_CONFIG_INCLUDED) 64 | return() 65 | endif() 66 | set(image_geometry_CONFIG_INCLUDED TRUE) 67 | 68 | # set variables for source/devel/install prefixes 69 | if("FALSE" STREQUAL "TRUE") 70 | set(image_geometry_SOURCE_PREFIX /tmp/buildd/ros-indigo-image-geometry-1.11.6-0trusty-20141201-2057) 71 | set(image_geometry_DEVEL_PREFIX /tmp/buildd/ros-indigo-image-geometry-1.11.6-0trusty-20141201-2057/obj-arm-linux-gnueabihf/devel) 72 | set(image_geometry_INSTALL_PREFIX "") 73 | set(image_geometry_PREFIX ${image_geometry_DEVEL_PREFIX}) 74 | else() 75 | set(image_geometry_SOURCE_PREFIX "") 76 | set(image_geometry_DEVEL_PREFIX "") 77 | set(image_geometry_INSTALL_PREFIX /opt/ros/indigo) 78 | set(image_geometry_PREFIX ${image_geometry_INSTALL_PREFIX}) 79 | endif() 80 | 81 | # warn when using a deprecated package 82 | if(NOT "" STREQUAL "") 83 | set(_msg "WARNING: package 'image_geometry' is deprecated") 84 | # append custom deprecation text if available 85 | if(NOT "" STREQUAL "TRUE") 86 | set(_msg "${_msg} ()") 87 | endif() 88 | message("${_msg}") 89 | endif() 90 | 91 | # flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project 92 | set(image_geometry_FOUND_CATKIN_PROJECT TRUE) 93 | 94 | if(NOT "include;/usr/include/opencv;/usr/include" STREQUAL "") 95 | set(image_geometry_INCLUDE_DIRS "") 96 | set(_include_dirs "include;/usr/include/opencv;/usr/include") 97 | foreach(idir ${_include_dirs}) 98 | if(IS_ABSOLUTE ${idir} AND IS_DIRECTORY ${idir}) 99 | set(include ${idir}) 100 | elseif("${idir}" STREQUAL "include") 101 | get_filename_component(include "${image_geometry_DIR}/../../../include" ABSOLUTE) 102 | if(NOT IS_DIRECTORY ${include}) 103 | message(FATAL_ERROR "Project 'image_geometry' specifies '${idir}' as an include dir, which is not found. It does not exist in '${include}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 104 | endif() 105 | else() 106 | message(FATAL_ERROR "Project 'image_geometry' specifies '${idir}' as an include dir, which is not found. It does neither exist as an absolute directory nor in '/opt/ros/indigo/${idir}'. Ask the maintainer 'Vincent Rabaud ' to fix it.") 107 | endif() 108 | _list_append_unique(image_geometry_INCLUDE_DIRS ${include}) 109 | endforeach() 110 | endif() 111 | 112 | set(libraries "image_geometry;/usr/lib/libopencv_videostab.so.2.4.12;/usr/lib/libopencv_video.so.2.4.12;/usr/lib/libopencv_superres.so.2.4.12;/usr/lib/libopencv_stitching.so.2.4.12;/usr/lib/libopencv_photo.so.2.4.12;/usr/lib/libopencv_objdetect.so.2.4.12;/usr/lib/libopencv_ml.so.2.4.12;/usr/lib/libopencv_legacy.so.2.4.12;/usr/lib/libopencv_imgproc.so.2.4.12;/usr/lib/libopencv_highgui.so.2.4.12;/usr/lib/libopencv_gpu.so.2.4.12;/usr/lib/libopencv_flann.so.2.4.12;/usr/lib/libopencv_features2d.so.2.4.12;/usr/lib/libopencv_core.so.2.4.12;/usr/lib/libopencv_contrib.so.2.4.12;/usr/lib/libopencv_calib3d.so.2.4.12") 113 | foreach(library ${libraries}) 114 | # keep build configuration keywords, target names and absolute libraries as-is 115 | if("${library}" MATCHES "^debug|optimized|general$") 116 | list(APPEND image_geometry_LIBRARIES ${library}) 117 | elseif(TARGET ${library}) 118 | list(APPEND image_geometry_LIBRARIES ${library}) 119 | elseif(IS_ABSOLUTE ${library}) 120 | list(APPEND image_geometry_LIBRARIES ${library}) 121 | else() 122 | set(lib_path "") 123 | set(lib "${library}-NOTFOUND") 124 | # since the path where the library is found is returned we have to iterate over the paths manually 125 | foreach(path /opt/ros/indigo/lib;/opt/ros/indigo/lib) 126 | find_library(lib ${library} 127 | PATHS ${path} 128 | NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) 129 | if(lib) 130 | set(lib_path ${path}) 131 | break() 132 | endif() 133 | endforeach() 134 | if(lib) 135 | _list_append_unique(image_geometry_LIBRARY_DIRS ${lib_path}) 136 | list(APPEND image_geometry_LIBRARIES ${lib}) 137 | else() 138 | # as a fall back for non-catkin libraries try to search globally 139 | find_library(lib ${library}) 140 | if(NOT lib) 141 | message(FATAL_ERROR "Project '${PROJECT_NAME}' tried to find library '${library}'. The library is neither a target nor built/installed properly. Did you compile project 'image_geometry'? Did you find_package() it before the subdirectory containing its code is included?") 142 | endif() 143 | list(APPEND image_geometry_LIBRARIES ${lib}) 144 | endif() 145 | endif() 146 | endforeach() 147 | 148 | set(image_geometry_EXPORTED_TARGETS "") 149 | # create dummy targets for exported code generation targets to make life of users easier 150 | foreach(t ${image_geometry_EXPORTED_TARGETS}) 151 | if(NOT TARGET ${t}) 152 | add_custom_target(${t}) 153 | endif() 154 | endforeach() 155 | 156 | set(depends "sensor_msgs") 157 | foreach(depend ${depends}) 158 | string(REPLACE " " ";" depend_list ${depend}) 159 | # the package name of the dependency must be kept in a unique variable so that it is not overwritten in recursive calls 160 | list(GET depend_list 0 image_geometry_dep) 161 | list(LENGTH depend_list count) 162 | if(${count} EQUAL 1) 163 | # simple dependencies must only be find_package()-ed once 164 | if(NOT ${image_geometry_dep}_FOUND) 165 | find_package(${image_geometry_dep} REQUIRED) 166 | endif() 167 | else() 168 | # dependencies with components must be find_package()-ed again 169 | list(REMOVE_AT depend_list 0) 170 | find_package(${image_geometry_dep} REQUIRED ${depend_list}) 171 | endif() 172 | _list_append_unique(image_geometry_INCLUDE_DIRS ${${image_geometry_dep}_INCLUDE_DIRS}) 173 | 174 | # merge build configuration keywords with library names to correctly deduplicate 175 | _pack_libraries_with_build_configuration(image_geometry_LIBRARIES ${image_geometry_LIBRARIES}) 176 | _pack_libraries_with_build_configuration(_libraries ${${image_geometry_dep}_LIBRARIES}) 177 | _list_append_deduplicate(image_geometry_LIBRARIES ${_libraries}) 178 | # undo build configuration keyword merging after deduplication 179 | _unpack_libraries_with_build_configuration(image_geometry_LIBRARIES ${image_geometry_LIBRARIES}) 180 | 181 | _list_append_unique(image_geometry_LIBRARY_DIRS ${${image_geometry_dep}_LIBRARY_DIRS}) 182 | list(APPEND image_geometry_EXPORTED_TARGETS ${${image_geometry_dep}_EXPORTED_TARGETS}) 183 | endforeach() 184 | 185 | set(pkg_cfg_extras "") 186 | foreach(extra ${pkg_cfg_extras}) 187 | if(NOT IS_ABSOLUTE ${extra}) 188 | set(extra ${image_geometry_DIR}/${extra}) 189 | endif() 190 | include(${extra}) 191 | endforeach() 192 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(roscuda_basic) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED COMPONENTS 11 | roscpp 12 | rospy 13 | std_msgs 14 | ) 15 | 16 | find_package(CUDA REQUIRED) 17 | 18 | ## System dependencies are found with CMake's conventions 19 | # find_package(Boost REQUIRED COMPONENTS system) 20 | 21 | 22 | ## Uncomment this if the package has a setup.py. This macro ensures 23 | ## modules and global scripts declared therein get installed 24 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 25 | # catkin_python_setup() 26 | 27 | ################################################ 28 | ## Declare ROS messages, services and actions ## 29 | ################################################ 30 | 31 | ## To declare and build messages, services or actions from within this 32 | ## package, follow these steps: 33 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 34 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 35 | ## * In the file package.xml: 36 | ## * add a build_depend tag for "message_generation" 37 | ## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET 38 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 39 | ## but can be declared for certainty nonetheless: 40 | ## * add a run_depend tag for "message_runtime" 41 | ## * In this file (CMakeLists.txt): 42 | ## * add "message_generation" and every package in MSG_DEP_SET to 43 | ## find_package(catkin REQUIRED COMPONENTS ...) 44 | ## * add "message_runtime" and every package in MSG_DEP_SET to 45 | ## catkin_package(CATKIN_DEPENDS ...) 46 | ## * uncomment the add_*_files sections below as needed 47 | ## and list every .msg/.srv/.action file to be processed 48 | ## * uncomment the generate_messages entry below 49 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 50 | 51 | ## Generate messages in the 'msg' folder 52 | # add_message_files( 53 | # FILES 54 | # Message1.msg 55 | # Message2.msg 56 | # ) 57 | 58 | ## Generate services in the 'srv' folder 59 | # add_service_files( 60 | # FILES 61 | # Service1.srv 62 | # Service2.srv 63 | # ) 64 | 65 | ## Generate actions in the 'action' folder 66 | # add_action_files( 67 | # FILES 68 | # Action1.action 69 | # Action2.action 70 | # ) 71 | 72 | ## Generate added messages and services with any dependencies listed here 73 | # generate_messages( 74 | # DEPENDENCIES 75 | # std_msgs 76 | # ) 77 | 78 | ################################################ 79 | ## Declare ROS dynamic reconfigure parameters ## 80 | ################################################ 81 | 82 | ## To declare and build dynamic reconfigure parameters within this 83 | ## package, follow these steps: 84 | ## * In the file package.xml: 85 | ## * add a build_depend and a run_depend tag for "dynamic_reconfigure" 86 | ## * In this file (CMakeLists.txt): 87 | ## * add "dynamic_reconfigure" to 88 | ## find_package(catkin REQUIRED COMPONENTS ...) 89 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 90 | ## and list every .cfg file to be processed 91 | 92 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 93 | # generate_dynamic_reconfigure_options( 94 | # cfg/DynReconf1.cfg 95 | # cfg/DynReconf2.cfg 96 | # ) 97 | 98 | ################################### 99 | ## catkin specific configuration ## 100 | ################################### 101 | ## The catkin_package macro generates cmake config files for your package 102 | ## Declare things to be passed to dependent projects 103 | ## INCLUDE_DIRS: uncomment this if you package contains header files 104 | ## LIBRARIES: libraries you create in this project that dependent projects also need 105 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 106 | ## DEPENDS: system dependencies of this project that dependent projects also need 107 | catkin_package( 108 | # INCLUDE_DIRS include 109 | # LIBRARIES roscuda_basic 110 | # CATKIN_DEPENDS roscpp rospy std_msgs 111 | # DEPENDS system_lib 112 | ) 113 | 114 | ########### 115 | ## Build ## 116 | ########### 117 | 118 | ## Specify additional locations of header files 119 | ## Your package locations should be listed before other locations 120 | include_directories( 121 | # include 122 | ${catkin_INCLUDE_DIRS} 123 | ) 124 | 125 | ## Declare a C++ library 126 | # add_library(${PROJECT_NAME} 127 | # src/${PROJECT_NAME}/roscuda_basic.cpp 128 | # ) 129 | set(CUDA_NVCC_FLAGS "-arch=compute_30" CACHE STRING "nvcc flags" FORCE) 130 | set(CUDA_VERBOSE_BUILD ON CACHE BOOL "nvcc verbose" FORCE) 131 | set(LIB_TYPE STATIC) 132 | cuda_add_library(CUDASampLib ${LIB_TYPE} src/basic.cu) 133 | 134 | 135 | ## Add cmake target dependencies of the library 136 | ## as an example, code may need to be generated before libraries 137 | ## either from message generation or dynamic reconfigure 138 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 139 | 140 | ## Declare a C++ executable 141 | ## With catkin_make all packages are built within a single CMake context 142 | ## The recommended prefix ensures that target names across packages don't collide 143 | # add_executable(${PROJECT_NAME}_node src/roscuda_basic_node.cpp) 144 | add_executable(roscuda_basic_node src/main.cpp) 145 | 146 | ## Rename C++ executable without prefix 147 | ## The above recommended prefix causes long target names, the following renames the 148 | ## target back to the shorter version for ease of user use 149 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 150 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 151 | 152 | ## Add cmake target dependencies of the executable 153 | ## same as for the library above 154 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 155 | add_dependencies(roscuda_basic_node CUDASampLib) 156 | 157 | ## Specify libraries to link a library or executable target against 158 | # target_link_libraries(${PROJECT_NAME}_node 159 | # ${catkin_LIBRARIES} 160 | # ) 161 | TARGET_LINK_LIBRARIES(roscuda_basic_node 162 | ${catkin_LIBRARIES} 163 | CUDASampLib 164 | ) 165 | 166 | ############# 167 | ## Install ## 168 | ############# 169 | 170 | # all install targets should use catkin DESTINATION variables 171 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 172 | 173 | ## Mark executable scripts (Python etc.) for installation 174 | ## in contrast to setup.py, you can choose the destination 175 | # install(PROGRAMS 176 | # scripts/my_python_script 177 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 178 | # ) 179 | 180 | ## Mark executables and/or libraries for installation 181 | # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node 182 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 183 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 184 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 185 | # ) 186 | 187 | ## Mark cpp header files for installation 188 | # install(DIRECTORY include/${PROJECT_NAME}/ 189 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 190 | # FILES_MATCHING PATTERN "*.h" 191 | # PATTERN ".svn" EXCLUDE 192 | # ) 193 | 194 | ## Mark other files for installation (e.g. launch and bag files, etc.) 195 | # install(FILES 196 | # # myfile1 197 | # # myfile2 198 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 199 | # ) 200 | 201 | ############# 202 | ## Testing ## 203 | ############# 204 | 205 | ## Add gtest based cpp test target and link libraries 206 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_roscuda_basic.cpp) 207 | # if(TARGET ${PROJECT_NAME}-test) 208 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 209 | # endif() 210 | 211 | ## Add folders to be run by python nosetests 212 | # catkin_add_nosetests(test) 213 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_basic/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | roscuda_basic 4 | 0.0.0 5 | The roscuda_basic package 6 | 7 | 8 | 9 | 10 | nicolas 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | roscpp 44 | rospy 45 | std_msgs 46 | roscpp 47 | rospy 48 | std_msgs 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_basic/roscuda_basic.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_basic/src/basic.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | __global__ void kernel() 7 | { 8 | 9 | } 10 | 11 | void cudamain() 12 | { 13 | kernel<<<1,1>>>(); 14 | return; 15 | } 16 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_basic/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ros/ros.h" 2 | 3 | void cudamain(); 4 | 5 | int main(int argc, char **argv) 6 | { 7 | ros::init(argc, argv, "roscuda_basic"); 8 | ros::NodeHandle n; 9 | ros::Rate loop_rate(1); 10 | 11 | while(ros::ok()) 12 | { 13 | cudamain(); 14 | ros::spinOnce(); 15 | loop_rate.sleep(); 16 | } 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(roscuda_img_filter) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED COMPONENTS 11 | cv_bridge 12 | image_transport 13 | roscpp 14 | sensor_msgs 15 | std_msgs 16 | ) 17 | 18 | find_package(CUDA REQUIRED) 19 | ## System dependencies are found with CMake's conventions 20 | # find_package(Boost REQUIRED COMPONENTS system) 21 | 22 | 23 | ## Uncomment this if the package has a setup.py. This macro ensures 24 | ## modules and global scripts declared therein get installed 25 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 26 | # catkin_python_setup() 27 | 28 | ################################################ 29 | ## Declare ROS messages, services and actions ## 30 | ################################################ 31 | 32 | ## To declare and build messages, services or actions from within this 33 | ## package, follow these steps: 34 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 35 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 36 | ## * In the file package.xml: 37 | ## * add a build_depend tag for "message_generation" 38 | ## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET 39 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 40 | ## but can be declared for certainty nonetheless: 41 | ## * add a run_depend tag for "message_runtime" 42 | ## * In this file (CMakeLists.txt): 43 | ## * add "message_generation" and every package in MSG_DEP_SET to 44 | ## find_package(catkin REQUIRED COMPONENTS ...) 45 | ## * add "message_runtime" and every package in MSG_DEP_SET to 46 | ## catkin_package(CATKIN_DEPENDS ...) 47 | ## * uncomment the add_*_files sections below as needed 48 | ## and list every .msg/.srv/.action file to be processed 49 | ## * uncomment the generate_messages entry below 50 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 51 | 52 | ## Generate messages in the 'msg' folder 53 | # add_message_files( 54 | # FILES 55 | # Message1.msg 56 | # Message2.msg 57 | # ) 58 | 59 | ## Generate services in the 'srv' folder 60 | # add_service_files( 61 | # FILES 62 | # Service1.srv 63 | # Service2.srv 64 | # ) 65 | 66 | ## Generate actions in the 'action' folder 67 | # add_action_files( 68 | # FILES 69 | # Action1.action 70 | # Action2.action 71 | # ) 72 | 73 | ## Generate added messages and services with any dependencies listed here 74 | # generate_messages( 75 | # DEPENDENCIES 76 | # sensor_msgs# std_msgs 77 | # ) 78 | 79 | ################################################ 80 | ## Declare ROS dynamic reconfigure parameters ## 81 | ################################################ 82 | 83 | ## To declare and build dynamic reconfigure parameters within this 84 | ## package, follow these steps: 85 | ## * In the file package.xml: 86 | ## * add a build_depend and a run_depend tag for "dynamic_reconfigure" 87 | ## * In this file (CMakeLists.txt): 88 | ## * add "dynamic_reconfigure" to 89 | ## find_package(catkin REQUIRED COMPONENTS ...) 90 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 91 | ## and list every .cfg file to be processed 92 | 93 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 94 | # generate_dynamic_reconfigure_options( 95 | # cfg/DynReconf1.cfg 96 | # cfg/DynReconf2.cfg 97 | # ) 98 | 99 | ################################### 100 | ## catkin specific configuration ## 101 | ################################### 102 | ## The catkin_package macro generates cmake config files for your package 103 | ## Declare things to be passed to dependent projects 104 | ## INCLUDE_DIRS: uncomment this if you package contains header files 105 | ## LIBRARIES: libraries you create in this project that dependent projects also need 106 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 107 | ## DEPENDS: system dependencies of this project that dependent projects also need 108 | catkin_package( 109 | # INCLUDE_DIRS include 110 | # LIBRARIES roscuda_img_filter 111 | # CATKIN_DEPENDS cv_bridge image_transport roscpp sensor_msgs std_msgs 112 | # DEPENDS system_lib 113 | ) 114 | 115 | ########### 116 | ## Build ## 117 | ########### 118 | 119 | ## Specify additional locations of header files 120 | ## Your package locations should be listed before other locations 121 | include_directories( 122 | # include 123 | ${catkin_INCLUDE_DIRS} 124 | ) 125 | 126 | set(CUDA_NVCC_FLAGS "-arch=compute_30" CACHE STRING "nvcc flags" FORCE) 127 | set(CUDA_VERBOSE_BUILD ON CACHE BOOL "nvcc verbose" FORCE) 128 | set(LIB_TYPE STATIC) 129 | cuda_add_library(CUDAsobelLib ${LIB_TYPE} src/sobel.cu) 130 | ## Declare a C++ library 131 | # add_library(${PROJECT_NAME} 132 | # src/${PROJECT_NAME}/roscuda_img_filter.cpp 133 | # ) 134 | 135 | ## Add cmake target dependencies of the library 136 | ## as an example, code may need to be generated before libraries 137 | ## either from message generation or dynamic reconfigure 138 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 139 | 140 | ## Declare a C++ executable 141 | ## With catkin_make all packages are built within a single CMake context 142 | ## The recommended prefix ensures that target names across packages don't collide 143 | # add_executable(${PROJECT_NAME}_node src/roscuda_img_filter_node.cpp) 144 | add_executable(roscuda_img_filter_node src/main.cpp) 145 | ## Rename C++ executable without prefix 146 | ## The above recommended prefix causes long target names, the following renames the 147 | ## target back to the shorter version for ease of user use 148 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 149 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 150 | 151 | ## Add cmake target dependencies of the executable 152 | ## same as for the library above 153 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 154 | add_dependencies(roscuda_img_filter_node CUDAsobelLib) 155 | ## Specify libraries to link a library or executable target against 156 | # target_link_libraries(${PROJECT_NAME}_node 157 | # ${catkin_LIBRARIES} 158 | # ) 159 | TARGET_LINK_LIBRARIES(roscuda_img_filter_node 160 | ${catkin_LIBRARIES} 161 | CUDAsobelLib 162 | ) 163 | 164 | ############# 165 | ## Install ## 166 | ############# 167 | 168 | # all install targets should use catkin DESTINATION variables 169 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 170 | 171 | ## Mark executable scripts (Python etc.) for installation 172 | ## in contrast to setup.py, you can choose the destination 173 | # install(PROGRAMS 174 | # scripts/my_python_script 175 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 176 | # ) 177 | 178 | ## Mark executables and/or libraries for installation 179 | # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node 180 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 181 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 182 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 183 | # ) 184 | 185 | ## Mark cpp header files for installation 186 | # install(DIRECTORY include/${PROJECT_NAME}/ 187 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 188 | # FILES_MATCHING PATTERN "*.h" 189 | # PATTERN ".svn" EXCLUDE 190 | # ) 191 | 192 | ## Mark other files for installation (e.g. launch and bag files, etc.) 193 | # install(FILES 194 | # # myfile1 195 | # # myfile2 196 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 197 | # ) 198 | 199 | ############# 200 | ## Testing ## 201 | ############# 202 | 203 | ## Add gtest based cpp test target and link libraries 204 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_roscuda_img_filter.cpp) 205 | # if(TARGET ${PROJECT_NAME}-test) 206 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 207 | # endif() 208 | 209 | ## Add folders to be run by python nosetests 210 | # catkin_add_nosetests(test) 211 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/CMakeLists.txt~: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(roscuda_img_filter) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED COMPONENTS 11 | cv_bridge 12 | image_transport 13 | roscpp 14 | sensor_msgs 15 | std_msgs 16 | ) 17 | 18 | find_package(CUDA REQUIRED) 19 | ## System dependencies are found with CMake's conventions 20 | # find_package(Boost REQUIRED COMPONENTS system) 21 | 22 | 23 | ## Uncomment this if the package has a setup.py. This macro ensures 24 | ## modules and global scripts declared therein get installed 25 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 26 | # catkin_python_setup() 27 | 28 | ################################################ 29 | ## Declare ROS messages, services and actions ## 30 | ################################################ 31 | 32 | ## To declare and build messages, services or actions from within this 33 | ## package, follow these steps: 34 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 35 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 36 | ## * In the file package.xml: 37 | ## * add a build_depend tag for "message_generation" 38 | ## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET 39 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 40 | ## but can be declared for certainty nonetheless: 41 | ## * add a run_depend tag for "message_runtime" 42 | ## * In this file (CMakeLists.txt): 43 | ## * add "message_generation" and every package in MSG_DEP_SET to 44 | ## find_package(catkin REQUIRED COMPONENTS ...) 45 | ## * add "message_runtime" and every package in MSG_DEP_SET to 46 | ## catkin_package(CATKIN_DEPENDS ...) 47 | ## * uncomment the add_*_files sections below as needed 48 | ## and list every .msg/.srv/.action file to be processed 49 | ## * uncomment the generate_messages entry below 50 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 51 | 52 | ## Generate messages in the 'msg' folder 53 | # add_message_files( 54 | # FILES 55 | # Message1.msg 56 | # Message2.msg 57 | # ) 58 | 59 | ## Generate services in the 'srv' folder 60 | # add_service_files( 61 | # FILES 62 | # Service1.srv 63 | # Service2.srv 64 | # ) 65 | 66 | ## Generate actions in the 'action' folder 67 | # add_action_files( 68 | # FILES 69 | # Action1.action 70 | # Action2.action 71 | # ) 72 | 73 | ## Generate added messages and services with any dependencies listed here 74 | # generate_messages( 75 | # DEPENDENCIES 76 | # sensor_msgs# std_msgs 77 | # ) 78 | 79 | ################################################ 80 | ## Declare ROS dynamic reconfigure parameters ## 81 | ################################################ 82 | 83 | ## To declare and build dynamic reconfigure parameters within this 84 | ## package, follow these steps: 85 | ## * In the file package.xml: 86 | ## * add a build_depend and a run_depend tag for "dynamic_reconfigure" 87 | ## * In this file (CMakeLists.txt): 88 | ## * add "dynamic_reconfigure" to 89 | ## find_package(catkin REQUIRED COMPONENTS ...) 90 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 91 | ## and list every .cfg file to be processed 92 | 93 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 94 | # generate_dynamic_reconfigure_options( 95 | # cfg/DynReconf1.cfg 96 | # cfg/DynReconf2.cfg 97 | # ) 98 | 99 | ################################### 100 | ## catkin specific configuration ## 101 | ################################### 102 | ## The catkin_package macro generates cmake config files for your package 103 | ## Declare things to be passed to dependent projects 104 | ## INCLUDE_DIRS: uncomment this if you package contains header files 105 | ## LIBRARIES: libraries you create in this project that dependent projects also need 106 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 107 | ## DEPENDS: system dependencies of this project that dependent projects also need 108 | catkin_package( 109 | # INCLUDE_DIRS include 110 | # LIBRARIES roscuda_img_filter 111 | # CATKIN_DEPENDS cv_bridge image_transport roscpp sensor_msgs std_msgs 112 | # DEPENDS system_lib 113 | ) 114 | 115 | ########### 116 | ## Build ## 117 | ########### 118 | 119 | ## Specify additional locations of header files 120 | ## Your package locations should be listed before other locations 121 | include_directories( 122 | # include 123 | ${catkin_INCLUDE_DIRS} 124 | ) 125 | 126 | set(CUDA_NVCC_FLAGS "-arch=compute_30" CACHE STRING "nvcc flags" FORCE) 127 | set(CUDA_VERBOSE_BUILD ON CACHE BOOL "nvcc verbose" FORCE) 128 | set(LIB_TYPE STATIC) 129 | cuda_add_library(CUDAopencvLib ${LIB_TYPE} src/test.cu) 130 | ## Declare a C++ library 131 | # add_library(${PROJECT_NAME} 132 | # src/${PROJECT_NAME}/roscuda_img_filter.cpp 133 | # ) 134 | 135 | ## Add cmake target dependencies of the library 136 | ## as an example, code may need to be generated before libraries 137 | ## either from message generation or dynamic reconfigure 138 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 139 | 140 | ## Declare a C++ executable 141 | ## With catkin_make all packages are built within a single CMake context 142 | ## The recommended prefix ensures that target names across packages don't collide 143 | # add_executable(${PROJECT_NAME}_node src/roscuda_img_filter_node.cpp) 144 | add_executable(roscuda_img_filter_node src/main.cpp) 145 | ## Rename C++ executable without prefix 146 | ## The above recommended prefix causes long target names, the following renames the 147 | ## target back to the shorter version for ease of user use 148 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 149 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 150 | 151 | ## Add cmake target dependencies of the executable 152 | ## same as for the library above 153 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 154 | add_dependencies(roscuda_img_filter_node CUDAopencvLib) 155 | ## Specify libraries to link a library or executable target against 156 | # target_link_libraries(${PROJECT_NAME}_node 157 | # ${catkin_LIBRARIES} 158 | # ) 159 | TARGET_LINK_LIBRARIES(roscuda_img_filter_node 160 | ${catkin_LIBRARIES} 161 | CUDAopencvLib 162 | ) 163 | 164 | ############# 165 | ## Install ## 166 | ############# 167 | 168 | # all install targets should use catkin DESTINATION variables 169 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 170 | 171 | ## Mark executable scripts (Python etc.) for installation 172 | ## in contrast to setup.py, you can choose the destination 173 | # install(PROGRAMS 174 | # scripts/my_python_script 175 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 176 | # ) 177 | 178 | ## Mark executables and/or libraries for installation 179 | # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node 180 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 181 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 182 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 183 | # ) 184 | 185 | ## Mark cpp header files for installation 186 | # install(DIRECTORY include/${PROJECT_NAME}/ 187 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 188 | # FILES_MATCHING PATTERN "*.h" 189 | # PATTERN ".svn" EXCLUDE 190 | # ) 191 | 192 | ## Mark other files for installation (e.g. launch and bag files, etc.) 193 | # install(FILES 194 | # # myfile1 195 | # # myfile2 196 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 197 | # ) 198 | 199 | ############# 200 | ## Testing ## 201 | ############# 202 | 203 | ## Add gtest based cpp test target and link libraries 204 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_roscuda_img_filter.cpp) 205 | # if(TARGET ${PROJECT_NAME}-test) 206 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 207 | # endif() 208 | 209 | ## Add folders to be run by python nosetests 210 | # catkin_add_nosetests(test) 211 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/image_raw.bag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UTFPR-Robotics/ros-cuda/033b87eb91e3d3de84e45f9544b9944a94dea2fa/ROS Packages/roscuda_img_filter/image_raw.bag -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/opencvtest.launch~: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | roscuda_img_filter 4 | 0.0.0 5 | The roscuda_img_filter package 6 | 7 | 8 | 9 | 10 | nicolas 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | cv_bridge 44 | image_transport 45 | roscpp 46 | sensor_msgs 47 | std_msgs 48 | cv_bridge 49 | image_transport 50 | roscpp 51 | cuda 52 | sensor_msgs 53 | std_msgs 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/package.xml~: -------------------------------------------------------------------------------- 1 | 2 | 3 | opencvtest 4 | 0.0.0 5 | The opencvtest package 6 | 7 | 8 | 9 | 10 | nicolas 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | cv_bridge 44 | image_transport 45 | roscpp 46 | sensor_msgs 47 | std_msgs 48 | cv_bridge 49 | image_transport 50 | roscpp 51 | cuda 52 | sensor_msgs 53 | std_msgs 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/roscuda_img_filter.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/roscuda_img_filter.launch~: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | static const std::string OPENCV_WINDOW_1 = "Image window"; 9 | static const std::string OPENCV_WINDOW_2 = "Gray image window"; 10 | static const std::string OPENCV_WINDOW_3 = "Filtered image window"; 11 | int *difffilter(cv::Mat src, cv::Mat dst); 12 | 13 | //IMAGE IS 640 x 480 14 | 15 | class ImageConverter 16 | { 17 | ros::NodeHandle nh_; 18 | image_transport::ImageTransport it_; 19 | image_transport::Subscriber image_sub_; 20 | image_transport::Publisher gimage_pub_; 21 | image_transport::Publisher image_pub_; 22 | 23 | public: 24 | ImageConverter() 25 | : it_(nh_) 26 | { 27 | // Subscrive to input video feed and publish output video feed 28 | image_sub_ = it_.subscribe("/image/cam", 1, 29 | &ImageConverter::imageCb, this); 30 | gimage_pub_ = it_.advertise("/image_converter/gray_video", 1); 31 | image_pub_ = it_.advertise("/image_converter/output_video", 1); 32 | 33 | cv::namedWindow(OPENCV_WINDOW_1); 34 | cv::namedWindow(OPENCV_WINDOW_2); 35 | cv::namedWindow(OPENCV_WINDOW_3); 36 | } 37 | 38 | ~ImageConverter() 39 | { 40 | cv::destroyWindow(OPENCV_WINDOW_1); 41 | cv::destroyWindow(OPENCV_WINDOW_2); 42 | cv::destroyWindow(OPENCV_WINDOW_3); 43 | } 44 | 45 | void imageCb(const sensor_msgs::ImageConstPtr& msg) 46 | { 47 | cv_bridge::CvImagePtr cv_ptr; 48 | try 49 | { 50 | cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8); 51 | } 52 | catch (cv_bridge::Exception& e) 53 | { 54 | ROS_ERROR("cv_bridge exception: %s", e.what()); 55 | return; 56 | } 57 | 58 | cv::Mat msg_conv, destiny, gray; 59 | 60 | cv::imshow(OPENCV_WINDOW_1, cv_ptr->image); 61 | cv::waitKey(3); 62 | 63 | cv::cvtColor(cv_ptr->image,msg_conv,CV_BGR2GRAY); 64 | cv_ptr->image = msg_conv; 65 | 66 | sensor_msgs::ImagePtr gray_msg = cv_bridge::CvImage(std_msgs::Header(), "mono8", cv_ptr->image).toImageMsg(); 67 | destiny = cv::Mat::zeros( cv_ptr->image.size(), CV_8UC1); 68 | 69 | difffilter(cv_ptr->image,destiny); 70 | 71 | // Draw an example circle on the video stream 72 | //if (cv_ptr->image.rows > 60 && cv_ptr->image.cols > 60) 73 | //cv::circle(cv_ptr->image, cv::Point(50, 50), 10, CV_RGB(255,0,0)); 74 | 75 | // Update GUI Window 76 | cv::imshow(OPENCV_WINDOW_2, cv_ptr->image); 77 | cv::waitKey(3); 78 | 79 | // Output modified video stream 80 | sensor_msgs::ImagePtr dst_msg = cv_bridge::CvImage(std_msgs::Header(), "mono8", destiny).toImageMsg(); 81 | cv::imshow(OPENCV_WINDOW_3, destiny); 82 | cv::waitKey(3); 83 | image_pub_.publish(dst_msg); 84 | gimage_pub_.publish(gray_msg); 85 | } 86 | }; 87 | 88 | int main(int argc, char** argv) 89 | { 90 | ros::init(argc, argv, "roscuda_img_filter"); 91 | ImageConverter ic; 92 | ros::spin(); 93 | return 0; 94 | } -------------------------------------------------------------------------------- /ROS Packages/roscuda_img_filter/src/sobel.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define THREADS_PER_BLOCK 128 12 | 13 | __global__ void mask(double num, uchar *a, uchar *b, int n) 14 | { 15 | int index = threadIdx.x + blockIdx.x * blockDim.x; 16 | int aux1,aux2; 17 | // Guarantees that index does not go beyond vector size and applies filter 18 | if (index>(n+1) && index<(num-(n+1))) 19 | { 20 | 21 | aux1 = (a[index-n-1] + a[index-n]*2 - a[index+n-1] + a[index-n+1] - a[index+n]*2 - a[index+n+1]); 22 | aux2 = (a[index-n-1] + a[index-1]*2 + a[index+n-1] - a[index-n+1] - a[index+1]*2 - a[index+n+1]); 23 | b[index] = abs(aux2-aux1); 24 | 25 | if(b[index]>255){b[index]=255;} 26 | if(b[index]<0){b[index]=0;} 27 | 28 | }else{if(index v,w; 38 | v = src.reshape(1,num); 39 | w.reserve(num); 40 | 41 | //printf("%d\n",v.end()-v.begin()); 42 | //printf("%i %i %i %i %i\n",v[0],v[1],v[2],v[3],v[4]); 43 | 44 | // Device copies of a, b, c, d, size of allocated memory, num of threads and blocks 45 | uchar *d_a, *d_b; 46 | double size = num * sizeof(uchar); 47 | int thr, blk; 48 | // Alloc memory for device copies of a, b, c, d 49 | cudaMalloc((void **)&d_a, size); 50 | cudaMalloc((void **)&d_b, size); 51 | // Copy inputs to device 52 | cudaMemcpy(d_a, v.data(), size, cudaMemcpyHostToDevice); 53 | // Calculates blocks and threads and launch average3 kernel on GPU 54 | blk=floor(num/THREADS_PER_BLOCK)+1; 55 | thr=THREADS_PER_BLOCK; 56 | mask<<>>(num, d_a, d_b, n); 57 | // Wait for the GPU to finish 58 | cudaDeviceSynchronize(); 59 | // Copy result back to host and cleanup 60 | cudaMemcpy(w.data(), d_b, size, cudaMemcpyDeviceToHost); 61 | memcpy(dst.data, w.data(), size); 62 | cudaFree(d_a); cudaFree(d_b); 63 | return 0; 64 | } -------------------------------------------------------------------------------- /ROS Packages/roscuda_laserscan_filter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(roscuda_laserscan_filter) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | FIND_PACKAGE(CUDA REQUIRED) 11 | 12 | find_package(catkin REQUIRED COMPONENTS 13 | roscpp 14 | rospy 15 | std_msgs 16 | ) 17 | 18 | ## System dependencies are found with CMake's conventions 19 | # find_package(Boost REQUIRED COMPONENTS system) 20 | 21 | 22 | ## Uncomment this if the package has a setup.py. This macro ensures 23 | ## modules and global scripts declared therein get installed 24 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 25 | # catkin_python_setup() 26 | 27 | ################################################ 28 | ## Declare ROS messages, services and actions ## 29 | ################################################ 30 | 31 | ## To declare and build messages, services or actions from within this 32 | ## package, follow these steps: 33 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 34 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 35 | ## * In the file package.xml: 36 | ## * add a build_depend tag for "message_generation" 37 | ## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET 38 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 39 | ## but can be declared for certainty nonetheless: 40 | ## * add a run_depend tag for "message_runtime" 41 | ## * In this file (CMakeLists.txt): 42 | ## * add "message_generation" and every package in MSG_DEP_SET to 43 | ## find_package(catkin REQUIRED COMPONENTS ...) 44 | ## * add "message_runtime" and every package in MSG_DEP_SET to 45 | ## catkin_package(CATKIN_DEPENDS ...) 46 | ## * uncomment the add_*_files sections below as needed 47 | ## and list every .msg/.srv/.action file to be processed 48 | ## * uncomment the generate_messages entry below 49 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 50 | 51 | ## Generate messages in the 'msg' folder 52 | # add_message_files( 53 | # FILES 54 | # Message1.msg 55 | # Message2.msg 56 | # ) 57 | 58 | ## Generate services in the 'srv' folder 59 | # add_service_files( 60 | # FILES 61 | # Service1.srv 62 | # Service2.srv 63 | # ) 64 | 65 | ## Generate actions in the 'action' folder 66 | # add_action_files( 67 | # FILES 68 | # Action1.action 69 | # Action2.action 70 | # ) 71 | 72 | ## Generate added messages and services with any dependencies listed here 73 | # generate_messages( 74 | # DEPENDENCIES 75 | # std_msgs 76 | # ) 77 | 78 | SET(CUDA_NVCC_FLAGS "-arch=compute_30" CACHE STRING "nvcc flags" FORCE) 79 | SET (CUDA_VERBOSE_BUILD ON CACHE BOOL "nvcc verbose" FORCE) 80 | SET(LIB_TYPE STATIC) 81 | CUDA_ADD_LIBRARY(LaserFilterLib ${LIB_TYPE} src/laserfilter.cu) 82 | 83 | ################################################ 84 | ## Declare ROS dynamic reconfigure parameters ## 85 | ################################################ 86 | 87 | ## To declare and build dynamic reconfigure parameters within this 88 | ## package, follow these steps: 89 | ## * In the file package.xml: 90 | ## * add a build_depend and a run_depend tag for "dynamic_reconfigure" 91 | ## * In this file (CMakeLists.txt): 92 | ## * add "dynamic_reconfigure" to 93 | ## find_package(catkin REQUIRED COMPONENTS ...) 94 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 95 | ## and list every .cfg file to be processed 96 | 97 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 98 | # generate_dynamic_reconfigure_options( 99 | # cfg/DynReconf1.cfg 100 | # cfg/DynReconf2.cfg 101 | # ) 102 | 103 | ################################### 104 | ## catkin specific configuration ## 105 | ################################### 106 | ## The catkin_package macro generates cmake config files for your package 107 | ## Declare things to be passed to dependent projects 108 | ## INCLUDE_DIRS: uncomment this if you package contains header files 109 | ## LIBRARIES: libraries you create in this project that dependent projects also need 110 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 111 | ## DEPENDS: system dependencies of this project that dependent projects also need 112 | catkin_package( 113 | # INCLUDE_DIRS include 114 | # LIBRARIES roscuda_laserscan_filter 115 | # CATKIN_DEPENDS roscpp rospy std_msgs 116 | # DEPENDS system_lib 117 | ) 118 | 119 | ########### 120 | ## Build ## 121 | ########### 122 | 123 | ## Specify additional locations of header files 124 | ## Your package locations should be listed before other locations 125 | include_directories( 126 | # include 127 | ${catkin_INCLUDE_DIRS} 128 | ) 129 | 130 | ## Declare a C++ library 131 | # add_library(${PROJECT_NAME} 132 | # src/${PROJECT_NAME}/roscuda_laserscan_filter.cpp 133 | # ) 134 | 135 | ## Add cmake target dependencies of the library 136 | ## as an example, code may need to be generated before libraries 137 | ## either from message generation or dynamic reconfigure 138 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 139 | 140 | ## Declare a C++ executable 141 | ## With catkin_make all packages are built within a single CMake context 142 | ## The recommended prefix ensures that target names across packages don't collide 143 | # add_executable(${PROJECT_NAME}_node src/roscuda_laserscan_filter_node.cpp) 144 | 145 | ## Rename C++ executable without prefix 146 | ## The above recommended prefix causes long target names, the following renames the 147 | ## target back to the shorter version for ease of user use 148 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 149 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 150 | 151 | ## Add cmake target dependencies of the executable 152 | ## same as for the library above 153 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 154 | 155 | ## Specify libraries to link a library or executable target against 156 | # target_link_libraries(${PROJECT_NAME}_node 157 | # ${catkin_LIBRARIES} 158 | # ) 159 | 160 | ADD_EXECUTABLE(roscuda_laserscan_filter_node src/main.cpp) 161 | ADD_DEPENDENCIES(roscuda_laserscan_filter_node LaserFilterLib) 162 | TARGET_LINK_LIBRARIES(roscuda_laserscan_filter_node 163 | ${catkin_LIBRARIES} 164 | ${PCL_LIBRARIES} 165 | LaserFilterLib 166 | ) 167 | 168 | ############# 169 | ## Install ## 170 | ############# 171 | 172 | # all install targets should use catkin DESTINATION variables 173 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 174 | 175 | ## Mark executable scripts (Python etc.) for installation 176 | ## in contrast to setup.py, you can choose the destination 177 | # install(PROGRAMS 178 | # scripts/my_python_script 179 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 180 | # ) 181 | 182 | ## Mark executables and/or libraries for installation 183 | # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node 184 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 185 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 186 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 187 | # ) 188 | 189 | ## Mark cpp header files for installation 190 | # install(DIRECTORY include/${PROJECT_NAME}/ 191 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 192 | # FILES_MATCHING PATTERN "*.h" 193 | # PATTERN ".svn" EXCLUDE 194 | # ) 195 | 196 | ## Mark other files for installation (e.g. launch and bag files, etc.) 197 | # install(FILES 198 | # # myfile1 199 | # # myfile2 200 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 201 | # ) 202 | 203 | ############# 204 | ## Testing ## 205 | ############# 206 | 207 | ## Add gtest based cpp test target and link libraries 208 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_roscuda_laserscan_filter.cpp) 209 | # if(TARGET ${PROJECT_NAME}-test) 210 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 211 | # endif() 212 | 213 | ## Add folders to be run by python nosetests 214 | # catkin_add_nosetests(test) 215 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_laserscan_filter/laserscan_noise.bag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UTFPR-Robotics/ros-cuda/033b87eb91e3d3de84e45f9544b9944a94dea2fa/ROS Packages/roscuda_laserscan_filter/laserscan_noise.bag -------------------------------------------------------------------------------- /ROS Packages/roscuda_laserscan_filter/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | roscuda_laserscan_filter 4 | 0.0.0 5 | The roscuda_laserscan_filter package 6 | 7 | 8 | 9 | 10 | nicolas 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | cuda 44 | roscpp 45 | rospy 46 | std_msgs 47 | roscpp 48 | rospy 49 | std_msgs 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_laserscan_filter/roscuda_laserscan_filter.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_laserscan_filter/src/laserfilter.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define THREADS_PER_BLOCK 128 7 | 8 | __global__ void av3(int n, float *in1, float *in2, float *in3, float *out) 9 | { 10 | int index = threadIdx.x + blockIdx.x * blockDim.x; 11 | // Guarantees that index does not go beyond vector size and applies average 12 | if (index>>(num, d_in1, d_in2, d_in3, d_out); 37 | // Wait for the GPU to finish 38 | cudaDeviceSynchronize(); 39 | // Copy result back to host and cleanup 40 | cudaMemcpy(out, d_out, size, cudaMemcpyDeviceToHost); 41 | cudaFree(d_in1); cudaFree(d_in2); cudaFree(d_in3); cudaFree(d_out); 42 | return out; 43 | } 44 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_laserscan_filter/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ros/ros.h" 2 | #include "sensor_msgs/LaserScan.h" 3 | #include "std_msgs/Float32.h" 4 | 5 | //Since we already know the laserscan used has fixed size, we will not bother using dynamic size 6 | #define SIZE 511 7 | 8 | float *average3(int num, float *in1, float *in2, float *in3, float *out); 9 | float in1[SIZE], in2[SIZE], in3[SIZE], out[SIZE]; 10 | sensor_msgs::LaserScan msg_laser; 11 | 12 | void laserscan_Callback(const sensor_msgs::LaserScan& msg) 13 | { 14 | msg_laser=msg; 15 | // Cycle vectors (in3=in2, in2=in1, in1=new) 16 | for(int i=0;i("/laserscan/filtered", 1); 29 | ros::Subscriber laser_sub = n.subscribe("/laserscan/raw", 100, laserscan_Callback); 30 | 31 | // Initializes the vectors with zeros 32 | for (int i = 0; i < SIZE; ++i) 33 | { 34 | in1[i]=in2[i]=in3[i]=out[i]=0; 35 | } 36 | while(ros::ok()) 37 | { // Get new message and perform average 38 | ros::spinOnce(); 39 | average3(SIZE, in1, in2, in3, out); 40 | // Assign frame_id and ranges size to be able to publish and visualize topic 41 | msg_laser.header.frame_id="LaserScanner_2D"; 42 | msg_laser.ranges.resize(511); 43 | // Assign values 44 | for(int i=0;i 2 | 3 | roscuda_template 4 | 0.0.0 5 | The roscuda_template package 6 | 7 | 8 | 9 | 10 | nicolas 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | roscpp 44 | rospy 45 | std_msgs 46 | roscpp 47 | rospy 48 | std_msgs 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_template/roscuda_template.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_template/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ros/ros.h" 2 | 3 | void testmain(int size, int *c); 4 | 5 | int main(int argc, char **argv) 6 | { 7 | ros::init(argc, argv, "roscuda_template"); 8 | ros::NodeHandle n; 9 | ros::Rate loop_rate(5); 10 | int num = 1; 11 | int *p; 12 | int s = num*sizeof(int); 13 | p = (int *)malloc(s); 14 | testmain(s,p); 15 | printf("%d\n",p[0]); 16 | 17 | while(ros::ok()) 18 | { 19 | ros::spinOnce(); 20 | loop_rate.sleep(); 21 | } 22 | free(p); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_template/src/template.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | __global__ void add(int *a, int *b, int *c) 8 | { 9 | int index = threadIdx.x + blockIdx.x * blockDim.x; 10 | c[index] = a[index] + b[index]; 11 | } 12 | 13 | void testmain(int size, int *c) 14 | { 15 | int *a, *b; // host copies of a, b, c 16 | int *d_a, *d_b, *d_c; // device copies of a, b, c; 17 | // Alloc space for device copies of a, b, c 18 | cudaMalloc((void **)&d_a, size); 19 | cudaMalloc((void **)&d_b, size); 20 | cudaMalloc((void **)&d_c, size); 21 | // Alloc space for host copies of a, b, c and setup input values 22 | a = (int *)malloc(size); a[0]=1; 23 | b = (int *)malloc(size); b[0]=4; 24 | // Copy inputs to device 25 | cudaMemcpy(d_a, a, size, cudaMemcpyHostToDevice); 26 | cudaMemcpy(d_b, b, size, cudaMemcpyHostToDevice); 27 | // Launch add() kernel on GPU 28 | add<<<1,1>>>(d_a, d_b, d_c); 29 | // Copy result back to host 30 | cudaMemcpy(c, d_c, size, cudaMemcpyDeviceToHost); 31 | // Cleanup 32 | free(a); free(b); 33 | cudaFree(d_a); cudaFree(d_b); cudaFree(d_c); 34 | return; 35 | } 36 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_vectoradd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(roscuda_vectoradd) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | FIND_PACKAGE(CUDA REQUIRED) 11 | 12 | find_package(catkin REQUIRED COMPONENTS 13 | roscpp 14 | rospy 15 | std_msgs 16 | ) 17 | 18 | ## System dependencies are found with CMake's conventions 19 | # find_package(Boost REQUIRED COMPONENTS system) 20 | 21 | 22 | ## Uncomment this if the package has a setup.py. This macro ensures 23 | ## modules and global scripts declared therein get installed 24 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 25 | # catkin_python_setup() 26 | 27 | ################################################ 28 | ## Declare ROS messages, services and actions ## 29 | ################################################ 30 | 31 | ## To declare and build messages, services or actions from within this 32 | ## package, follow these steps: 33 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 34 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 35 | ## * In the file package.xml: 36 | ## * add a build_depend tag for "message_generation" 37 | ## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET 38 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 39 | ## but can be declared for certainty nonetheless: 40 | ## * add a run_depend tag for "message_runtime" 41 | ## * In this file (CMakeLists.txt): 42 | ## * add "message_generation" and every package in MSG_DEP_SET to 43 | ## find_package(catkin REQUIRED COMPONENTS ...) 44 | ## * add "message_runtime" and every package in MSG_DEP_SET to 45 | ## catkin_package(CATKIN_DEPENDS ...) 46 | ## * uncomment the add_*_files sections below as needed 47 | ## and list every .msg/.srv/.action file to be processed 48 | ## * uncomment the generate_messages entry below 49 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 50 | 51 | ## Generate messages in the 'msg' folder 52 | # add_message_files( 53 | # FILES 54 | # Message1.msg 55 | # Message2.msg 56 | # ) 57 | 58 | ## Generate services in the 'srv' folder 59 | # add_service_files( 60 | # FILES 61 | # Service1.srv 62 | # Service2.srv 63 | # ) 64 | 65 | ## Generate actions in the 'action' folder 66 | # add_action_files( 67 | # FILES 68 | # Action1.action 69 | # Action2.action 70 | # ) 71 | 72 | ## Generate added messages and services with any dependencies listed here 73 | # generate_messages( 74 | # DEPENDENCIES 75 | # std_msgs 76 | # ) 77 | 78 | SET(CUDA_NVCC_FLAGS "-arch=compute_30" CACHE STRING "nvcc flags" FORCE) 79 | SET (CUDA_VERBOSE_BUILD ON CACHE BOOL "nvcc verbose" FORCE) 80 | SET(LIB_TYPE STATIC) 81 | CUDA_ADD_LIBRARY(TestLib ${LIB_TYPE} src/vectoradd.cu) 82 | 83 | ################################################ 84 | ## Declare ROS dynamic reconfigure parameters ## 85 | ################################################ 86 | 87 | ## To declare and build dynamic reconfigure parameters within this 88 | ## package, follow these steps: 89 | ## * In the file package.xml: 90 | ## * add a build_depend and a run_depend tag for "dynamic_reconfigure" 91 | ## * In this file (CMakeLists.txt): 92 | ## * add "dynamic_reconfigure" to 93 | ## find_package(catkin REQUIRED COMPONENTS ...) 94 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 95 | ## and list every .cfg file to be processed 96 | 97 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 98 | # generate_dynamic_reconfigure_options( 99 | # cfg/DynReconf1.cfg 100 | # cfg/DynReconf2.cfg 101 | # ) 102 | 103 | ################################### 104 | ## catkin specific configuration ## 105 | ################################### 106 | ## The catkin_package macro generates cmake config files for your package 107 | ## Declare things to be passed to dependent projects 108 | ## INCLUDE_DIRS: uncomment this if you package contains header files 109 | ## LIBRARIES: libraries you create in this project that dependent projects also need 110 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 111 | ## DEPENDS: system dependencies of this project that dependent projects also need 112 | catkin_package( 113 | # INCLUDE_DIRS include 114 | # LIBRARIES roscuda_vectoradd 115 | # CATKIN_DEPENDS roscpp rospy std_msgs 116 | # DEPENDS system_lib 117 | ) 118 | 119 | ########### 120 | ## Build ## 121 | ########### 122 | 123 | ## Specify additional locations of header files 124 | ## Your package locations should be listed before other locations 125 | include_directories( 126 | # include 127 | ${catkin_INCLUDE_DIRS} 128 | ) 129 | 130 | ## Declare a C++ library 131 | # add_library(${PROJECT_NAME} 132 | # src/${PROJECT_NAME}/roscuda_vectoradd.cpp 133 | # ) 134 | 135 | ## Add cmake target dependencies of the library 136 | ## as an example, code may need to be generated before libraries 137 | ## either from message generation or dynamic reconfigure 138 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 139 | 140 | ## Declare a C++ executable 141 | ## With catkin_make all packages are built within a single CMake context 142 | ## The recommended prefix ensures that target names across packages don't collide 143 | # add_executable(${PROJECT_NAME}_node src/roscuda_vectoradd_node.cpp) 144 | 145 | ## Rename C++ executable without prefix 146 | ## The above recommended prefix causes long target names, the following renames the 147 | ## target back to the shorter version for ease of user use 148 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 149 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 150 | 151 | ## Add cmake target dependencies of the executable 152 | ## same as for the library above 153 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 154 | 155 | ## Specify libraries to link a library or executable target against 156 | # target_link_libraries(${PROJECT_NAME}_node 157 | # ${catkin_LIBRARIES} 158 | # ) 159 | 160 | ADD_EXECUTABLE(roscuda_vectoradd src/main.cpp) 161 | ADD_DEPENDENCIES(roscuda_vectoradd TestLib) 162 | TARGET_LINK_LIBRARIES(roscuda_vectoradd 163 | ${catkin_LIBRARIES} 164 | ${PCL_LIBRARIES} 165 | TestLib 166 | ) 167 | 168 | ############# 169 | ## Install ## 170 | ############# 171 | 172 | # all install targets should use catkin DESTINATION variables 173 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 174 | 175 | ## Mark executable scripts (Python etc.) for installation 176 | ## in contrast to setup.py, you can choose the destination 177 | # install(PROGRAMS 178 | # scripts/my_python_script 179 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 180 | # ) 181 | 182 | ## Mark executables and/or libraries for installation 183 | # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node 184 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 185 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 186 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 187 | # ) 188 | 189 | ## Mark cpp header files for installation 190 | # install(DIRECTORY include/${PROJECT_NAME}/ 191 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 192 | # FILES_MATCHING PATTERN "*.h" 193 | # PATTERN ".svn" EXCLUDE 194 | # ) 195 | 196 | ## Mark other files for installation (e.g. launch and bag files, etc.) 197 | # install(FILES 198 | # # myfile1 199 | # # myfile2 200 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 201 | # ) 202 | 203 | ############# 204 | ## Testing ## 205 | ############# 206 | 207 | ## Add gtest based cpp test target and link libraries 208 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_roscuda_vectoradd.cpp) 209 | # if(TARGET ${PROJECT_NAME}-test) 210 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 211 | # endif() 212 | 213 | ## Add folders to be run by python nosetests 214 | # catkin_add_nosetests(test) 215 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_vectoradd/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | roscuda_vectoradd 4 | 0.0.0 5 | The roscuda_vectoradd package 6 | 7 | 8 | 9 | 10 | nicolas 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | cuda 44 | roscpp 45 | rospy 46 | std_msgs 47 | roscpp 48 | rospy 49 | std_msgs 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_vectoradd/roscuda_vectoradd.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_vectoradd/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ros/ros.h" 2 | #include 3 | #include "std_msgs/Int32.h" 4 | #include "std_msgs/Float32.h" 5 | 6 | #define N (1024*1024) 7 | 8 | int *testmain(int num, int threads); 9 | int size=10; 10 | std_msgs::Float32 msg_time; 11 | 12 | void size_Callback(const std_msgs::Int32& msg) 13 | { 14 | size=msg.data; 15 | if(size<1){size=1;} 16 | if(size>100){size=100;} 17 | } 18 | 19 | int main(int argc, char **argv) 20 | { 21 | ros::init(argc, argv, "roscuda_vectoradd"); 22 | ros::NodeHandle n; 23 | ros::Publisher time_pub = n.advertise("/time", 1); 24 | ros::Subscriber size_sub = n.subscribe("/size", 100, size_Callback); 25 | 26 | clock_t start, end; 27 | double cpu_time_used; 28 | int *p; 29 | 30 | while(ros::ok()) 31 | { 32 | start = clock(); 33 | p = testmain(size*N,THREADS_PER_BLOCK); 34 | end = clock(); 35 | 36 | cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC; 37 | msg_time.data=cpu_time_used; 38 | time_pub.publish(msg_time); 39 | 40 | ros::spinOnce(); 41 | } 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /ROS Packages/roscuda_vectoradd/src/vectoradd.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define THREADS_PER_BLOCK 512 7 | 8 | // Global function means it will be executed on the device (GPU) 9 | __global__ void add(int *in1, int *in2, int *out) 10 | { 11 | int index = threadIdx.x + blockIdx.x * blockDim.x; 12 | out[index] = in1[index] + in2[index]; 13 | } 14 | 15 | void random_ints(int *i, int size) 16 | { 17 | for(int k=0; k>>(d_in1, d_in2, d_out); 45 | // Wait for the GPU to finish 46 | cudaDeviceSynchronize(); 47 | // Copy result back to host 48 | cudaMemcpy(out, d_out, size, cudaMemcpyDeviceToHost); 49 | 50 | // Cleanup 51 | free(in1); free(in2); free(out); 52 | cudaFree(d_in1); cudaFree(d_in2); cudaFree(d_out); 53 | return out; 54 | } 55 | -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [2017] [Nicolas Dalmedico] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # GPU and ROS: The use of general parallel processing architecture for robot perception 2 | 3 | This repository is used to store ROS packages and files that are used as examples for the tutorial chapter GPU and ROS in the Springer ROS Book 2018 (Vol 3). 4 | 5 | ## Getting Started 6 | 7 | If you do not have the ROS Book 2018 chapter at your disposal, you can also use the sample packages by doing the following 8 | 9 | ### Prerequisites 10 | 11 | To use the packages, you will need any version of ROS above Indigo and you also need CUDA 5.0 or above installed on your Ubuntu. 12 | 13 | ### ROS Packages 14 | 15 | To use the ROS packages, simply drop them inside your ROS workspace and use 'catkin_make' to compile. Every example has a launch file to allow easy use as follows: 16 | 17 | ``` 18 | roslaunch roscuda_vectoradd roscuda_vectoradd.launch 19 | ``` 20 | 21 | This should be enough to run every example. Some of the packages have ROSbag files (inside the respective folder) that allow you to visualize the result if you do not have the sensors or image streams required by the packages. To run a ROSbag file, one can type: 22 | 23 | ``` 24 | rosbag play -l path/to/the/bag.bag 25 | ``` 26 | 27 | ### Files 28 | 29 | The files inside the 'files' folder are scripts or replacement files needed for ROS installation in the Nvidia Tegra boards. They're only necessary for those using these boards. Read the chapter for more information. 30 | 31 | ## Authors 32 | 33 | * **Nicolas Dalmedico** 34 | * **Marco Antônio Simões Teixeira** 35 | 36 | See also the list of [contributors](https://github.com/air-lasca/ros-cuda/contributors) who participated in this project. 37 | 38 | ## License 39 | 40 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details 41 | --------------------------------------------------------------------------------