Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROS2] port package to ament_cmake, other necessary updates #351

Merged
merged 2 commits into from
Aug 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 45 additions & 40 deletions rosapi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(rosapi)

find_package(catkin REQUIRED COMPONENTS message_generation)
catkin_python_setup()
find_package(ament_cmake_ros REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)

add_message_files(
FILES
TypeDef.msg
)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

add_service_files(
FILES
DeleteParam.srv
GetActionServers.srv
GetParam.srv
GetParamNames.srv
GetTime.srv
HasParam.srv
MessageDetails.srv
Nodes.srv
NodeDetails.srv
Publishers.srv
SearchParam.srv
ServiceHost.srv
ServiceNode.srv
ServiceProviders.srv
ServiceRequestDetails.srv
ServiceResponseDetails.srv
Services.srv
ServicesForType.srv
ServiceType.srv
SetParam.srv
Subscribers.srv
Topics.srv
TopicsForType.srv
TopicType.srv
)
ament_python_install_package(
${PROJECT_NAME} PACKAGE_DIR "src/${PROJECT_NAME}")

generate_messages(
DEPENDENCIES
rosidl_generate_interfaces(${PROJECT_NAME}
msg/TypeDef.msg
srv/DeleteParam.srv
srv/GetActionServers.srv
srv/GetParam.srv
srv/GetParamNames.srv
srv/GetTime.srv
srv/HasParam.srv
srv/MessageDetails.srv
srv/Nodes.srv
srv/NodeDetails.srv
srv/Publishers.srv
srv/SearchParam.srv
srv/ServiceHost.srv
srv/ServiceNode.srv
srv/ServiceProviders.srv
srv/ServiceRequestDetails.srv
srv/ServiceResponseDetails.srv
srv/Services.srv
srv/ServicesForType.srv
srv/ServiceType.srv
srv/SetParam.srv
srv/Subscribers.srv
srv/Topics.srv
srv/TopicsForType.srv
srv/TopicType.srv
DEPENDENCIES builtin_interfaces
)

catkin_package(
CATKIN_DEPENDS message_runtime
)
ament_export_dependencies(rosidl_default_runtime)

ament_package()

install(PROGRAMS scripts/rosapi_node
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
DESTINATION lib/${PROJECT_NAME}
)

install(
FILES mapping_rules.yaml
DESTINATION share/${PROJECT_NAME}
)
8 changes: 8 additions & 0 deletions rosapi/mapping_rules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-
ros1_package_name: 'rosapi'
ros1_service_name: 'GetParam'
ros2_package_name: 'rosapi'
ros2_service_name: 'GetParam'
request_fields_1_to_2:
name: 'name'
default: 'default_value'
25 changes: 20 additions & 5 deletions rosapi/package.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<package format="2">
<package format="3">
<name>rosapi</name>
<version>0.11.1</version>
<description>
Expand All @@ -17,13 +17,28 @@
<maintainer email="rctoris@wpi.edu">Russell Toris</maintainer>
<maintainer email="jihoonlee.in@gmail.com">Jihoon Lee</maintainer>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake_ros</buildtool_depend>

<build_depend>message_generation</build_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<exec_depend>rclpy</exec_depend>
<exec_depend>rcl_interfaces</exec_depend>
<exec_depend>rosbridge_library</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>ros2node</exec_depend>
<exec_depend>ros2param</exec_depend>
<exec_depend>ros2pkg</exec_depend>
<exec_depend>ros2service</exec_depend>
<exec_depend>ros2topic</exec_depend>
<!--
<exec_depend>rosnode</exec_depend>
<exec_depend>rosgraph</exec_depend>
<exec_depend>message_runtime</exec_depend>
-->
<exec_depend>rosidl_default_runtime</exec_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
<ros1_bridge mapping_rules="mapping_rules.yaml"/>
</export>
</package>
Loading