Skip to content

Commit

Permalink
ROS2 Porting: geo_pos_conv (#8)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jilaada authored Oct 9, 2020
1 parent 4d45188 commit 5e19781
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 24 deletions.
4 changes: 4 additions & 0 deletions sensing/preprocessor/gnss/geo_pos_conv/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/CPFL/Autoware/issues/1913>`_)
Expand Down
52 changes: 34 additions & 18 deletions sensing/preprocessor/gnss/geo_pos_conv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

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()
Empty file.
24 changes: 18 additions & 6 deletions sensing/preprocessor/gnss/geo_pos_conv/package.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
<?xml version="1.0"?>
<package format="2">
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>geo_pos_conv</name>
<version>0.1.0</version>
<description>The geo_pos_conv package</description>
<version>2.0.0</version>
<description>The ROS2 geo_pos_conv package</description>
<maintainer email="ryo.watanabe@tier4.jp">Ryo Watanabe</maintainer>
<maintainer email="tomo@axe.bz">Tomomi HORII</maintainer>
<license>Apache 2</license>
<!-- ROS2 -->
<maintainer email="jilada.eccleston@tier4.jp">Jilada ECCLESTON</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>catkin</buildtool_depend>
<depend>roscpp</depend>
<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>rclcpp</build_depend>
<build_depend>rclcpp_components</build_depend>

<exec_depend>rclcpp</exec_depend>
<exec_depend>rclcpp_components</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

0 comments on commit 5e19781

Please sign in to comment.