JaviRG30 / UR5_color_pick_and_place

UR5 (Universal Robots) pick and place employing computer vision for color-based part classification. Developed using ROS Melodic, MoveIt for path planning and Gazebo for UR5 simulation.
8 stars 2 forks source link

Environment configuration issues with successful project compilation but failure to run properly. #1

Open iLoveVenki opened 1 month ago

iLoveVenki commented 1 month ago

Hello, I am very interested in the project you shared. Following the prerequisites listed in your README.md file, I attempted to replicate it on two different systems, but I was unable to achieve complete success on either. The specific details of my replication attempts are as follows:

1. First Replication Attempt (Ubuntu 18.04)

On Ubuntu18.04 LTS system,I created a new conda environment named pick_and_place_ws using Anaconda. Then, I installed the necessary dependencies within this environment. The corresponding setup commands are as follows:

setconda
conda create --name pick_and_place_ws python=2.7
conda activate pick_and_place_ws
pip install opencv-python==4.2.0.32
pip install pynput==1.4
pip install pyyaml rospkg
pip install pyassimp

The result of command "conda list":

After testing, the command roslaunch ur5_gripper_moveit_config demo_gazebo.launch starts successfully. However, both .py test scripts fail to run properly. When running rosrun ur5_simple_pick_and_place mov_fmpiec_colores.py in the terminal, the robotic arm moves to the top of the object and then stops, unable to complete the color recognition process and the program exits automatically.

The corresponding error messages are as follows:

The error messages after executing the command rosrun ur5_simple_pick_and_place manual_controller.py are as follows:

On Ubuntu 18.04, the default Python version for melodic-ros is Python2, which seems to be incompatible with PyQt5. I was unable to successfully configure the PyQt5 package on this system. I am not sure if the project's failure to run correctly is related to PyQt5. Could you provide some guidance on resolving the errors mentioned above and how to install the PyQt dependencies? Additionally, a more detailed environment setup guide would be greatly appreciated. Thank you very much.

Second Replication Attempt ( Ubuntu 20.04)

On another system running Ubuntu 20.04 LTS, I made a second attempt to replicate the project. I created a new conda environment with the following specifications: Ubuntu 20.04, Python 3.6, PyQt5.15, and ROS Noetic. The corresponding setup commands are as follows:

setconda
conda create --name pick_and_place_ws python=3.6
conda activate pick_and_place_ws
pip install opencv-python==4.3.0.36
pip install pyqt5==5.15.2
pip install pynput
pip install pyyaml rospkg
sudo apt-get install libcanberra-gtk-module
pip install pyassimp

In this testing environment, I successfully installed the PyQt5 package. The installed packages in this environment are as follows:

After running the test command rosrun ur5_simple_pick_and_place mov_fmpiec_colores.py, although the camera feed displays correctly, the robotic arm fails to initiate movement. The specific details are as follows:

The corresponding error messages in the terminal are as follows:

Could you please provide a more comprehensive environment setup instruction? For example, listing your conda list results. Thank you very much for your spirit of open-source. I wish you a happy life.

JaviRG30 commented 1 month ago

Hello @iLoveVenki, I have not tested this project on Ubuntu 20.04. Regarding the error that occurred on Ubuntu 18.04, it appears when a function of the object obj_img from the image_read class is executed. This class is within the script read_camera_image_mult.py, and it seems that this script is not able to capture or analyze the image.

When you run rosrun ur5_simple_pick_and_place mov_fmpiec_colores.py, does an OpenCV visualization window appear? If it does not appear, the error originates from that script.

Once you have launched the command roslaunch ur5_gripper_moveit_config demo_gazebo.launch, try run, rosrun ur5_simple_pick_and_place read_camera_image_mult.py. When you run that script, a window displaying the image being captured by the camera should appear. If it does not execute correctly, note the errors that appear.

I hope this project can be of help to you.

iLoveVenki commented 1 month ago

Thank you very much for your help! As you mentioned, the error on Ubuntu 18.04 is related to image recognition failure. When running rosrun ur5_simple_pick_and_place mov_fmpiec_colores.py, the OpenCV visualization window does not appear as expected. According to my Google search, this issue might be due to the dependency on the PyQt5 library for generating the visualization window. However, since ROS-Melodic on Ubuntu 18.04 defaults to using Python 2.7, I have been unsuccessful in installing the PyQt5 package on my machine. I have not yet found a good solution for configuring the PyQt5 library, and it may be due to other environment configuration issues. I will continue to try new solutions. Thank you again for your assistance!