I have two question:
-
In the RobotStudio API Help it is written that “position.x”, “position.y” or “position.z” properties are of type “Long”. However, I think they must be defined as type “Double”. Am I right?
-
In my API code I’d like to shift the target points to other locations in the space. To be able to restore the original coordinates location, I save x, y, and z coordinates of targets in arrays of type “Double” first. However, after shifting and then restoring the original coordinate some inaccuracy are formed in x, y, or z of position properties. e.g. position.x=1699.999 instead of 1700.000. Although this inaccuracy is small, it is enough to influence my result and sometimes leads to wrong result especially if this error accumulates. The same problem can occur in “orientation.Rx, Ry, Rz” even if I do not change these properties in the code. This means sometimes Rx,Ry, or Rz change after changing the position.x, y, or z properties after doing many shifting. (If my question is not clear, please run the attached code and notice to the coordinates of targets before and after shifting)
Is this error because of “position.x”, “position.y” or “position.z” properties are defined of type “single” and not “double”? How we can eliminate this inaccuracy?
Thanks in advance,
BR, /Behnam