Rotate a dummy from API

Typically: "How do I... ", "How can I... " questions
Post Reply
mohammadhosseink
Posts: 20
Joined: 11 Sep 2022, 06:48

Rotate a dummy from API

Post by mohammadhosseink »

Hello,

I want to rotate a dummy's orientation with respect to one of its axes from Python API, and I know the angle with which I want to rotate the dummy. I have come to the SetObjectPose method, but this method requires knowing the alpha, betta, and gamma values and these are unknown to me since I cannot understand the relationships between the local rotation I want to perform and these alpha, beta, and gamma values. Is there an alternative method with which I can easily implement the rotation with respect to one of the axes of the dummy? Or is there a way to relate this rotation to the alpha, beta, and gamma values?

I appreciate your time,
Cheers.

coppelia
Site Admin
Posts: 9762
Joined: 14 Dec 2012, 00:25

Re: Rotate a dummy from API

Post by coppelia »

Hello,

did you have a look at sim.rotateAroundAxis?

Cheers

mohammadhosseink
Posts: 20
Joined: 11 Sep 2022, 06:48

Re: Rotate a dummy from API

Post by mohammadhosseink »

Thank you very much. I calculate the euler angles though, and I am now working with simxSetObjectOrientation from the Python legacy API ( I have to use the legacy one ). In its documentation, it is said that Euler angles should be inserted in array format. What does array mean in python? Is it a list or tuple?

The documentation :

Code: Select all

number returnCode=simxSetObjectOrientation(number clientID,number objectHandle,number relativeToObjectHandle,array eulerAngles,number operationMode)
Thank you

coppelia
Site Admin
Posts: 9762
Joined: 14 Dec 2012, 00:25

Re: Rotate a dummy from API

Post by coppelia »

Hello,

it seems you are using the deprecated legacy remote API. I highly recommend you to use the ZeroMQ remote API, which is much more flexible and easy to use. Additionally, it offers almost all the same API functions as from within CoppeliaSim.
But in general, yes, a table/array/list represent similar things in Lua/C/Python, and the documentation sometimes uses those words interchangeably ;)

Cheers

Post Reply