Could not import 'rosidl_typesupport_c' for package 'gazebo_msgs'

ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
[INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2022-07-01-12-34-13-162138-WALKING-8253
[INFO] [launch]: Default logging verbosity is set to INFO
urdf_file_name : turtlebot3_burger.urdf
[INFO] [gzserver-1]: process started with pid [8571]
[INFO] [gzclient   -2]: process started with pid [8573]
[INFO] [robot_state_publisher-3]: process started with pid [8575]
[INFO] [spawn_entity.py-4]: process started with pid [8577]
[robot_state_publisher-3] Link base_link had 5 children
[robot_state_publisher-3] Link caster_back_link had 0 children
[robot_state_publisher-3] Link imu_link had 0 children
[robot_state_publisher-3] Link base_scan had 0 children
[robot_state_publisher-3] Link wheel_left_link had 0 children
[robot_state_publisher-3] Link wheel_right_link had 0 children
[robot_state_publisher-3] [INFO] [1656650056.701813075] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-3] [INFO] [1656650056.701987934] [robot_state_publisher]: got segment base_link
[robot_state_publisher-3] [INFO] [1656650056.702026175] [robot_state_publisher]: got segment base_scan
[robot_state_publisher-3] [INFO] [1656650056.702050911] [robot_state_publisher]: got segment caster_back_link
[robot_state_publisher-3] [INFO] [1656650056.702072528] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-3] [INFO] [1656650056.702091612] [robot_state_publisher]: got segment wheel_left_link
[robot_state_publisher-3] [INFO] [1656650056.702129581] [robot_state_publisher]: got segment wheel_right_link
[spawn_entity.py-4] [INFO] [1656650057.745691485] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1656650057.746370781] [spawn_entity]: Loading entity XML from file /home/ubuntu/ros2_tb3_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/models/turtlebot3_burger/model.sdf
[spawn_entity.py-4] [INFO] [1656650057.747845588] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5
[spawn_entity.py-4] [INFO] [1656650057.748436963] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-4] Traceback (most recent call last):
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/python3.8/site-packages/rosidl_generator_py/import_type_support_impl.py", line 46, in import_type_support
[spawn_entity.py-4]     return importlib.import_module(module_name, package=pkg_name)
[spawn_entity.py-4]   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[spawn_entity.py-4]     return _bootstrap._gcd_import(name[level:], package, level)
[spawn_entity.py-4]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[spawn_entity.py-4]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[spawn_entity.py-4]   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
[spawn_entity.py-4]   File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
[spawn_entity.py-4]   File "<frozen importlib._bootstrap>", line 556, in module_from_spec
[spawn_entity.py-4]   File "<frozen importlib._bootstrap_external>", line 1166, in create_module
[spawn_entity.py-4]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[spawn_entity.py-4] ImportError: /opt/ros/galactic/lib/libstd_msgs__rosidl_generator_c.so: undefined symbol: builtin_interfaces__msg__Time__copy
[spawn_entity.py-4] 
[spawn_entity.py-4] During handling of the above exception, another exception occurred:
[spawn_entity.py-4] 
[spawn_entity.py-4] Traceback (most recent call last):
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/gazebo_ros/spawn_entity.py", line 365, in <module>
[spawn_entity.py-4]     main()
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/gazebo_ros/spawn_entity.py", line 360, in main
[spawn_entity.py-4]     exit_code = spawn_entity_node.run()
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/gazebo_ros/spawn_entity.py", line 223, in run
[spawn_entity.py-4]     success = self._spawn_entity(entity_xml, initial_pose, self.args.spawn_service_timeout)
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/gazebo_ros/spawn_entity.py", line 270, in _spawn_entity
[spawn_entity.py-4]     client = self.create_client(SpawnEntity, '%s/spawn_entity' % self.args.gazebo_namespace)
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/node.py", line 1409, in create_client
[spawn_entity.py-4]     check_is_valid_srv_type(srv_type)
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/type_support.py", line 51, in check_is_valid_srv_type
[spawn_entity.py-4]     check_for_type_support(srv_type)
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/type_support.py", line 29, in check_for_type_support
[spawn_entity.py-4]     msg_or_srv_type.__class__.__import_type_support__()
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/python3.8/site-packages/gazebo_msgs/srv/_spawn_entity.py", line 355, in __import_type_support__
[spawn_entity.py-4]     module = import_type_support('gazebo_msgs')
[spawn_entity.py-4]   File "/opt/ros/galactic/lib/python3.8/site-packages/rosidl_generator_py/import_type_support_impl.py", line 48, in import_type_support
[spawn_entity.py-4]     raise UnsupportedTypeSupport(pkg_name)
[spawn_entity.py-4] rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'gazebo_msgs'
[ERROR] [spawn_entity.py-4]: process has died [pid 8577, exit code 1, cmd '/opt/ros/galactic/lib/gazebo_ros/spawn_entity.py -entity burger -file /home/ubuntu/ros2_tb3_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/models/turtlebot3_burger/model.sdf -x -2.0 -y -0.5 -z 0.01 --ros-args'].
[gzserver-1] Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.
[INFO] [gzclient   -2]: process has finished cleanly [pid 8573]
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-3] [INFO] [1656663677.727885686] [rclcpp]: signal_handler(signal_value=2)
[INFO] [robot_state_publisher-3]: process has finished cleanly [pid 8575]
[INFO] [gzserver-1]: process has finished cleanly [pid 8571]
已邀请:

ncnynl

赞同来自:

经过搜索,大致有这些可参考的链接
 
Could not import 'rosidl_typesupport_c' for package 'sensor_msgs'
https://stackoverflow.com/ques ... on-na
https://blog.csdn.net/qq_27865 ... 51587
https://answers.ros.org/questi ... -msg/
https://github.com/ros2/common ... 23L54
https://get-help.robotigniteac ... 76/17
https://github.com/ros-drivers ... /ros2

 
 
问题在于gazebo_msgs包,缺少加入依赖包,看报错信息,应该是少了
builtin_interfaces
 
[spawn_entity.py-4] ImportError: /opt/ros/galactic/lib/libstd_msgs__rosidl_generator_c.so: undefined symbol: builtin_interfaces__msg__Time__copy

那解决的方法就是下载源码,增加依赖,重新编译一下gazebo_msgs了
 
 
git clone -b galactic https://github.com/ros-simulation/gazebo_ros_pkgs
 
 
 
 

要回复问题请先登录注册