I was looking into converting cartesian positions (represented as XYZWPREXT variables) into joint positions (JOINTPOS variable) via KAREL. I found two other posts (this one and this one) which basically contain two approaches.
Approach 1
Let the KAREL built-in casting do the work: P_joint = P_cart
Approach 2
Use the built-in routine POS2JOINT(_, P_cart, _,_ ,_ ,_ , _, P_joint, _)
I used to use approach 1 because of its simplicity, but I've now found that it doesn't always convert into the correct joint representation (when comparing to the 'golden standard' of setting a cartesian PR and changing the representation to joint). So I switched to the second approach; seems to work fine.. but it raises the question of why these approaches differ? Any ideas?
Does the automatic casting (approach 1) not use $MNUFRAMENUM and $MNUTOOLNUM perhaps?