Page 1 of 1

sim.invertMatrix function doesn't seem to be working

Posted: 22 Sep 2018, 19:59
by atoz
Hi,

The above mentioned function always gives 1 as a result of an inversion. Even this simple code:

Code: Select all

print(sim.invertMatrix(sim.buildIdentityMatrix()))
gives 1 as the answer although the matrix is invertible.

Is this a bug?

*EDIT* Just to add to this, the

Code: Select all

sim.getEulerAnglesFromMatrix()
function is also buggy as the values for the second angle (y-axis) jump around. Whereas, when I used the method in this pdf, I get a continous range.

Cheers

Re: sim.invertMatrix function doesn't seem to be working

Posted: 01 Oct 2018, 07:29
by coppelia
Hello,

from the documentation of the sim.invertMatrix, it clearly states:
return value: -1 if operation was not successful. In a future release, a more differentiated return value might be available
Did you check if your provided matrix was inverted or not? THe function return value just gives an information about whether it was successfully inverted or not.

About the Euler angles remark: jumping values in Euler angles are normal, since at some point you lose one degree of freedom (gimbal lock).

Cheers