Skip to content

Commit

Permalink
Move msg/srv from rosapi and rosbridge_library into separate packages…
Browse files Browse the repository at this point in the history
…; enable Rolling in CI (#665)

**Public API Changes**
The msg and srv interfaces under `rosapi` are moving to a new package `rosapi_msgs`. The ones from `rosbridge_library` were used only for testing and are moving to a new package `rosbridge_test_msgs`.


**Description**
Fixes #581. Closes #602.
Due to a [change](ros2/rosidl_python#131) in rosidl_python, the generated python packages containing msg classes were conflicting with the python package these libraries export (ros2/rosidl_python#141). The solution recommended in that thread was to split these definitions into separate packages.
  • Loading branch information
jtbandes authored Oct 15, 2021
1 parent 148ca59 commit 6e57b80
Show file tree
Hide file tree
Showing 54 changed files with 169 additions and 81 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
os: ubuntu-20.04
- ros: galactic
os: ubuntu-20.04
- ros: rolling
os: ubuntu-20.04

name: ROS 2 ${{ matrix.ros }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
Expand Down
32 changes: 0 additions & 32 deletions rosapi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.5)
project(rosapi)

find_package(ament_cmake_ros REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
Expand All @@ -12,36 +10,6 @@ endif()
ament_python_install_package(
${PROJECT_NAME} PACKAGE_DIR "src/${PROJECT_NAME}")

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/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/TopicsAndRawTypes.srv
srv/TopicsForType.srv
srv/TopicType.srv
DEPENDENCIES builtin_interfaces
)

ament_export_dependencies(builtin_interfaces rosidl_default_runtime)

ament_package()

install(PROGRAMS scripts/rosapi_node
Expand Down
8 changes: 1 addition & 7 deletions rosapi/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@

<buildtool_depend>ament_cmake_ros</buildtool_depend>

<buildtool_depend>rosidl_default_generators</buildtool_depend>

<build_depend>builtin_interfaces</build_depend>

<exec_depend>rosapi_msgs</exec_depend>
<exec_depend>builtin_interfaces</exec_depend>
<exec_depend>rclpy</exec_depend>
<exec_depend>rcl_interfaces</exec_depend>
Expand All @@ -36,16 +33,13 @@
<exec_depend>rosnode</exec_depend>
<exec_depend>rosgraph</exec_depend>
-->
<exec_depend>rosidl_default_runtime</exec_depend>

<test_depend>ament_cmake_pytest</test_depend>
<test_depend>sensor_msgs</test_depend>
<test_depend>shape_msgs</test_depend>
<test_depend>geometry_msgs</test_depend>
<test_depend>rmw_dds_common</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
<ros1_bridge mapping_rules="mapping_rules.yaml"/>
Expand Down
4 changes: 2 additions & 2 deletions rosapi/scripts/rosapi_node
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ from rclpy.clock import Clock, ClockType
from rclpy.node import Node

from rosapi import glob_helper, objectutils, params, proxy
from rosapi.msg import TypeDef
from rosapi.srv import (
from rosapi_msgs.msg import TypeDef
from rosapi_msgs.srv import (
DeleteParam,
GetActionServers,
GetParam,
Expand Down
38 changes: 38 additions & 0 deletions rosapi_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.5)
project(rosapi_msgs)

find_package(ament_cmake_ros REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)

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/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/TopicsAndRawTypes.srv
srv/TopicsForType.srv
srv/TopicType.srv
DEPENDENCIES builtin_interfaces
)

ament_export_dependencies(builtin_interfaces rosidl_default_runtime)

ament_package()
File renamed without changes.
35 changes: 35 additions & 0 deletions rosapi_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<package format="3">
<name>rosapi_msgs</name>
<version>1.0.8</version>
<description>
Provides service calls for getting ros meta-information, like list of
topics, services, params, etc.
</description>

<license>BSD</license>

<url type="website">http://ros.org/wiki/rosapi</url>
<url type="bugtracker">https://github.com/RobotWebTools/rosbridge_suite/issues</url>
<url type="repository">https://github.com/RobotWebTools/rosbridge_suite</url>

<author email="[email protected]">Jonathan Mace</author>
<maintainer email="[email protected]">Jihoon Lee</maintainer>
<maintainer email="[email protected]">Jacob Bandes-Storch</maintainer>

<buildtool_depend>ament_cmake_ros</buildtool_depend>

<buildtool_depend>rosidl_default_generators</buildtool_depend>

<build_depend>builtin_interfaces</build_depend>

<exec_depend>builtin_interfaces</exec_depend>
<exec_depend>rcl_interfaces</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>
</export>
</package>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 0 additions & 29 deletions rosbridge_library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,10 @@ project(rosbridge_library)

find_package(ament_cmake_core REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)

ament_python_install_package(
${PROJECT_NAME} PACKAGE_DIR "src/${PROJECT_NAME}")

rosidl_generate_interfaces(${PROJECT_NAME}
msg/Num.msg
msg/TestChar.msg
msg/TestDurationArray.msg
msg/TestHeaderArray.msg
msg/TestHeader.msg
msg/TestHeaderTwo.msg
msg/TestTimeArray.msg
msg/TestUInt8.msg
msg/TestUInt8FixedSizeArray16.msg
srv/AddTwoInts.srv
srv/SendBytes.srv
srv/TestArrayRequest.srv
srv/TestEmpty.srv
srv/TestMultipleRequestFields.srv
srv/TestMultipleResponseFields.srv
srv/TestNestedService.srv
srv/TestRequestAndResponse.srv
srv/TestRequestOnly.srv
srv/TestResponseOnly.srv
DEPENDENCIES builtin_interfaces geometry_msgs std_msgs
)

ament_export_dependencies(rosidl_default_runtime)

ament_package()

if (BUILD_TESTING)
Expand Down
10 changes: 1 addition & 9 deletions rosbridge_library/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,15 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>builtin_interfaces</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>python3-pil</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>rosidl_default_generators</build_depend>
<build_depend>python3-bson</build_depend>

<exec_depend>builtin_interfaces</exec_depend>
<exec_depend>rclpy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>python3-pil</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<exec_depend>python3-bson</exec_depend>

<test_depend>rosbridge_test_msgs</test_depend>
<test_depend>actionlib_msgs</test_depend>
<test_depend>ament_cmake_pytest</test_depend>
<test_depend>builtin_interfaces</test_depend>
Expand All @@ -50,8 +44,6 @@
<test_depend>trajectory_msgs</test_depend>
<test_depend>visualization_msgs</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
4 changes: 2 additions & 2 deletions rosbridge_library/test/internal/test_message_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_int8_msg(rostype, data):
return inst.data

for msgtype in ["TestChar", "TestUInt8"]:
rostype = "rosbridge_library/" + msgtype
rostype = "rosbridge_test_msgs/" + msgtype

int8s = list(range(0, 256))
ret = test_int8_msg(rostype, int8s)
Expand All @@ -268,7 +268,7 @@ def test_int8_msg(rostype, data):
self.assertEqual(ret, str_int8s)

for msgtype in ["TestUInt8FixedSizeArray16"]:
rostype = "rosbridge_library/" + msgtype
rostype = "rosbridge_test_msgs/" + msgtype

int8s = list(range(0, 16))
ret = test_int8_msg(rostype, int8s)
Expand Down
36 changes: 36 additions & 0 deletions rosbridge_test_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.5)
project(rosbridge_test_msgs)

find_package(ament_cmake_core REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
msg/Num.msg
msg/TestChar.msg
msg/TestDurationArray.msg
msg/TestHeaderArray.msg
msg/TestHeader.msg
msg/TestHeaderTwo.msg
msg/TestTimeArray.msg
msg/TestUInt8.msg
msg/TestUInt8FixedSizeArray16.msg
srv/AddTwoInts.srv
srv/SendBytes.srv
srv/TestArrayRequest.srv
srv/TestEmpty.srv
srv/TestMultipleRequestFields.srv
srv/TestMultipleResponseFields.srv
srv/TestNestedService.srv
srv/TestRequestAndResponse.srv
srv/TestRequestOnly.srv
srv/TestResponseOnly.srv
DEPENDENCIES builtin_interfaces geometry_msgs std_msgs
)

ament_export_dependencies(rosidl_default_runtime)

ament_package()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions rosbridge_test_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0"?>
<package format="3">
<name>rosbridge_test_msgs</name>
<version>0.0.0</version>
<description>
Message and service definitions used in internal tests for rosbridge packages.
</description>

<license>BSD</license>

<url type="website">http://ros.org/wiki/rosbridge_library</url>
<url type="bugtracker">https://github.com/RobotWebTools/rosbridge_suite/issues</url>
<url type="repository">https://github.com/RobotWebTools/rosbridge_suite</url>

<author email="[email protected]">Jonathan Mace</author>
<maintainer email="[email protected]">Jihoon Lee</maintainer>
<maintainer email="[email protected]">Jacob Bandes-Storch</maintainer>

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>builtin_interfaces</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>rosidl_default_generators</build_depend>

<exec_depend>builtin_interfaces</exec_depend>
<exec_depend>rclpy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>

<test_depend>actionlib_msgs</test_depend>
<test_depend>ament_cmake_pytest</test_depend>
<test_depend>builtin_interfaces</test_depend>
<test_depend>diagnostic_msgs</test_depend>
<test_depend>example_interfaces</test_depend>
<test_depend>geometry_msgs</test_depend>
<test_depend>nav_msgs</test_depend>
<test_depend>sensor_msgs</test_depend>
<test_depend>std_msgs</test_depend>
<test_depend>std_srvs</test_depend>
<test_depend>stereo_msgs</test_depend>
<test_depend>tf2_msgs</test_depend>
<test_depend>trajectory_msgs</test_depend>
<test_depend>visualization_msgs</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6e57b80

Please sign in to comment.