Skip to content

Instantly share code, notes, and snippets.

@msaroufim
Created November 28, 2019 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msaroufim/a7e892a69421cb58a2307d80d2937bea to your computer and use it in GitHub Desktop.
Save msaroufim/a7e892a69421cb58a2307d80d2937bea to your computer and use it in GitHub Desktop.
function MatrixExp6(se3mat::Array)
omgtheta = so3ToVec(se3mat[1:3, 1:3])
if NearZero(linalg.norm(omgtheta))
return vcat(hcat(linalg.I, se3mat[1:3, 4]), [0 0 0 1])
else
θ = AxisAng3(omgtheta)[2]
omgmat = se3mat[1:3, 1:3] / θ
return vcat(hcat(MatrixExp3(se3mat[1:3, 1:3]),
(linalg.I * θ +
(1 - cos(θ)) * omgmat +
(θ - sin(θ)) * omgmat * omgmat) *
se3mat[1:3, 4] / θ),
[0 0 0 1])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment