Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UR5 Online Programming Python API Issue

I am attempting to program a UR5 CB3 to trace a trajectory specified by a python program inserted as a program call into a robot program in my station tree. When running the program online (directly connected to the UR5 over Cat6 ethernet from my laptop to the ur5 controller) it follows the trajectory fine. 

If I attempt to also run a joint monitoring macro however, the UI and connection to the robot becomes somewhat unresponsive and it only collects joint data when the robot briefly stops during the trajectory. Is this a bandwidth issue when communicating to the UR5 while also monitoring joint positions?

I also attempted to upload the robot program as a .script file to the teach pendant to trace the trajectory and it wasn't able to work with the inserted python code. I was hoping to run the script off of the teach pendant and just monitor the joints through a live connection using the python API if that is possible?

I am using RoboDK v 5.2.5 and python 3.7.4

I emulated what i was doing using the following .rdk file for reference

Thanks for any advice.

Attached Files
.rdk   UR5_LiveTest.rdk (Size: 3.33 MB / Downloads: 20)
If you are running a program on the real robot from RoboDK (either using the UI or the API) and you use the Joints function (robot.Joints), it will trigger a driver command to request robot joints from the real robot and place the simulated in the same position. This will force to stop any running programs. Somehow, this similar a similar behavior to robot.setJoints() because you are connected to the real robot.

Instead, you can retrieve the the robot joints you have in the simulator by calling SimulatorJoints. The only difference between Joints and SimulatorJoints is that the second one always gives you the joints in the RoboDK simulation and never stops running programs if you are connected to your robot.
Hi Albert,

Thanks for this. So in general if I am looking to compare a simulated trajectory to the same trajectory being followed by the real robot with respect to time, I can easily record the offline simulated joints. However when attempting to record the real joints, I am connected to the robot and could record the simulator's joint data by calling SimulatorJoints. Is the simulators joint data updated in real time based off the UR5 driver when connected to the robot? Otherwise it wouldn't be a valid comparison.

The API docs specifically mention to use robot.Joints() to retrieve real and simulated robot position when connected. Thanks again for any clarification.

Users browsing this thread:
1 Guest(s)