1
$\begingroup$

I've been trying to establish communication between 2 nodes and shared library .so. Encountered an error:

Packages installing interfaces must include '<member_of_group>rosidl_interface_packages</member_of_group>' in their package.xml Call Stack (most recent call first): CMakeLists.txt:24 (rosidl_generate_interfaces)

my CMakeLists.txt:

    cmake_minimum_required(VERSION 3.5)
project(parameter_subscriber)

# Default to C99
if(NOT CMAKE_C_STANDARD)
  set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
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(-Wall -Wextra -Wpedantic)
endif()

# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rosidl_default_generators REQUIRED)

# Generate messages
rosidl_generate_interfaces(${PROJECT_NAME}
  "msg/Parameters.msg"
)

# Add executable
add_executable(subscriber src/subscriber.cpp)
ament_target_dependencies(subscriber rclcpp)
rosidl_target_interfaces(subscriber ${PROJECT_NAME} "rosidl_typesupport_cpp")

# Specify the path to the shared library
set(LIBBEBOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../libbebot.so")

# Link the shared library
target_link_libraries(subscriber ${LIBBEBOT_PATH})

install(TARGETS
  subscriber
  DESTINATION lib/${PROJECT_NAME})

ament_export_dependencies(rosidl_default_runtime)

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()

my package.xml:

<?xml version="1.0"?>
<package format="3">
  <name>parameter_subscriber</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>

  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <build_depend>rosidl_default_generators</build_depend>
  <exec_depend>rosidl_default_runtime</exec_depend>
  <build_depend>rclcpp</build_depend>
  <exec_depend>rclcpp</exec_depend>
  
  <test_depend>ament_lint_auto</test_depend>
  <test_depend>ament_lint_common</test_depend>

  <export>
    <build_type>ament_cmake</build_type>
    <member_of_group>rosidl_interface_packages</member_of_group>
  </export>
</package>

What can be an issue here? Thank you for your time!

$\endgroup$
0

2 Answers 2

0
$\begingroup$

The <member_of_group> tag should be at the top level not inside the <exports> tag.

The format spec is here: https://ros.org/reps/rep-0149.html#group-dependencies-and-memberships

For example:

https://github.com/ros2/geometry2/blob/381d381739d008f83c2ebdf39034d46a19ea364e/tf2_msgs/package.xml#L29

$\endgroup$
1
  • $\begingroup$ thank you very much! $\endgroup$
    – Vladimir
    Commented May 20 at 15:38
0
$\begingroup$

The error message says:

Packages installing interfaces must include '<member_of_group>rosidl_interface_packages</member_of_group>' in their package.xml Call Stack (most recent call first): CMakeLists.txt:24 (rosidl_generate_interfaces)

You do have <member_of_group>rosidl_interface_packages</member_of_group> in your package.xml, but it's in the wrong place. It should not be inside <export>...</export>. It should be:

<?xml version="1.0"?>
<package format="3">
  <name>parameter_subscriber</name>
  <version>0.0.0</version>
  <description>TODO: Package description</description>

  <license>TODO: License declaration</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <build_depend>rosidl_default_generators</build_depend>
  <exec_depend>rosidl_default_runtime</exec_depend>
  <build_depend>rclcpp</build_depend>
  <exec_depend>rclcpp</exec_depend>
  
  <test_depend>ament_lint_auto</test_depend>
  <test_depend>ament_lint_common</test_depend>

  <member_of_group>rosidl_interface_packages</member_of_group>

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

Edit: well, Tully beat me by 1 minute!

$\endgroup$
1
  • $\begingroup$ thank you for your help! $\endgroup$
    – Vladimir
    Commented May 20 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.