02-23-2023, 01:08 AM
(This post was last modified: 02-23-2023, 01:15 AM bysig.johnnson.)
When calling PoseWrt() between two reference frames, if one frame is attached to a robot, then a TargetReachError is thrown.
The attached .py and .rdk files are able to reliably reproduce this problem.
Note: I believe that even when no target reach error occurs, PoseWrt() does not return the expected coordinates when the calling Item is nested under a robot. I was actually investigating that issue when I uncovered the TargetReachError problem.
Update: I found a workaround (below). This works great for now, but I would like to go back to using the API in the future.
The attached .py and .rdk files are able to reliably reproduce this problem.
Note: I believe that even when no target reach error occurs, PoseWrt() does not return the expected coordinates when the calling Item is nested under a robot. I was actually investigating that issue when I uncovered the TargetReachError problem.
Update: I found a workaround (below). This works great for now, but I would like to go back to using the API in the future.
Code:
def pose_wrt(child, parent):
childPose = child.PoseAbs()
parentPose = parent.PoseAbs()
return parentPose.inv() * childPose