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

AngleAxis(UnitQuaternion) produces NaN derivatives #139

Open
rdeits opened this issue Feb 16, 2021 · 0 comments
Open

AngleAxis(UnitQuaternion) produces NaN derivatives #139

rdeits opened this issue Feb 16, 2021 · 0 comments

Comments

@rdeits
Copy link
Contributor

rdeits commented Feb 16, 2021

Similar to #96, constructing an AngleAxis from a UnitQuaternion produces NaN derivative elements when using ForwardDiff:

julia> using Rotations

julia> using ForwardDiff: Dual

julia> q = UnitQuaternion(Dual(1.0, 0.0), Dual(0.0, 0.0), Dual(0.0, 0.0), Dual(0.0, 0.0))
3×3 UnitQuaternion{Dual{Nothing,Float64,1}} with indices SOneTo(3)×SOneTo(3)(Dual{Nothing}(1.0,0.0), Dual{Nothing}(0.0,0.0), Dual{Nothing}(0.0,0.0), Dual{Nothing}(0.0,0.0)):
 Dual{Nothing}(1.0,0.0)  Dual{Nothing}(0.0,0.0)  Dual{Nothing}(0.0,0.0)
 Dual{Nothing}(0.0,0.0)  Dual{Nothing}(1.0,0.0)  Dual{Nothing}(0.0,0.0)
 Dual{Nothing}(0.0,0.0)  Dual{Nothing}(0.0,0.0)  Dual{Nothing}(1.0,0.0)

julia> AngleAxis(q)
3×3 AngleAxis{Dual{Nothing,Float64,1}} with indices SOneTo(3)×SOneTo(3)(Dual{Nothing}(0.0,NaN), Dual{Nothing}(1.0,NaN), Dual{Nothing}(0.0,NaN), Dual{Nothing}(0.0,NaN)):
 Dual{Nothing}(1.0,NaN)  Dual{Nothing}(0.0,NaN)  Dual{Nothing}(0.0,NaN)
 Dual{Nothing}(0.0,NaN)  Dual{Nothing}(1.0,NaN)  Dual{Nothing}(0.0,NaN)
 Dual{Nothing}(0.0,NaN)  Dual{Nothing}(0.0,NaN)  Dual{Nothing}(1.0,NaN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants