Get object matrix from python

Typically: "How do I... ", "How can I... " questions
Post Reply
projectgoo
Posts: 3
Joined: 23 Oct 2017, 20:19

Get object matrix from python

Post by projectgoo » 04 Dec 2017, 13:00

Hello,

Is there a way to get the object matrix from python script, like simGetObjectMatrix from Lua script ?

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

Re: Get object matrix from python

Post by coppelia » 05 Dec 2017, 22:30

Hello,

not directly. But you can use simxCallScriptFunction. Have also a look here.

Cheers

projectgoo
Posts: 3
Joined: 23 Oct 2017, 20:19

Re: Get object matrix from python

Post by projectgoo » 06 Dec 2017, 20:34

Thank you so much for the answer, I'll try it. Thanks!

projectgoo
Posts: 3
Joined: 23 Oct 2017, 20:19

Re: Get object matrix from python

Post by projectgoo » 07 Dec 2017, 16:12

Can I create such matrix manually using simxGetObjectPosition and simxGetObjectOrientation ?

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

Re: Get object matrix from python

Post by coppelia » 10 Dec 2017, 21:35

Yes, this is actually even better. But you'll have to do the math behind that (i.e. euler angles to rotation matrix, the position coordinates are easy to put into the 4X4 matrix).

Cheers

Post Reply