jeguzzi / robomaster_ros

ROS2 for DJI Robomaster EP and S1
https://jeguzzi.github.io/robomaster_ros
MIT License
54 stars 10 forks source link

Can't launch ep.launch or s1.launch #7

Closed zhuhaier1992 closed 11 months ago

zhuhaier1992 commented 11 months ago

Hi Jeguzzi, I have successfully built robomaster_ros on several newly installed Ubuntu20, but every one failed to launch (the last step) with one exactly same error msg. The error goes like this: pkg_resources.DistributionNotFound: The 'robomaster' distribution was not found and is required by robomaster-ros

The whole log are as follows:

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robomaster_driver-1]: process started with pid [21770]
[INFO] [robot_state_publisher-2]: process started with pid [21772]
[INFO] [joint_state_publisher-3]: process started with pid [21774]
[robot_state_publisher-2] Link chassis_base_link had 8 children
[robot_state_publisher-2] Link front_hit_sensor_link had 1 children
[robot_state_publisher-2] Link front_led_link had 0 children
[robot_state_publisher-2] Link front_left_wheel_link had 0 children
[robot_state_publisher-2] Link front_right_wheel_link had 0 children
[robot_state_publisher-2] Link left_hit_sensor_link had 1 children
[robot_state_publisher-2] Link left_led_link had 0 children
[robot_state_publisher-2] Link rear_hit_sensor_link had 1 children
[robot_state_publisher-2] Link rear_led_link had 0 children
[robot_state_publisher-2] Link rear_left_wheel_link had 0 children
[robot_state_publisher-2] Link rear_right_wheel_link had 0 children
[robot_state_publisher-2] Link right_hit_sensor_link had 1 children
[robot_state_publisher-2] Link right_led_link had 0 children
[robot_state_publisher-2] Link gimbal_base_link had 1 children
[robot_state_publisher-2] Link gimbal_link had 3 children
[robot_state_publisher-2] Link blaster_link had 3 children
[robot_state_publisher-2] Link camera_link had 1 children
[robot_state_publisher-2] Link camera_optical_link had 0 children
[robot_state_publisher-2] Link intelligent_controller_link had 0 children
[robot_state_publisher-2] Link speaker_link had 0 children
[robot_state_publisher-2] Link gimbal_left_led_link had 0 children
[robot_state_publisher-2] Link gimbal_right_led_link had 0 children
[robomaster_driver-1] Traceback (most recent call last):
[robomaster_driver-1]   File "/home/zhe/code/rm_ws/install/robomaster_ros/lib/robomaster_ros/robomaster_driver", line 6, in <module>
[robomaster_driver-1]     from pkg_resources import load_entry_point
[robomaster_driver-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3254, in <module>
[robomaster_driver-1]     def _initialize_master_working_set():
[robomaster_driver-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3237, in _call_aside
[robomaster_driver-1]     f(*args, **kwargs)
[robomaster_driver-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3266, in _initialize_master_working_set
[robomaster_driver-1]     working_set = WorkingSet._build_master()
[robomaster_driver-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 584, in _build_master
[robomaster_driver-1]     ws.require(__requires__)
[robomaster_driver-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 901, in require
[robomaster_driver-1]     needed = self.resolve(parse_requirements(requirements))
[robomaster_driver-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 787, in resolve
[robomaster_driver-1]     raise DistributionNotFound(req, requirers)
[robomaster_driver-1] pkg_resources.DistributionNotFound: The 'robomaster' distribution was not found and is required by robomaster-ros

But I have definitely installed RoboMaster-SDK as instructed in README.md. However, I was using latest miniconda3, and create an env called py38, and I have activated this env to execute all building and launch procedures, I wonder if this could cause the problem.

jeguzzi commented 11 months ago

robomaster is the Python package installed by RoboMaster-SDK. In your case, it seems that the Python version used by ROS2, which if you installed ROS2 with a package manager is the default system Python, cannot find this package. I would guess that the problem is in the interaction between miniconda and ROS2 (see https://docs.ros.org/en/iron/How-To-Guides/Using-Python-Packages.html), which I don't have experience with. I suggest to install RoboMaster-SDK with the system Python, if ROS2 is indeed using it.

zhuhaier1992 commented 11 months ago

Man you are my savior. I am really new to this and the network here is like ... could creating any kind of problems. Almost feel desperate. Thanks a lot :D