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

Import targets from a file to a program simulation

#1
Is it possible to import targets in RoboDK to create a simulation and robot programs?

I was thinking to generate some kind of file with target information (Cartesian coordinates) which I could import into RoboDK software.

This way I can generate targets to easily load them into RoboDK and automate the process of creating targets.
#2
You can import a list of points as XYZ coordinates by following these steps:
  1. Select Utilities-Import points.
  2. Select the file with XYZ coordinates. You can optionally provide the IJk vector that defines the direction of approach. The file you use to import can be a Text file (TXT extension) or CSV file (comma separated values).
You can then create a point follow project to create a program to move the robot along these points. You can find more information about how to create a pointfollow project here:
https://robodk.com/doc/en/Robot-Machinin...ointFollow

You can import a curve as a list of XYZ coordinates by following these steps:
  1. Select Utilities-Import curve.
  2. Select the file with the XYZ coordintes. You can also optionally provide the IJk vector that defines the direction of approach. The file you use to import can be a Text file (TXT extension) or CSV file (comma separated values).
You can then create a curve follow project to create a program to move the robot along this curve. You can find more information about ho to create a curve follow project here:
https://robodk.com/doc/en/Robot-Machinin...urveFollow

Also, I attached an example project that allows importing a list of points in RoboDK, automatically creating targets for each of the points and a program. The targets are created on the "Path Reference" coordinate system and it allows you to adjust the position of your targets.
Example-LoadPoints.png   


Attached Files
.zip   Example-LoadPoints-Camera.zip (Size: 1.64 MB / Downloads: 1,141)
#3
How would a Python script look like if I want to import a file as a curve or a list of points to create targets in RoboDK? I understand I would need to use the RoboDK API for Python.
#4
The following examples are Python scripts that use the RoboDK API and allow you to customize how you load targets and create programs:
  • How to load a CSV file (comma separated values with XYZ coordinates) to create targets and a robot simulation. Optionally, you can specify the speed in the 4th column of the CSV file to set the robot speed. The orientation is kept constant given the start position of the robot:
    https://robodk.com/doc/en/PythonAPI/exam...rogram-xyz
  • How to load a list of targets from pose data (XYZWPR, XYZ cordinates and WPR Euler angles) and create a program for simulation purposes and robot programming:
    https://robodk.com/doc/en/PythonAPI/exam...ram-xyzwpr
Example-Load-XYZWPR.png   
#5
Hi Albert, I have a similar question and came across this solution. Is it possible for me to import in a format of XYZIJK (vector, P1X P1Y P1Z N1X N1Y N1Z) instead of XYZWPR (euler angles)?
#6
You can customize the import script to use the XYZijk format instead of the Euler format.

You can take a look at the script ImportCSV_XYZWPR and customize the function xyzwpr_to_pose:
https://robodk.com/doc/en/PythonAPI/exam...ram-xyzwpr
#7
Hi Albert, we have tried to customize the script to Euler format using the same equations you have in the PythonAPI, but it looks like the direction is always opposite of the defined z-axis of the tool head (and also opposite direction of the z-axis of the path itself).

Here you can see that the white lines (arrows pointing downwards), while the tool z-axis and the part z-axis are both upwards:
example1.png   

And here you can see that I changed the coordinate system of the tool, but the z-axis is still the opposite of the white arrows, and the "retract" and "approach" have to be in the minus direction too:
example2.png   

Is there a solution for this? 

Thank you in advance.
#8
You could flip the Z axis of the tool by applying a rotation of 180 deg around the X or Y axis. For example, if you want to rotate 180 deg using the API this would be:
Code:
pose = KUKA_2_Pose(xyzabc) * rotx(pi)
Can you share your RoboDK project file, the script and the file you are trying to load? We can better take a look.
  




Users browsing this thread:
1 Guest(s)