JuliaGeometry / JuliaGeometry/Rotations.jl
AngleAxis(UnitQuaternion) produces NaN derivatives
Open
Nobody has claimed this yet.
differentiation
- Dominant language
- Julia
- Stars
- 188
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
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)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the AngleAxis(q) example with ForwardDiff and inspect the AngleAxis(UnitQuaternion) conversion entry point. Trace the zero-angle handling and verify that the conversion preserves finite derivative elements instead of producing NaN values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100