diff --git a/README.md b/README.md index e7da834..4a3ae81 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,12 @@ resolved in the past. branch: master revision: HEAD + **meta-intel-realsense** (since 4a5ba0f20094dd3d07c0a0c1dede2ba40e9d6abf) + URI: https://github.com/IntelRealSense/meta-intel-realsense + branch: master + revision: HEAD + This layer is required only if you need to build realsense-camera driver. + **bitbake** > 1.20 diff --git a/recipes-extended/librealsense/librealsense_1.11.2.bb b/recipes-extended/librealsense/librealsense_1.11.2.bb deleted file mode 100644 index 960739e..0000000 --- a/recipes-extended/librealsense/librealsense_1.11.2.bb +++ /dev/null @@ -1,14 +0,0 @@ -DESCRIPTION = "Cross-platform camera capture for IntelĀ® RealSenseā„¢ F200, SR300 and R200" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" - -SRC_URI = "https://github.com/IntelRealSense/librealsense/archive/v${PV}.tar.gz" -SRC_URI[md5sum] = "27ce627c02731623c23894baeb73b2b1" - -EXTRA_OECMAKE_prepend = "\ - -DROS_BUILD_TYPE=TRUE \ - " - -DEPENDS = "libusb1" - -inherit catkin diff --git a/recipes-extended/realsense-camera/realsense-camera/0001-Add-option-to-link-against-non-catkin-librealsense.patch b/recipes-extended/realsense-camera/realsense-camera/0001-Add-option-to-link-against-non-catkin-librealsense.patch new file mode 100644 index 0000000..20d649a --- /dev/null +++ b/recipes-extended/realsense-camera/realsense-camera/0001-Add-option-to-link-against-non-catkin-librealsense.patch @@ -0,0 +1,96 @@ +From abaadefbb17d7ecebd5c4081122621f524a92b07 Mon Sep 17 00:00:00 2001 +From: Dmitry Rozhkov +Date: Wed, 15 Feb 2017 10:44:55 +0200 +Subject: [PATCH 1/2] Add option to link against non-catkin librealsense + +In OpenEmbedded setups where both meta-ros and +meta-intel-realsense layers are used it's problematic +to avoid two copies of librealsense installed onto +an embedded target: one catkit-based installed under +/opt/ros and one other installed to a standard system +location. + +This patch adds an option making realsense_camera link +against librealsense provided by the host system. + +By default the currently existing behavior is preserved. + +Upstream-Status: Submitted [https://github.com/intel-ros/realsense/pull/204] + +Signed-off-by: Dmitry Rozhkov +--- + CMakeLists.txt | 37 ++++++++++++++++++++++++++++++------- + 1 file changed, 30 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 796da59..ae10f84 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,8 +14,9 @@ set(CMAKE_EXE_LINKER_FLAGS "-pie -z noexecstack -z relro -z now") + # Flags shared libraries + set(CMAKE_SHARED_LINKER_FLAGS "-z noexecstack -z relro -z now ${CMAKE_SHARED_LINKER_FLAGS}") + +-find_package(catkin REQUIRED COMPONENTS +- librealsense ++option(USE_SYSTEM_LIBREALSENSE "Build realsense_camera against system librealsense, not the one built with catkin" OFF) ++ ++set(REALSENSE_CATKIN_BASED_DEPS + dynamic_reconfigure + roscpp + nodelet +@@ -30,6 +31,16 @@ find_package(catkin REQUIRED COMPONENTS + roslint + ) + ++if(USE_SYSTEM_LIBREALSENSE) ++ find_package(realsense REQUIRED) ++else() ++ list(APPEND REALSENSE_CATKIN_BASED_DEPS librealsense) ++endif() ++ ++find_package(catkin REQUIRED COMPONENTS ++ ${REALSENSE_CATKIN_BASED_DEPS} ++) ++ + add_message_files( + FILES + IMUInfo.msg +@@ -71,11 +82,20 @@ roslint_add_test() + # LIBRARIES: libraries you create in this project that dependent projects also need + # CATKIN_DEPENDS: catkin_packages dependent projects also need + # DEPENDS: system dependencies of this project that dependent projects also need +-catkin_package( +- INCLUDE_DIRS include +- CATKIN_DEPENDS librealsense std_msgs message_runtime sensor_msgs +- LIBRARIES ${PROJECT_NAME}_nodelet +-) ++if(USE_SYSTEM_LIBREALSENSE) ++ catkin_package( ++ INCLUDE_DIRS include ++ CATKIN_DEPENDS std_msgs message_runtime sensor_msgs ++ DEPENDS realsense ++ LIBRARIES ${PROJECT_NAME}_nodelet ++ ) ++else() ++ catkin_package( ++ INCLUDE_DIRS include ++ CATKIN_DEPENDS std_msgs message_runtime sensor_msgs librealsense ++ LIBRARIES ${PROJECT_NAME}_nodelet ++ ) ++endif() + + # Specify additional locations of header files + include_directories( +@@ -93,6 +113,9 @@ add_dependencies(${PROJECT_NAME}_nodelet ${catkin_EXPORTED_TARGETS}) + + add_executable(get_debug_info src/get_debug_info.cpp) + target_link_libraries(get_debug_info ${catkin_LIBRARIES}) ++if(USE_SYSTEM_LIBREALSENSE) ++ target_link_libraries(get_debug_info PRIVATE realsense::realsense) ++endif() + + if (CATKIN_ENABLE_TESTING) + find_package(rostest REQUIRED) +-- +2.7.4 + diff --git a/recipes-extended/realsense-camera/realsense-camera/0001-realsense-camera-don-t-ignore-linker-flags-set-by-us.patch b/recipes-extended/realsense-camera/realsense-camera/0001-realsense-camera-don-t-ignore-linker-flags-set-by-us.patch deleted file mode 100644 index 6f45adc..0000000 --- a/recipes-extended/realsense-camera/realsense-camera/0001-realsense-camera-don-t-ignore-linker-flags-set-by-us.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 6eac973eb36a6f10dd7278b6bc3798a216e52e16 Mon Sep 17 00:00:00 2001 -From: Dmitry Rozhkov -Date: Mon, 12 Dec 2016 11:11:58 +0200 -Subject: [PATCH] realsense-camera: don't ignore linker flags set by user - -Yocto's bitbake sets global LDFLAGS that include the option ---hash-style=gnu. If this option is ignored then bitbake's -QA checks report that - -QA Issue: No GNU_HASH in the elf binary: '/[...]/opt/ros/indigo/lib/librealsense_camera_nodelet.so' [ldflags] - -The patch includes user defined linker flags to -CMAKE_SHARED_LINKER_FLAGS defined in the project's CMakeList.txt. - -Upstream-Status: Submitted [https://github.com/intel-ros/realsense/pull/162] - -Signed-off-by: Dmitry Rozhkov ---- - realsense_camera/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c5cfffe..307fd97 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,7 +12,7 @@ set(CMAKE_CXX_FLAGS "-fPIE -fPIC -std=c++11 -O2 -D_FORTIFY_SOURCE=2 -fstack-prot - # Flags executables - set(CMAKE_EXE_LINKER_FLAGS "-pie -z noexecstack -z relro -z now") - # Flags shared libraries --set(CMAKE_SHARED_LINKER_FLAGS "-z noexecstack -z relro -z now") -+set(CMAKE_SHARED_LINKER_FLAGS "-z noexecstack -z relro -z now ${CMAKE_SHARED_LINKER_FLAGS}") - - find_package(catkin REQUIRED COMPONENTS - librealsense --- -2.7.4 - diff --git a/recipes-extended/realsense-camera/realsense-camera/0002-Enable-roslint-when-CATKIN_ENABLE_TESTING-is-True.patch b/recipes-extended/realsense-camera/realsense-camera/0002-Enable-roslint-when-CATKIN_ENABLE_TESTING-is-True.patch new file mode 100644 index 0000000..597031a --- /dev/null +++ b/recipes-extended/realsense-camera/realsense-camera/0002-Enable-roslint-when-CATKIN_ENABLE_TESTING-is-True.patch @@ -0,0 +1,68 @@ +From 787ebb1f9b598e4444ab820a9d6c36142935f793 Mon Sep 17 00:00:00 2001 +From: Dmitry Rozhkov +Date: Fri, 17 Mar 2017 10:40:26 +0200 +Subject: [PATCH 2/2] Enable roslint when CATKIN_ENABLE_TESTING is True + +roslint depends on catkin_run_tests_target() which is defined only +when CATKIN_ENABLE_TESTING is True. + +Thus run roslint functions in CMakeLists.txt only when testing +is enabled. + +Upstream-Status: Submitted [https://github.com/intel-ros/realsense/pull/204] + +Signed-off-by: Dmitry Rozhkov +--- + CMakeLists.txt | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae10f84..a1ec2f6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,7 +28,6 @@ set(REALSENSE_CATKIN_BASED_DEPS + std_msgs + sensor_msgs + pcl_ros +- roslint + ) + + if(USE_SYSTEM_LIBREALSENSE) +@@ -37,6 +36,10 @@ else() + list(APPEND REALSENSE_CATKIN_BASED_DEPS librealsense) + endif() + ++if(CATKIN_ENABLE_TESTING) ++ list(APPEND REALSENSE_CATKIN_BASED_DEPS roslint) ++endif() ++ + find_package(catkin REQUIRED COMPONENTS + ${REALSENSE_CATKIN_BASED_DEPS} + ) +@@ -68,11 +71,6 @@ generate_dynamic_reconfigure_options( + cfg/zr300_params.cfg + ) + +-# ROS Lint the code +-roslint_cpp() +-roslint_python() +-roslint_add_test() +- + ################################# + # catkin specific configuration # + ################################# +@@ -120,6 +118,11 @@ endif() + if (CATKIN_ENABLE_TESTING) + find_package(rostest REQUIRED) + ++ # ROS Lint the code ++ roslint_cpp() ++ roslint_python() ++ roslint_add_test() ++ + add_executable(tests_camera_core test/camera_core.cpp) + target_link_libraries(tests_camera_core + ${catkin_LIBRARIES} +-- +2.7.4 + diff --git a/recipes-extended/realsense-camera/realsense-camera_1.6.1.bb b/recipes-extended/realsense-camera/realsense-camera_1.6.1.bb deleted file mode 100644 index b707730..0000000 --- a/recipes-extended/realsense-camera/realsense-camera_1.6.1.bb +++ /dev/null @@ -1,14 +0,0 @@ -DESCRIPTION = "ROS driver for RealSense camera" -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://package.xml;beginline=11;endline=11;md5=4bcd5f0e140091c68f8c0bcfdd6181e0" - -DEPENDS = "librealsense cv-bridge camera-info-manager pcl-ros roscpp" - -SRC_URI = "https://github.com/intel-ros/realsense/archive/${PV}.tar.gz \ - file://0001-realsense-camera-don-t-ignore-linker-flags-set-by-us.patch \ - " -SRC_URI[md5sum] = "4adab9a45a0b7a84cd28f1de538d0de8" - -S = "${WORKDIR}/realsense-${PV}/realsense_camera" - -inherit catkin diff --git a/recipes-extended/realsense-camera/realsense-camera_1.7.2.bb b/recipes-extended/realsense-camera/realsense-camera_1.7.2.bb new file mode 100644 index 0000000..4fa4520 --- /dev/null +++ b/recipes-extended/realsense-camera/realsense-camera_1.7.2.bb @@ -0,0 +1,18 @@ +DESCRIPTION = "ROS driver for RealSense camera" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://package.xml;beginline=9;endline=9;md5=4bcd5f0e140091c68f8c0bcfdd6181e0" + +DEPENDS = "librealsense cv-bridge camera-info-manager pcl-ros roscpp" + +SRC_URI = "https://github.com/intel-ros/realsense/archive/${PV}.tar.gz \ + file://0001-Add-option-to-link-against-non-catkin-librealsense.patch \ + file://0002-Enable-roslint-when-CATKIN_ENABLE_TESTING-is-True.patch \ + " +SRC_URI[md5sum] = "aaa0d0ddaaee210e2a2529767ba45a4b" +SRC_URI[sha256sum] = "65c6c4a0b6bd0214dffa8528033f03c0fbc4be00e52e058cfbd96b4f7d733b10" + +S = "${WORKDIR}/realsense-${PV}/realsense_camera" + +inherit catkin + +EXTRA_OECMAKE = "-DUSE_SYSTEM_LIBREALSENSE:BOOL=ON"