I’m assuming PCSDK and that you are using GetPosition, is that correct?
If so, then I’ve tried it and there is some sort of limitation there. Since we are on the MechanicalUnit it should return only data for the selected MechanicalUnit, however that conflicts intuitively with the return type of RobTarget and JointTarget.
However there is no other method to get the joint values of the robot+external axes.
So you are quite correct that you need to combine those two sets.
I’ve brought this up with R&D of the SDKs and they will look into creating a new method to get all joints in one method. So that we don’t have to combine things like this.
As a side note, you mention ActiveMechanicalUnit - that is whatever is selected on the FlexPendant/RobotWare at the moment, so it can change. Test it by using the Jogging window on the FlexPendant and you can see that you can flip back and forth.
The choices should be “Rob_1” and “Table1” as defined by the MOC file.
You can get a full list of the MechanicalUnits on the MotionDomain.