From 3fb84b008cde48946a9fef147e527c763aaf9613 Mon Sep 17 00:00:00 2001 From: Matthias Schoepfer Date: Tue, 24 Oct 2017 14:13:05 +0200 Subject: [PATCH 1/2] ros-canopen: initial recipes for indigo distro This commit is the result of: - cherry-picking the two commits from the branch kinetic-experimental-v3-alpha1 commit aed2202182df ("ros-canopen: adding can-msgs, socketcan-interface and socketcan-bridge") commit b62356a3a545 ("socketcan-interface: apply patch to compile with boost 1.65") - downgrading the recipe version to the indigo release version 0.6.8, - and squashing these changes into one commit. The original ros-canopen recipes on kinetic-experimental were provided by Matthias Schoepfer . [1] https://github.com/bulwahn/meta-ros/commit/aed2202182dff2b00809406ce38c72681e06e16b [2] https://github.com/bulwahn/meta-ros/commit/b62356a3a5455bb2cb78245b78348e1e707072a3 Signed-off-by: Lukas Bulwahn --- recipes-ros/ros-canopen/can-msgs_0.6.8.bb | 10 ++++ recipes-ros/ros-canopen/ros-canopen.inc | 9 +++ .../ros-canopen/socketcan-bridge_0.6.8.bb | 9 +++ ...de-iostream-to-compile-with-boost-1..patch | 60 +++++++++++++++++++ .../ros-canopen/socketcan-interface_0.6.8.bb | 10 ++++ 5 files changed, 98 insertions(+) create mode 100644 recipes-ros/ros-canopen/can-msgs_0.6.8.bb create mode 100644 recipes-ros/ros-canopen/ros-canopen.inc create mode 100644 recipes-ros/ros-canopen/socketcan-bridge_0.6.8.bb create mode 100644 recipes-ros/ros-canopen/socketcan-interface/0001-explicitly-include-iostream-to-compile-with-boost-1..patch create mode 100644 recipes-ros/ros-canopen/socketcan-interface_0.6.8.bb diff --git a/recipes-ros/ros-canopen/can-msgs_0.6.8.bb b/recipes-ros/ros-canopen/can-msgs_0.6.8.bb new file mode 100644 index 0000000..63b9ee0 --- /dev/null +++ b/recipes-ros/ros-canopen/can-msgs_0.6.8.bb @@ -0,0 +1,10 @@ +DESCRIPTION = "CAN related message types." +SECTION = "devel" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://package.xml;beginline=10;endline=10;md5=d566ef916e9dedc494f5f793a6690ba5" + +DEPENDS = "std-msgs genmsg message-generation" + +RDEPENDS_${PN} = "std-msgs message-runtime" + +require ros-canopen.inc diff --git a/recipes-ros/ros-canopen/ros-canopen.inc b/recipes-ros/ros-canopen/ros-canopen.inc new file mode 100644 index 0000000..bcf6e83 --- /dev/null +++ b/recipes-ros/ros-canopen/ros-canopen.inc @@ -0,0 +1,9 @@ +SRC_URI = "https://github.com/ros-industrial/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz" +SRC_URI[md5sum] = "dfee31155f203178be7a7d537a75f162" +SRC_URI[sha256sum] = "ea66ce536c2f64c0bb3642d7c91df8e3f2e9b54e6ca102c97d6c7429becc8b85" + +S = "${WORKDIR}/${ROS_SPN}-${PV}/${ROS_BPN}" + +inherit catkin + +ROS_SPN = "ros_canopen" diff --git a/recipes-ros/ros-canopen/socketcan-bridge_0.6.8.bb b/recipes-ros/ros-canopen/socketcan-bridge_0.6.8.bb new file mode 100644 index 0000000..ddc77dc --- /dev/null +++ b/recipes-ros/ros-canopen/socketcan-bridge_0.6.8.bb @@ -0,0 +1,9 @@ +DESCRIPTION = "Provides nodes to convert messages from SocketCAN to a ROS Topic and vice versa." +SECTION = "devel" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://package.xml;beginline=10;endline=10;md5=d566ef916e9dedc494f5f793a6690ba5" + +DEPENDS = "socketcan-interface can-msgs roscpp" +RDEPENDS_${PN} = "can-msgs" + +require ros-canopen.inc diff --git a/recipes-ros/ros-canopen/socketcan-interface/0001-explicitly-include-iostream-to-compile-with-boost-1..patch b/recipes-ros/ros-canopen/socketcan-interface/0001-explicitly-include-iostream-to-compile-with-boost-1..patch new file mode 100644 index 0000000..cdfacd2 --- /dev/null +++ b/recipes-ros/ros-canopen/socketcan-interface/0001-explicitly-include-iostream-to-compile-with-boost-1..patch @@ -0,0 +1,60 @@ +From 3bf9d9726b278b000a829f639af21d423a38798a Mon Sep 17 00:00:00 2001 +From: Lukas Bulwahn +Date: Sat, 2 Dec 2017 09:17:02 +0100 +Subject: [PATCH] explicitly include iostream to compile with boost >= 1.65.0 + +When compiling with boost version >= 1.65.0, it fails with: +``` +In file included from /[...]/include/socketcan_interface/asio_base.h:4:0, + from /[...]/include/socketcan_interface/socketcan.h:4, + from /[...]/src/socketcan_interface_plugin.cpp:2: +/[...]/include/socketcan_interface/socketcan.h: In member function 'virtual bool can::SocketCANInterface::enqueue(const can::Frame&)': +/[...]/include/socketcan_interface/interface.h:202:96: error: 'cout' is not a member of 'std' + #define LOG(log) { boost::mutex::scoped_lock _cout_lock(_cout_wrapper::get_cout_mutex()); std::cout << log << std::endl; } + ^ +/[...]/include/socketcan_interface/socketcan.h:183:13: note: in expansion of macro 'LOG' + LOG("FAILED " << ec); + ^ +/[...]/include/socketcan_interface/interface.h:202:96: note: suggested alternative: 'count' +``` + +With boost version < 1.65.0, iostream is probably included by the +boost dependencies in the header files; with boost version >= 1.65.0, +it is not included anymore and hence leads to this compile error. + +The issue was identified by the work on meta-ros, the OpenEmbedded +layer for ROS [1,2]. It provides a cross-compilation tool chain for +ROS packages and its current master version already uses boost +version 1.65.1. + +[1] https://github.com/bmwcarit/meta-ros +[2] https://github.com/bulwahn/meta-ros/pull/8 + +Signed-off-by: Lukas Bulwahn + +Upstream-Status: Accepted [https://github.com/ros-industrial/ros_canopen/commit/3bf9d9726b278b000a829f639af21d423a38798a] + +This patch has been generated with: + `git format-patch -1 3bf9d9726b278b000a829f639af21d423a38798a` +in the ros_canopen repository. + +Signed-off-by: Lukas Bulwahn +--- + socketcan_interface/include/socketcan_interface/interface.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/socketcan_interface/include/socketcan_interface/interface.h b/socketcan_interface/include/socketcan_interface/interface.h +index f60f308..33378de 100644 +--- a/socketcan_interface/include/socketcan_interface/interface.h ++++ b/socketcan_interface/include/socketcan_interface/interface.h +@@ -190,6 +190,7 @@ public: + + } // namespace can + ++#include + #include + + struct _cout_wrapper{ +-- +2.7.4 + diff --git a/recipes-ros/ros-canopen/socketcan-interface_0.6.8.bb b/recipes-ros/ros-canopen/socketcan-interface_0.6.8.bb new file mode 100644 index 0000000..94a7a43 --- /dev/null +++ b/recipes-ros/ros-canopen/socketcan-interface_0.6.8.bb @@ -0,0 +1,10 @@ +DESCRIPTION = "This package contains a generic CAN interface description with helpers for filtering and driver implementation. Further a socketcan implementation based on boost::asio is included." +SECTION = "devel" +LICENSE = "LGPLv3" +LIC_FILES_CHKSUM = "file://package.xml;beginline=10;endline=10;md5=b691248d2f70cdaeeaf13696ada5d47c" + +DEPENDS = "boost class-loader virtual/kernel" + +require ros-canopen.inc + +SRC_URI += "file://0001-explicitly-include-iostream-to-compile-with-boost-1..patch;striplevel=2" From 8439e72c55527a5786463d49ffb40ef34bee770f Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Sat, 2 Dec 2017 21:52:05 +0100 Subject: [PATCH 2/2] packagegroup-ros-world: include new ros-canopen recipes This commit is cherry-picked from kinetic-experimental-v3-alpha1: https://github.com/bulwahn/meta-ros/commit/bb50d6fb4641bc7e332c27a7258de5b783588d8b Signed-off-by: Lukas Bulwahn --- recipes-ros/packagegroups/packagegroup-ros-world.bb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes-ros/packagegroups/packagegroup-ros-world.bb b/recipes-ros/packagegroups/packagegroup-ros-world.bb index 2e44281..5fcb4e6 100644 --- a/recipes-ros/packagegroups/packagegroup-ros-world.bb +++ b/recipes-ros/packagegroups/packagegroup-ros-world.bb @@ -194,6 +194,9 @@ RDEPENDS_${PN} = "\ mavros \ mavros-extras \ mavlink \ + can-msgs \ + socketcan-bridge \ + socketcan-interface \ " # kdl-parser-py requires python-orocos-kdl, which current fails due to #469.