From 5e19781c23827a3e202dd1ad0ffd354948aa8f78 Mon Sep 17 00:00:00 2001 From: Jilada Eccleston Date: Fri, 9 Oct 2020 17:38:21 +0900 Subject: [PATCH] ROS2 Porting: geo_pos_conv (#8) * Convert to ROS2 package - Update changelog -> 2.0.0 - Update package xml to use the ROS2 xml schema - Update CMakelist with ament cmake commands - Add ROS2 compile options * Convert CMakelist for foxy * Clean up - Remove comments * Remove colcon ignore --- .../gnss/geo_pos_conv/CHANGELOG.rst | 4 ++ .../gnss/geo_pos_conv/CMakeLists.txt | 52 ++++++++++++------- .../gnss/geo_pos_conv/COLCON_IGNORE | 0 .../gnss/geo_pos_conv/package.xml | 24 ++++++--- 4 files changed, 56 insertions(+), 24 deletions(-) delete mode 100644 sensing/preprocessor/gnss/geo_pos_conv/COLCON_IGNORE diff --git a/sensing/preprocessor/gnss/geo_pos_conv/CHANGELOG.rst b/sensing/preprocessor/gnss/geo_pos_conv/CHANGELOG.rst index b7ef6bc731f65..ead6db443a672 100644 --- a/sensing/preprocessor/gnss/geo_pos_conv/CHANGELOG.rst +++ b/sensing/preprocessor/gnss/geo_pos_conv/CHANGELOG.rst @@ -2,6 +2,10 @@ Changelog for package geo_pos_conv ^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.0.0 (2020-10-03) +------------------ +* Convert package to ROS2 + 1.11.0 (2019-03-21) ------------------- * add constructor (`#1913 `_) diff --git a/sensing/preprocessor/gnss/geo_pos_conv/CMakeLists.txt b/sensing/preprocessor/gnss/geo_pos_conv/CMakeLists.txt index 47d3ecb137a5b..e18c3c5b7384d 100644 --- a/sensing/preprocessor/gnss/geo_pos_conv/CMakeLists.txt +++ b/sensing/preprocessor/gnss/geo_pos_conv/CMakeLists.txt @@ -1,32 +1,48 @@ -cmake_minimum_required(VERSION 3.0.2) +cmake_minimum_required(VERSION 3.5) project(geo_pos_conv) -find_package(catkin REQUIRED COMPONENTS roscpp) +### Compile options +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wno-unused-parameter -Wall -Wextra -Wpedantic) +endif() -catkin_package( - INCLUDE_DIRS include - LIBRARIES geo_pos_conv -) +### Add dependencies +find_package(ament_cmake REQUIRED) +find_package(rclcpp REQUIRED) -include_directories( - include - ${catkin_INCLUDE_DIRS} -) +### Create library add_library(geo_pos_conv src/geo_pos_conv.cpp ) -target_link_libraries(geo_pos_conv - ${catkin_LIBRARIES} +target_include_directories(geo_pos_conv + PUBLIC + $ + $ ) -install(DIRECTORY include/${PROJECT_NAME}/ - DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +ament_target_dependencies(geo_pos_conv rclcpp) + +### Install library +ament_export_targets(geo_pos_conv HAS_LIBRARY_TARGET) +ament_export_dependencies(rclcpp) + +install( + DIRECTORY include/ + DESTINATION include ) -install(TARGETS geo_pos_conv - ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +install( + TARGETS geo_pos_conv + EXPORT geo_pos_conv + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include ) + +ament_package() diff --git a/sensing/preprocessor/gnss/geo_pos_conv/COLCON_IGNORE b/sensing/preprocessor/gnss/geo_pos_conv/COLCON_IGNORE deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/sensing/preprocessor/gnss/geo_pos_conv/package.xml b/sensing/preprocessor/gnss/geo_pos_conv/package.xml index c4d8ae07cbb5f..6e2d3d54e6062 100644 --- a/sensing/preprocessor/gnss/geo_pos_conv/package.xml +++ b/sensing/preprocessor/gnss/geo_pos_conv/package.xml @@ -1,12 +1,24 @@ - + + geo_pos_conv - 0.1.0 - The geo_pos_conv package + 2.0.0 + The ROS2 geo_pos_conv package Ryo Watanabe Tomomi HORII - Apache 2 + + Jilada ECCLESTON + Apache License 2.0 - catkin - roscpp + ament_cmake + + rclcpp + rclcpp_components + + rclcpp + rclcpp_components + + + ament_cmake +