turtlebot / turtlebot4-user-manual

Source for the TurtleBot4 User Manual
https://turtlebot.github.io/turtlebot4-user-manual/
5 stars 14 forks source link

Run simulator but got problem of lacking diffdrive_controller and joint_state_broadcaster #1

Closed shoufei403 closed 1 year ago

shoufei403 commented 2 years ago

I follow the tutorial to run turtlebot4 simulator but failed. There is error info. I have checked if I haved installed joint_state_broadcaster and diffdrive_controller. The result is that joint_state_broadcaster is installed already, but I am not sure diffdrive_controller package is also installed. Can you help me figure this out. If you need some more detailed info, please tell me.

The cmd I run is :

ros2 launch turtlebot4_ignition_bringup ignition.launch.py
[spawner-20] Traceback (most recent call last):
[spawner-20]   File "/opt/ros/galactic/lib/python3.8/site-packages/rosidl_generator_py/import_type_support_impl.py", line 46, in import_type_support
[spawner-20]     return importlib.import_module(module_name, package=pkg_name)
[spawner-20]   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[spawner-20]     return _bootstrap._gcd_import(name[level:], package, level)
[spawner-20]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[spawner-20]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[spawner-20]   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
[spawner-20]   File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
[spawner-20]   File "<frozen importlib._bootstrap>", line 556, in module_from_spec
[spawner-20]   File "<frozen importlib._bootstrap_external>", line 1166, in create_module
[spawner-20]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[spawner-20] ImportError: /opt/ros/galactic/lib/libcontroller_manager_msgs__rosidl_generator_c.so: undefined symbol: builtin_interfaces__msg__Duration__are_equal
[spawner-20] 
[spawner-20] During handling of the above exception, another exception occurred:
[spawner-20] 
[spawner-20] Traceback (most recent call last):
[spawner-20]   File "/opt/ros/galactic/lib/controller_manager/spawner", line 20, in <module>
[spawner-20]     ret = main()
[spawner-20]   File "/opt/ros/galactic/lib/controller_manager/spawner.py", line 167, in main
[spawner-20]     if is_controller_loaded(node, controller_manager_name, controller_name):
[spawner-20]   File "/opt/ros/galactic/lib/controller_manager/spawner.py", line 110, in is_controller_loaded
[spawner-20]     controllers = list_controllers(node, controller_manager).controller
[spawner-20]   File "/opt/ros/galactic/lib/python3.8/site-packages/controller_manager/controller_manager_services.py", line 49, in list_controllers
[spawner-20]     return service_caller(node, f'{controller_manager_name}/list_controllers',
[spawner-20]   File "/opt/ros/galactic/lib/python3.8/site-packages/controller_manager/controller_manager_services.py", line 23, in service_caller
[spawner-20]     cli = node.create_client(service_type, service_name)
[spawner-20]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/node.py", line 1407, in create_client
[spawner-20]     check_is_valid_srv_type(srv_type)
[spawner-20]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/type_support.py", line 51, in check_is_valid_srv_type
[spawner-20]     check_for_type_support(srv_type)
[spawner-20]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/type_support.py", line 29, in check_for_type_support
[spawner-20]     msg_or_srv_type.__class__.__import_type_support__()
[spawner-20]   File "/opt/ros/galactic/lib/python3.8/site-packages/controller_manager_msgs/srv/_list_controllers.py", line 250, in __import_type_support__
[spawner-20]     module = import_type_support('controller_manager_msgs')
[spawner-20]   File "/opt/ros/galactic/lib/python3.8/site-packages/rosidl_generator_py/import_type_support_impl.py", line 48, in import_type_support
[spawner-20]     raise UnsupportedTypeSupport(pkg_name)
[spawner-20] rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'controller_manager_msgs'
[ign gazebo-1] [WARN 2022-5-25 10:42:44.975936140] [ignition_ros_control]:  Desired controller update period (0.001 s) is slower than the gazebo simulation period (0 s). (PreUpdate() at /tmp/binarydeb/ros-galactic-ign-ros2-control-0.4.0/src/ign_ros2_control_plugin.cpp:445)
[ERROR] [spawner-20]: process has died [pid 7532, exit code 1, cmd '/opt/ros/galactic/lib/controller_manager/spawner joint_state_broadcaster -c /controller_manager --ros-args'].
[INFO] [spawner-37]: process started with pid [8086]
[spawner-37] Traceback (most recent call last):
[spawner-37]   File "/opt/ros/galactic/lib/python3.8/site-packages/rosidl_generator_py/import_type_support_impl.py", line 46, in import_type_support
[spawner-37]     return importlib.import_module(module_name, package=pkg_name)
[spawner-37]   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[spawner-37]     return _bootstrap._gcd_import(name[level:], package, level)
[spawner-37]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[spawner-37]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[spawner-37]   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
[spawner-37]   File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
[spawner-37]   File "<frozen importlib._bootstrap>", line 556, in module_from_spec
[spawner-37]   File "<frozen importlib._bootstrap_external>", line 1166, in create_module
[spawner-37]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[spawner-37] ImportError: /opt/ros/galactic/lib/libcontroller_manager_msgs__rosidl_generator_c.so: undefined symbol: builtin_interfaces__msg__Duration__are_equal
[spawner-37] 
[spawner-37] During handling of the above exception, another exception occurred:
[spawner-37] 
[spawner-37] Traceback (most recent call last):
[spawner-37]   File "/opt/ros/galactic/lib/controller_manager/spawner", line 20, in <module>
[spawner-37]     ret = main()
[spawner-37]   File "/opt/ros/galactic/lib/controller_manager/spawner.py", line 167, in main
[spawner-37]     if is_controller_loaded(node, controller_manager_name, controller_name):
[spawner-37]   File "/opt/ros/galactic/lib/controller_manager/spawner.py", line 110, in is_controller_loaded
[spawner-37]     controllers = list_controllers(node, controller_manager).controller
[spawner-37]   File "/opt/ros/galactic/lib/python3.8/site-packages/controller_manager/controller_manager_services.py", line 49, in list_controllers
[spawner-37]     return service_caller(node, f'{controller_manager_name}/list_controllers',
[spawner-37]   File "/opt/ros/galactic/lib/python3.8/site-packages/controller_manager/controller_manager_services.py", line 23, in service_caller
[spawner-37]     cli = node.create_client(service_type, service_name)
[spawner-37]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/node.py", line 1407, in create_client
[spawner-37]     check_is_valid_srv_type(srv_type)
[spawner-37]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/type_support.py", line 51, in check_is_valid_srv_type
[spawner-37]     check_for_type_support(srv_type)
[spawner-37]   File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/type_support.py", line 29, in check_for_type_support
[spawner-37]     msg_or_srv_type.__class__.__import_type_support__()
[spawner-37]   File "/opt/ros/galactic/lib/python3.8/site-packages/controller_manager_msgs/srv/_list_controllers.py", line 250, in __import_type_support__
[spawner-37]     module = import_type_support('controller_manager_msgs')
[spawner-37]   File "/opt/ros/galactic/lib/python3.8/site-packages/rosidl_generator_py/import_type_support_impl.py", line 48, in import_type_support
[spawner-37]     raise UnsupportedTypeSupport(pkg_name)
[spawner-37] rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'controller_manager_msgs'
[ERROR] [spawner-37]: process has died [pid 8086, exit code 1, cmd '/opt/ros/galactic/lib/controller_manager/spawner diffdrive_controller -c /controller_manager --ros-args --params-file /workspaces/turtlebot4_ws/install/share/irobot_create_control/config/control.yaml'].

By the way, I wonder how to download the model which is used in the sdf file.

<?xml version="1.0"?>
<sdf version="1.6">
  <world name="depot">
    <scene>
      <grid>false</grid>
    </scene>
    <physics name="1ms" type="ignored">
      <max_step_size>0.002</max_step_size>
      <real_time_factor>1.0</real_time_factor>
    </physics>
    <plugin filename="ignition-gazebo-physics-system" name="ignition::gazebo::systems::Physics"></plugin>
    <plugin filename="ignition-gazebo-user-commands-system" name="ignition::gazebo::systems::UserCommands"></plugin>
    <plugin filename="ignition-gazebo-scene-broadcaster-system" name="ignition::gazebo::systems::SceneBroadcaster"></plugin>

    <include>
      <uri>
        https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Depot
      </uri>
    </include>

  </world>
</sdf>

Because the network is not good in my place. I have to download it at first. But I don't kown how to do that. Maybe you can tell me.