in your example you are retrieving the orientation of the cup, relative to the kinect.
Also, the first call to simxGetObjectOrientation is never returning a valid value, it is just starting data streaming for the specified command.
Now, can you show us the values returned that are always different? You have to be aware that the cup might be moving a tiny little bit depending on the settings you chose for your physics parameters.
Hi, I am seeing an issue with the python simxGetObjectOrientation call too:
I have a prox sensor attached to BubbleRob. I verified the sensor's orientation to be (-1.57, 1.39,-3.14) via Lua script, which matches with UI display.
But in my python call (simxGetObjectOrientation), i get (-1.57, 1.39,3.14). I.e, gama value has the opposite sign of the Lua returned value.
While this issue does not affect other calculations, I am, however, curious why Lua and external API would return different values.
Thanks
this is probably due to the second / third argument of the simGetObjectOrientation / simxGetObjectOrientation function: it defines an object handle relative to which reference frame you want to Euler angles. Use -1 for absolute Euler angles.