IFRA-Cranfield / ros2_RobotSimulation

ROS2.0 Foxy and Humble repositories which provide ready-to-use ROS2.0 Gazebo + MoveIt!2 simulation packages for different Industrial and Collaborative Robots.
Apache License 2.0
149 stars 43 forks source link

No module finding named 'ros2_data.ros2_data_s__rosidl_typesupport_c' #15

Open UK-Roy opened 11 months ago

UK-Roy commented 11 months ago

Hello IFRA team,

I wanted to experiment with your repository for leveraging the Gazebo & moveit setup for the panda robot that you have available in order to use it in some Reinforcement Learning experiments. I'm running Linux Ubuntu 20.04 LTS. I have followed the instructions you have on the .readme on how to install this package. I have clone your repository to the 'src' folder of my 'dev_ws'. However during running the I received the following error:

Command:

ros2 run ros2_execution ros2_execution.py --ros-args -p PROGRAM_FILENAME:="ur3irb120" -p ROBOT_MODEL:="panda" -p EE_MODEL:="panda_hand"

The following error:

--- Cranfield University --- 
        (c) IFRA Group        

ros2_RobotSimulation --> SEQUENCE EXECUTION
Python script -> ros2_execution.py

[INFO] [1690900711.519940725] [ros2_program_param]: PROGRAM_FILENAME ROS2 Parameter received: ur3irb120
[INFO] [1690900711.525283856] [ros2_robot_param]: ROBOT_MODEL ROS2 Parameter received: panda
[INFO] [1690900711.529714262] [ros2_ee_param]: EE_MODEL ROS2 Parameter received: panda_hand

Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-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.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'ros2_data.ros2_data_s__rosidl_typesupport_c'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/uk_roy/dev_ws/install/ros2_execution/lib/ros2_execution/ros2_execution.py", line 1251, in <module>
    main()
  File "/home/uk_roy/dev_ws/install/ros2_execution/lib/ros2_execution/ros2_execution.py", line 716, in main
    MoveJs_CLIENT = MoveJsclient()
  File "/home/uk_roy/dev_ws/install/ros2_execution/lib/ros2_execution/ros2_execution.py", line 117, in __init__
    self._action_client = ActionClient(self, MoveJs, 'MoveJs')
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/action/client.py", line 148, in __init__
    check_for_type_support(action_type)
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/type_support.py", line 29, in check_for_type_support
    msg_type.__class__.__import_type_support__()
  File "/home/uk_roy/dev_ws/install/ros2_data/lib/python3.10/site-packages/ros2_data/action/_move_js.py", line 1191, in __import_type_support__
    module = import_type_support('ros2_data')
  File "/opt/ros/foxy/lib/python3.8/site-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 'ros2_data'
Exception ignored in: <function ActionClient.__del__ at 0x7f4971b40f70>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/action/client.py", line 605, in __del__
    self.destroy()
  File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/action/client.py", line 596, in destroy
    if self._client_handle is None:
AttributeError: 'ActionClient' object has no attribute '_client_handle'

How could I overcome this issue? Thank you very much in advance for your valuable help!

Kind regards, UK Roy

MikelBueno commented 11 months ago

Hi @UK-Roy,

ModuleNotFoundError: No module named 'ros2_data.ros2_data_s__rosidl_typesupport_c'

This error is related to the ros2_data ROS2 Package, which may not be correctly installed (compiled) in your machine. Could you please re-build it, and try again?

Regards, Mikel, IFRA-Cranfield

UK-Roy commented 11 months ago

Thanks for the response. I could not find any installation process for ros2_data as well as there is no package in the apt package manager tool. If you provide me the instruction to re-build process, I will be grateful.

Kind regards, UK Roy

MikelBueno commented 11 months ago

Hi @UK-Roy, The ros2_data package is part of the ros2_RobotSimulation bundle (you should have it installed already). I would try to re-install it, by simply doing:

  1. Remove the ros2_data folders inside the ~/dev_ws/build and ~/dev_ws/install folders.
  2. Colcon build the workspace again.

Regards, Mikel, IFRA-Cranfield

UK-Roy commented 11 months ago

Hi @Mikel, IFRA-Cranfield, I tried at the above steps you mentioned as well as I also tried to build from scratch. But the issue remains same.

Then I tried to simulate any robot in gazebo, but it is not showing in gazebo but in rviz. For example I tried to execute this command: Screenshot from 2023-08-15 15-05-04

But the result show s like below: Screenshot from 2023-08-15 15-05-38

How to overcome this kind of issues.

Regards, UK-Roy

MikelBueno commented 11 months ago

Hi @UK-Roy, In the second picture you've shared there's a "No module named rclpy._rclpy" message, which I believe is generated because your ROS2 is not installed properly. rclpy is the ROS2 client library for Python, which should be installed within your ROS2 machine. Can you execute any other ROS2/Python node (publisher/subscriber, for example)? I believe you'll need to re-install ROS2. Regards, Mikel, IFRA-Cranfield

UK-Roy commented 11 months ago

Hi @MikelBueno, I have re-installed ROS2 and also tried simple subscriber and publisher in the same workspace where this package is located. Thats simple python files are working. But still ros2_RobotSimulation pkg is facing same issues. Below simple subscriber and publisher code Screenshot from 2023-08-15 22-51-27 and output: Screenshot from 2023-08-15 22-50-44

But ros2_RobotSimulation pkg is not working Screenshot from 2023-08-15 22-39-15 It is appearing in rViz2 but not at gazebo Regards, UK-Roy