Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add logmap_SO2 #43

Merged
merged 2 commits into from May 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Expand Up @@ -2,7 +2,7 @@ name = "TransformUtils"
uuid = "9b8138ad-1b09-5408-aa39-e87ed6d21b63"
keywords = ["coordinates", "reference frames", "SE2", "SO3", "quaternion", "robotics", "navigation"]
desc = "Handy coordinate transformation tools between various conventions."
version = "0.2.9"
version = "0.2.10"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
7 changes: 7 additions & 0 deletions src/TransformUtils.jl
Expand Up @@ -38,6 +38,7 @@ export
rotate,
wrapRad,
logmap,
logmap_SO2,
rightJacExmap,
rightJacExmapinv,
deltaso3vee,
Expand Down Expand Up @@ -728,6 +729,12 @@ end



# manifold distance, add, and subtract
function logmap_SO2(Rl::Matrix{<:Real})
ct = abs(Rl[1,1]) > 1.0 ? 1.0 : Rl[1,1] # reinserting the sign below
-sign(Rl[2,1])*acos(ct)
end

function wrapRad(th::Real)
#rem is not the best function here so using rem2pi(x, RoundNearest) returns in interval [-π, π]
#TODO is [-π, π] a problem or should it strictly be [-pi, pi)
Expand Down