Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

rosidl_generator_py UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package

I've used awslabs/ros2-migration-tools to convert a ROS1 package (namely, vision_msgs) into a ROS2 package with the same name for use on my Robot.

Note: I am running multi-distro, dashing and melodic. Dashing setup is sourced when the below occurs.

Build was successful, the messages do show under ros2 msg list.
I'm now stuck trying to import the messages into Python. Where the following error occurs:

rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'vision_msgs'

The below is my CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(vision_msgs)

# Add support for C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

find_package(ament_cmake REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(geometry_msgs REQUIRED)
set(INCLUDE_DIRS ${ament_cmake_INCLUDE_DIRS} ${std_msgs_INCLUDE_DIRS}
  ${sensor_msgs_INCLUDE_DIRS} ${rosidl_default_generators_INCLUDE_DIRS}
  ${geometry_msgs_INCLUDE_DIRS})
include_directories(${INCLUDE_DIRS})
set(LIBRARY_DIRS ${ament_cmake_LIBRARIES} ${std_msgs_LIBRARIES}
  ${sensor_msgs_LIBRARIES} ${rosidl_default_generators_LIBRARIES}
  ${geometry_msgs_LIBRARIES})
set(LIBS ${ament_cmake_LIBRARIES} ${std_msgs_LIBRARIES} ${sensor_msgs_LIBRARIES}
  ${rosidl_default_generators_LIBRARIES} ${geometry_msgs_LIBRARIES})
rosidl_generate_interfaces(${PROJECT_NAME} "msg/BoundingBox2D.msg" "msg/BoundingBox3D.msg" "msg/Classification2D.msg"
  "msg/Classification3D.msg" "msg/Detection2DArray.msg" "msg/Detection2D.msg"
  "msg/Detection3DArray.msg" "msg/Detection3D.msg" "msg/ObjectHypothesis.msg"
  "msg/ObjectHypothesisWithPose.msg" "msg/VisionInfo.msg"
  DEPENDENCIES std_msgs sensor_msgs geometry_msgs)

install(DIRECTORY include/${PROJECT_NAME}/
  DESTINATION include/${PROJECT_NAME}
  FILES_MATCHING
  PATTERN "*.h")

if(CATKIN_ENABLE_TESTING)
  add_subdirectory(test)
endif()

ament_export_dependencies(ament_cmake)
ament_export_dependencies(std_msgs)
ament_export_dependencies(sensor_msgs)
ament_export_dependencies(rosidl_default_generators)
ament_export_dependencies(geometry_msgs)
ament_export_include_directories(${INCLUDE_DIRS})

ament_package()

Am I missing something which is resulting in insufficient type support?