JuliaGeometry / JuliaGeometry/Rotations.jl

Jacobian of `exp(RotationVecGenerator(...))` at 0 results in `NaN`

Open
#280 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.