From f835d66bf34d79721027220d0e9569e797ae7618 Mon Sep 17 00:00:00 2001 From: ibaiape Date: Mon, 11 Feb 2019 12:42:19 +0100 Subject: [PATCH 1/5] Update CMakeLists.txt and package.xml --- CMakeLists.txt | 43 ++++++++++++++++++++++++++++++------------- package.xml | 30 ++++++++++++++++++------------ 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc73c30..cd3112a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,27 +1,44 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.5) project(octomap_msgs) -find_package(catkin REQUIRED COMPONENTS message_generation geometry_msgs std_msgs) +# Default to C++14 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +# Disable Wredundant-decls warnings since rosidl generates redundant function declarations +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-redundant-decls") +endif() include_directories(include) -add_message_files( - DIRECTORY msg - FILES Octomap.msg OctomapWithPose.msg - ) +find_package(ament_cmake REQUIRED) +find_package(rosidl_default_generators REQUIRED) +find_package(std_msgs REQUIRED) +find_package(geometry_msgs REQUIRED) -add_service_files( - DIRECTORY srv - FILES GetOctomap.srv BoundingBoxQuery.srv +set(msg_files + "msg/Octomap.msg" + "msg/OctomapWithPose.msg" +) +set(srv_files + "srv/BoundingBoxQuery.srv" + "srv/GetOctomap.srv" ) -generate_messages(DEPENDENCIES std_msgs geometry_msgs) - -catkin_package(DEPENDS message_runtime geometry_msgs std_msgs - INCLUDE_DIRS include +rosidl_generate_interfaces(${PROJECT_NAME} + ${msg_files} + ${srv_files} + DEPENDENCIES + std_msgs + geometry_msgs ) install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE) + +ament_export_dependencies(rosidl_default_runtime) +ament_package() diff --git a/package.xml b/package.xml index 4ae26fd..69a8a37 100644 --- a/package.xml +++ b/package.xml @@ -1,26 +1,32 @@ - + octomap_msgs 0.3.3 - This package provides messages and serializations / conversion for the OctoMap library. + This package provides messages and serializations / conversion for the OctoMap library. Armin Hornung Armin Hornung - BSD + BSD http://ros.org/wiki/octomap_msgs https://github.com/OctoMap/octomap_msgs/issues - catkin - - message_generation - geometry_msgs - std_msgs - - geometry_msgs - std_msgs - message_runtime + ament_cmake + rosidl_default_generators + + rosidl_default_generators + + std_msgs + geometry_msgs + + rosidl_default_runtime + + rosidl_interface_packages + + + ament_cmake + From e8d3402cce631808f33461e921e46f103953bec2 Mon Sep 17 00:00:00 2001 From: ibaiape Date: Mon, 11 Feb 2019 13:58:13 +0100 Subject: [PATCH 2/5] Update message types and conversion --- include/octomap_msgs/conversions.h | 14 +++++++------- msg/Octomap.msg | 2 +- msg/OctomapWithPose.msg | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/octomap_msgs/conversions.h b/include/octomap_msgs/conversions.h index 311bf41..fc3ec77 100644 --- a/include/octomap_msgs/conversions.h +++ b/include/octomap_msgs/conversions.h @@ -39,7 +39,7 @@ #define OCTOMAP_MSGS_CONVERT_MSGS_H #include -#include +#include #include // new conversion functions @@ -52,7 +52,7 @@ namespace octomap_msgs{ * full map information (i.e., binary is false) and returns an AbstractOcTree* * to it. You will need to free the memory when you're done. */ - static inline octomap::AbstractOcTree* fullMsgToMap(const Octomap& msg){ + static inline octomap::AbstractOcTree* fullMsgToMap(const octomap_msgs::msg::Octomap& msg){ octomap::AbstractOcTree* tree = octomap::AbstractOcTree::createTree(msg.id, msg.resolution); if (tree){ std::stringstream datastream; @@ -67,7 +67,7 @@ namespace octomap_msgs{ template - void readTree(TreeType* octree, const Octomap& msg){ + void readTree(TreeType* octree, const octomap_msgs::msg::Octomap& msg){ std::stringstream datastream; if (msg.data.size() > 0){ datastream.write((const char*) &msg.data[0], msg.data.size()); @@ -82,7 +82,7 @@ namespace octomap_msgs{ * This creates a new OcTree object and returns a pointer to it. * You will need to free the memory when you're done. */ - static inline octomap::AbstractOcTree* binaryMsgToMap(const Octomap& msg){ + static inline octomap::AbstractOcTree* binaryMsgToMap(const octomap_msgs::msg::Octomap& msg){ if (!msg.binary) return NULL; @@ -107,7 +107,7 @@ namespace octomap_msgs{ * \brief Convert an octomap representation to a new octree (full probabilities * or binary). You will need to free the memory. Return NULL on error. **/ - static inline octomap::AbstractOcTree* msgToMap(const Octomap& msg){ + static inline octomap::AbstractOcTree* msgToMap(const octomap_msgs::msg::Octomap& msg){ if (msg.binary) return binaryMsgToMap(msg); else @@ -163,7 +163,7 @@ namespace octomap_msgs{ * @return success of serialization */ template - static inline bool binaryMapToMsg(const OctomapT& octomap, Octomap& msg){ + static inline bool binaryMapToMsg(const OctomapT& octomap, octomap_msgs::msg::Octomap& msg){ msg.resolution = octomap.getResolution(); msg.id = octomap.getTreeType(); msg.binary = true; @@ -185,7 +185,7 @@ namespace octomap_msgs{ * @return success of serialization */ template - static inline bool fullMapToMsg(const OctomapT& octomap, Octomap& msg){ + static inline bool fullMapToMsg(const OctomapT& octomap, octomap_msgs::msg::Octomap& msg){ msg.resolution = octomap.getResolution(); msg.id = octomap.getTreeType(); msg.binary = false; diff --git a/msg/Octomap.msg b/msg/Octomap.msg index fd67295..1cc59d7 100644 --- a/msg/Octomap.msg +++ b/msg/Octomap.msg @@ -1,5 +1,5 @@ # A 3D map in binary format, as Octree -Header header +std_msgs/Header header # Flag to denote a binary (only free/occupied) or full occupancy octree (.bt/.ot file) bool binary diff --git a/msg/OctomapWithPose.msg b/msg/OctomapWithPose.msg index 5a6e8ac..2963922 100644 --- a/msg/OctomapWithPose.msg +++ b/msg/OctomapWithPose.msg @@ -1,7 +1,7 @@ # A 3D map in binary format, as Octree -Header header +std_msgs/Header header -# The pose of the octree with respect to the header frame +# The pose of the octree with respect to the header frame geometry_msgs/Pose origin # The actual octree msg From 1e0c084feb6bf59621d0e50fd6336aea8d516369 Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 1 Jul 2020 18:46:11 +0100 Subject: [PATCH 3/5] Change version to 2.0.0 for ROS2; update maintainer --- package.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.xml b/package.xml index 69a8a37..0555a3a 100644 --- a/package.xml +++ b/package.xml @@ -1,12 +1,13 @@ octomap_msgs - 0.3.3 + 2.0.0 This package provides messages and serializations / conversion for the OctoMap library. + This ROS2 version is based on version 0.3.3 of the ROS1 package. Armin Hornung - Armin Hornung + Wolfgang Merkt BSD From cdaae3ba366050a38dcedd89f1cd64bfa6d9366f Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 1 Jul 2020 18:51:37 +0100 Subject: [PATCH 4/5] Update changelog --- CHANGELOG.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7216bfc..a242823 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,12 @@ Changelog for package octomap_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Change version to 2.0.0 for ROS2; update maintainer +* Porting to ROS2, based on ROS version 0.3.3 `#13 `_ +* Contributors: Yan Yu, Ibai Apellaniz, Henning Kayser, Wolfgang Merkt + 0.3.3 (2016-06-11) ------------------ * Fix for binary ColorOcTrees messages From 65d0b3b81f890b5dc3bf531abe0e8c12ef3858e2 Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 1 Jul 2020 18:51:50 +0100 Subject: [PATCH 5/5] 2.0.0 --- CHANGELOG.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a242823..590e7bf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package octomap_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +2.0.0 (2020-07-01) +------------------ * Change version to 2.0.0 for ROS2; update maintainer * Porting to ROS2, based on ROS version 0.3.3 `#13 `_ * Contributors: Yan Yu, Ibai Apellaniz, Henning Kayser, Wolfgang Merkt