【ROS】Could not import ‘rosidl_typesupport_c‘ for package xxx

After learning the tutorial of Custom msg and interfaces  in Implementing custom interfaces — ROS 2 Documentation: Humble documentation

I met this problem:

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

Specifically,everything went well until I tried "ros2 topic echo /addressbook"

【ROS】Could not import ‘rosidl_typesupport_c‘ for package xxx_第1张图片

And i googled it for solutions, i noticed that it came from my CMakelist. 

So i turned to my CMakelist, and changed the code below 

【ROS】Could not import ‘rosidl_typesupport_c‘ for package xxx_第2张图片

into this:

【ROS】Could not import ‘rosidl_typesupport_c‘ for package xxx_第3张图片

the annotated block may cause that bug,  so i just rewrite it in normal way which is under that code, "msg/AddressBook.msg", in this way, i figured it out.

你可能感兴趣的:(ROS,linux)