Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get & set reference frame of a target's pose?
#1
In the RoboDK API, how do I get and set the reference frame with respect to which the pose of a target is given?

Suppose I have a target named Tar01 which I retrieve as an item via:

tar = RDK.Item('Tar01',ITEM_TYPE_TARGET)

Then I can request its pose via:

tar.Pose()

How do I find with respect to which reference frame this pose is defined, and how can I set it to a different reference frame?

I expected to be able to use PoseFrame() and setPoseFrame(), but these appear only applicable to an item of type robot. I might be able to use the method proposed by Vineet here. In the RoboDK GUI the reference frame can simply be changed in a drop down menu ("Target position with respect to:...") from target options, so I'm looking for the API's analogy.

Best regards,

Maarten
#2
You can retrieve the parent of a target (usually the frame it is attached to) by calling Parent. 

Example:
Code:
reference = target.Parent()
print("Target attached to: " + reference.Name())

# You can also move this target to a new reference:
target.setParent(new_frame)
  




Users browsing this thread:
1 Guest(s)