Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GRABBING COORDINATES OF WAYPOINTS WRT. PART ORIGIN
#1
Is there a way to grab the coordinates of each waypoint with respect to the part origin in your rdk station?
#2
When opening the Options for an object in RoboDK, you can change the "position with respect to" and set it to the Station to get the absolute position.

With the Python API, take a look at Item.PoseWrt, i.e. target.PoseWrt(RDK.ActiveStation())

You might need to take the latest version from our GitHub: https://github.com/RoboDK/RoboDK-API/blo...k.py#L4310
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our YouTube Channel.
#3
Will this give the coordinates with respect to the robot origin? or the object origin?
#4
I'm trying to use the PoseWrt to function, but I keep getting an error saying "Attribute Error: 'Item' object has no attribute 'PoseWrt' ". I have attached a screenshot. If I use this function, will I be able to find the position of the robot (X,Y,Z) with respect to the origin of the part (step file)? That is what I am after.


Attached Files Thumbnail(s)
   
#5
As stated above, this is fairly new, and you might need to manually update the RoboDK API in your install folder (C:/RoboDK/Python), wait that we bundle it with RoboDK in a future update or copy the code from the GitHub repository in your station.

Once that is done, you can get the position of any Item with respect to any Item.
For instance, robot_item.getPoseWrt(obj_item) and vice versa.
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our YouTube Channel.
#6
So I updated the robolink python file in my C drive and I'm still getting the same errors. I tried copying the code into my station, but still didn't help although I wasn't really sure what you meant by that. 

I've attached the python script since I believe this is where the issue may be coming from.


Attached Files
.py   TEST.py (Size: 805 bytes / Downloads: 7)
#7
I should clarify. You need to update everything in the Python Package module: https://github.com/RoboDK/RoboDK-API/tre...n%2Frobodk

The PoseWrt is actually defined in robolinkutils.py
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our YouTube Channel.
#8
I updated all of the corresponding files in my robodk folder in the C drive, and also didn't have the robolinkutils.py file so I added it in, but still no luck. I'm continuing to get the same error message.

I did find a script in the RoboDK Python API that calculates the pose of any object wrt to any reference frame in RoboDK. Is there any way to modify this to give me the pose wrt to a reference frame of every waypoint in a path? 


I attached a screenshot of the script I found.


Attached Files Thumbnail(s)
   
  




Users browsing this thread:
1 Guest(s)