小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
9.自定义接口RCLPY实战 错误
-
(base) ➜ src ros2 run example_interfaces_rclpy example_interfaces_control_02
[INFO] [1714230625.945848692] [example_interfaces_control_02]: 节点已启动:example_interfaces_control_02!
Traceback (most recent call last):
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/import_type_support_impl.py", line 46, in import_type_support
return importlib.import_module(module_name, package=pkg_name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'example_ros2_interfaces.example_ros2_interfaces_s__rosidl_typesupport_c'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zhuohang/Documents/ros/pro4/src/install/example_interfaces_rclpy/lib/example_interfaces_rclpy/example_interfaces_control_02", line 33, in <module>
sys.exit(load_entry_point('example-interfaces-rclpy==0.0.0', 'console_scripts', 'example_interfaces_control_02')())
File "/home/zhuohang/Documents/ros/pro4/src/install/example_interfaces_rclpy/lib/python3.10/site-packages/example_interfaces_rclpy/example_interfaces_control_02.py", line 33, in main
node = ExampleInterfacesControl02("example_interfaces_control_02") # 新建一个节点
File "/home/zhuohang/Documents/ros/pro4/src/install/example_interfaces_rclpy/lib/python3.10/site-packages/example_interfaces_rclpy/example_interfaces_control_02.py", line 12, in init
self.client_ = self.create_client(MoveRobot,"move_robot")
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/node.py", line 1413, in create_client
check_is_valid_srv_type(srv_type)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/type_support.py", line 51, in check_is_valid_srv_type
check_for_type_support(srv_type)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/type_support.py", line 29, in check_for_type_support
msg_or_srv_type.class.import_type_support()
File "/home/zhuohang/Documents/ros/pro4/src/install/example_interfaces_rclpy/lib/python3.10/site-packages/example_ros2_interfaces/srv/_move_robot.py", line 268, in import_type_support
module = import_type_support('example_ros2_interfaces')
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/import_type_support_impl.py", line 48, in import_type_support
raise UnsupportedTypeSupport(pkg_name)
rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'example_ros2_interfaces'
[ros2run]: Process exited with failure 1
以上为错误信息,主要是想问一下那个example_ros2_interfaces包怎么引入,放在哪里,包里面有什么东西,这个包生成是按照7.ROS2接口介绍这个完成的,然后换了一个文件夹,就不知道应该放哪里,包要放什么东西了。
-
我也一样
怎么解决的