JuliaGeometry / JuliaGeometry/Rotations.jl
Jacobian of `exp(RotationVecGenerator(...))` at 0 results in `NaN`
Open
Nobody has claimed this yet.
differentiation
- Dominant language
- Julia
- Stars
- 188
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
This should not result in NaN:
julia> f(p) = exp(RotationVecGenerator(p[1], p[2], p[3]));
julia> ForwardDiff.jacobian(f, [0.0, 0.0, 0.0])
9×3 Matrix{Float64}:
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
The correct output is
julia> f2(p) = exp(SMatrix(RotationVecGenerator(p[1], p[2], p[3])));
julia> ForwardDiff.jacobian(f2, [0.0, 0.0, 0.0])
9×3 Matrix{Float64}:
0.0 0.0 0.0
0.0 0.0 1.0
0.0 -1.0 0.0
0.0 0.0 -1.0
0.0 0.0 0.0
1.0 0.0 0.0
0.0 1.0 0.0
-1.0 0.0 0.0
0.0 0.0 0.0
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 Julia ForwardDiff.jacobian example for exp(RotationVecGenerator(...)) at [0.0, 0.0, 0.0], then compare it with the SMatrix variant shown in the issue. Done means the first expression produces finite Jacobian values matching the displayed 9×3 result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100