I was recreating an algorithm for a 4 DOF robot arm. In a code from GitHub I found that a way to do the inverse of the Jacobian was:
$$|J^TJ|\geq 1 \Rightarrow (J^TJ)^{-1}J^T=J^{-1}$$
I tried with some matrix examples and it works, but I don't get which properties of matrix are used here (and as extra, why it is does like this, why not just check if $|J|\geq1$ -so the matrix is invertible- and do $J^{-1}$).
This is called the pseudo-inverse of the matrix $J$.$\DeclareMathOperator{\adj}{adj}$
The inverse matrix is calculated using this formula $J^{-1}= \frac{\adj(J)}{\det(J)} = \frac{\adj(J)}{|J|}$, where $adj(J)$ is the adjoint matrix of $J$ and $|J|$ is its determinant.
If $J$ is singular, i.e., $|J|=0$, it is not possible to calculate the inverse $J^{-1}$. Thus, instead we can calculate its pseudo-inverse $J^+ =(J^TJ)^{-1}J^T$, which involves calculating the inverse of $J^TJ$. To check if $(J^TJ)^{-1}$ exists, its determinant should not be zero, that is $|J^TJ|\ne 0$.