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

Direct conversion from Python to robot language

#1
Does Robodk provide the functionality of converting the python script directly to another robot language (like ABB rapid and motoman)

Instead of this conversion, where the poses are calculated directly (upon using "Generate robot program"):
Code:
def function_convert_pose(input):
    ##
    large function
    ##
    return pose

if __name__ == "__main__":
 
    pose = function_convert_pose(input)
    robot.MoveJ(move_pose)

Code:
MODULE MOD_test_conversion
    ! -------------------------------
    ! Define customized variables here
    ! ...
    ! Tool variables:
    PERS tooldata Paintgun := [TRUE,[[50.000,0.000,450.000],[0.96592583,0.00000000,0.25881905,0.00000000]],[1,[0,0,20],[1,0,0,0],0,0,0.005]];
    ! Reference variables:
    PERS wobjdata RobotBase := [FALSE, TRUE, "", [[0.000,0.000,0.000],[1.00000000,0.00000000,0.00000000,0.00000000]],[[0,0,0],[1,0,0,0]]];
    PROC Main()
        ConfJ \On;
        ConfL \Off;
        ! Program generated by RoboDK v5.7.3 for ABB IRB 6650-125/3.2 on 13/08/2024 09:43:39
        MoveAbsJ [[54.501300,88.203300,-65.599300,-84.869600,90.461300,82.615300],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[450.00,500,5000,1000],z1,Paintgun \WObj:=RobotBase;
       
    ENDPROC
ENDMODULE


I hoped to see something like this, where just the functions are converted: 
Code:
FUNC function_convert_pose(input):
    ##
    large function
    ##
    return pose;
ENDFUNC

PROC MAIN()
    pose := function_convert_pose(input);
    MoveJ move_pose,v1000,z5,MyTool\WObj:=Workobject_2;
ENDPROC

Is this possible? and if so how?
#2
RoboDK can generate robot programs from your Python scripts when you right click a script in your project and select Generate Robot Program. The program is generated and movements created based on the logic in your Python script. Program flow control such as loops and conditions are not translated to robot code but evaluated at runtime and the corresponding programs generated.

You can find more information here:
https://robodk.com/offline-programming
#3
Thank you for your response.

The reason I asked is that I want to create a few standard programs using the RoboDK API, where not every variable and pose is defined initially. These programs would then be selected by the robot operators, who would input the remaining parameters to generate the fully defined robot program.

My intention was to create these standard programs in Python and then convert them to ABB RAPID and Inform II for Motoman, instead of writing the programs directly in those languages. Unfortunately, it seems that this functionality does not exist.

I have one remaining question, if you don't mind. In situations like the one I described, do others typically invest the time to write such programs in the robot's native language, or do they still use RoboDK—perhaps running on a server and sending back the robot program files to be executed on the robot controller? Or do they use an entirely different method?
#4
The best solution may depend on the application.

For example, you can generate the robot program offline by using the Generate Robot Program option and load it on your controller. For example, this would be suitable if you have a special algorithm to calculate a list of points to follow, or you have a large set of points to go through (such as for robot machining). You could add additional logic on your robot controller to manage the main program based on certain input from the user.

Another option would be to use the robot driver combined with the RoboDK API (Run on robot option). This allows you to to move the robot directly from your code. This is great for debugging and for more advanced applications where you need to interact with external sensors such as cameras. You would need to do the processing on a computer and drive the robot from your computer.
  




Users browsing this thread:
1 Guest(s)