4 ms·
I would say it's probably worth converting your problem to its linear-algebraic representation and then using the solvers on that. They're quite fast there, and
by LolWolf 6y ago
I would say it's probably worth converting your problem to its linear-algebraic representation and then using the solvers on that. They're quite fast there, and it's probably fairly easy to make a representation map and its inverse work well. (I will say that I don't usually deal with quaternions other than in a linear-algebraic form when doing some robotics stuff, so maybe this is more of a pain than warranted!)
- spacedome 6y agoI found this approach to work well for linear systems, here is some rough code I used for the representation map (note the jmag/kmag functions are part of my implementation, not sure what the equivalent is for Quaternions.jl). function cmatrix(Q::AbstractVecOrMat{Quaternion{T}}) where {T} [complex.( real.(Q), imag.(Q)) complex.( jmag.(Q), kmag.(Q)); complex.(-jmag.(Q), kmag.(Q)) complex.( real.(Q), -imag.(Q))] end function qmatrix(C::AbstractMatrix{Complex{T}}) where {T} n, m = size(C) quat.(C[1:n÷2, 1:m÷2], C[1:n÷2, m÷2+1:m]) end