Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Physical Robot Does Not Move When Using Ultralytics YOLO in RoboDK Python Script

#1
Hello everyone,

I am currently working on a project in RoboDK involving two JAKA collaborative robots (Zu7 and Zu12). I am using a Python script in RoboDK to control the robots and integrate a real-time vision system using a USB webcam and a YOLO11n model.

My robot movement program works correctly and the physical robots move as expected when I run the script without the YOLO/Ultralytics import.

However, when I add:
Code:
from ultralytics import YOLO

the RoboDK simulation continues to work, but the physical robots do not move. Interestingly, if I comment out the Ultralytics import, the physical robot movement works again.

I am using:
  • RoboDK
  • Python 3.10.11
  • Ultralytics 
  • OpenCV 
  • YOLO11n
  • JAKA Zu7 and Zu12
The Ultralytics package is installed in the same Python virtual environment used by RoboDK, and importing YOLO works successfully in a standalone Python test.

My intended workflow is:
  • Move the robots to predefined positions using RoboDK.
  • Start the webcam-based YOLO11n vision system.
  • Detect the needle and gripper states.
  • Based on the detection, continue the robot movement sequence.
  • Execute the same sequence on the physical JAKA robots.
The main issue is that the RoboDK simulation executes the movements, but the physical robot does not move when Ultralytics is imported.
  • Could the Ultralytics/PyTorch libraries interfere with RoboDK's physical robot driver, Python execution, or communication with the robot?
  • Is there a recommended way to run YOLO/OpenCV vision processing alongside RoboDK's physical robot control without preventing the robot driver from executing?
  • Would it be better to run the vision processing in a separate Python process/thread and communicate the detection result to the RoboDK script?

Any guidance on how to diagnose this issue would be greatly appreciated. See the attached code file for reference.
Thank you.


Attached Files
.txt   Complete Code.txt (Size: 17.49 KB / Downloads: 12)
#2
I understand that if you comment that import line, the robot movements work. Can you confirm?
Are you running the most up to date version for each library?

If that's the case, this could be an issue with timeouts or a conflict with Python imports. When you import a module, Python looks at the __init__.py folder. I'm not familiar with ultralytics but I would start looking at what happens with this import:
https://github.com/ultralytics/ultralyti..._init__.py
#3
It worked when I put import YOLO commad after initial Robot movement commands. Maybe there was some delay or obstruction that was not allowing robot movement.
#4
Great, thank you for letting us know.
  




Users browsing this thread:
1 Guest(s)