diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7216bfc..75e2c53 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,17 @@ Changelog for package octomap_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.0.1 (2024-11-08) +------------------ +* Fix CMake install of headers (`#20 `_) +* Contributors: Tyler Weaver, Wolfgang Merkt + +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 + 0.3.3 (2016-06-11) ------------------ * Fix for binary ColorOcTrees messages diff --git a/CMakeLists.txt b/CMakeLists.txt index bc73c30..f535eb0 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 + DESTINATION include/${PROJECT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE) + +ament_export_dependencies(rosidl_default_runtime) +ament_package() 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 diff --git a/package.xml b/package.xml index 4ae26fd..6ddfa99 100644 --- a/package.xml +++ b/package.xml @@ -1,26 +1,33 @@ - + octomap_msgs - 0.3.3 + 2.0.1 - This package provides messages and serializations / conversion for the OctoMap library. + 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 + 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 +