03-16-2022, 04:07 PM
Hi
I just picked up RoboDK last week and have been working hard experimenting with the python API trying to get some basics down but there's something I don't quite understand. It might just be a limitation of the software or it is me not understanding how to use the postprocessor.
I want to use RoboDK for offline programming of my UR robot setup. I then want to transfer my code to the robot and have it run with minimal overhead of work on the online robot side. I'd rather do more work offline just to have it work online as easily as possible.
So on to my program:
In my program I want to generate I bunch of targets in a grid layout. The size of the grid is calculated from an input variable string that is sent to the robot at runtime. (The robot reads a qr code where the grid data is stored). This means that the target points are not known ahead of time.
My naive "solution":
Great I have python, I thought, so I quickly wrote up a python function that takes an input string and spits out the points and moves the robot around and everything works in the simulation where I pass the string to the python function using call arguments.
The issue:
The point where I don't understand RoboDK anymore is when I generate the robot program the compiled robot program has none of the python code in it and there is just a line with a call the my python program that looks something like "move_grid(""). So from this I gather that the python program cannot be translate automatically to UR-scripts.
如果我试着direc生成机器人程序tly from my python script (with a call to the function at the end of the file) the output file is just a bunch of points not depended on my input variable anymore. My functions are not respected and are not there anymore and it just spits out the points.
Is there any way that RoboDK can be set up so it spits out my functions or worst case a place to manually write the UR scripts that should be inserted into the code instead of the functions calls so I can get the full program for the UR-robot.
I Hope someone can help me. So far RoboDK have been great for setting up the simulated world, but now writing code for it feels a bit limited. It feels like I'd have to rewrite the whole program on the teach pendant anyway.
I just picked up RoboDK last week and have been working hard experimenting with the python API trying to get some basics down but there's something I don't quite understand. It might just be a limitation of the software or it is me not understanding how to use the postprocessor.
I want to use RoboDK for offline programming of my UR robot setup. I then want to transfer my code to the robot and have it run with minimal overhead of work on the online robot side. I'd rather do more work offline just to have it work online as easily as possible.
So on to my program:
In my program I want to generate I bunch of targets in a grid layout. The size of the grid is calculated from an input variable string that is sent to the robot at runtime. (The robot reads a qr code where the grid data is stored). This means that the target points are not known ahead of time.
My naive "solution":
Great I have python, I thought, so I quickly wrote up a python function that takes an input string and spits out the points and moves the robot around and everything works in the simulation where I pass the string to the python function using call arguments.
The issue:
The point where I don't understand RoboDK anymore is when I generate the robot program the compiled robot program has none of the python code in it and there is just a line with a call the my python program that looks something like "move_grid("
如果我试着direc生成机器人程序tly from my python script (with a call to the function at the end of the file) the output file is just a bunch of points not depended on my input variable anymore. My functions are not respected and are not there anymore and it just spits out the points.
Is there any way that RoboDK can be set up so it spits out my functions or worst case a place to manually write the UR scripts that should be inserted into the code instead of the functions calls so I can get the full program for the UR-robot.
I Hope someone can help me. So far RoboDK have been great for setting up the simulated world, but now writing code for it feels a bit limited. It feels like I'd have to rewrite the whole program on the teach pendant anyway.