Fix trlog exceptional condition - #63
Conversation
For the rotation part of trlog, the iseye condition does not catch all conditions where the rotation value is near-zero. I actually got divided-by-zero exception in the general case part while doing some simulation. There are many ways to avoid divided-by-zero exception when we calculate skw = ... / math.sin(theta). But, I recommend you to fix iseye routine. Instead of iseye routine, we can simply check if trace(R) = 1 + 2cos(theta=0) = 3
|
thanks for this, it's elegant to use the trace twice. Can you give me the numeric example where On the Perhaps there should be a test on |
| trace_R = np.trace(R) | ||
| if abs(trace_R - 3) < tol * _eps: | ||
| # matrix is identity | ||
| if twist: |
There was a problem hiding this comment.
nit: write
return np.zeros((3,)) if twist else np.zeros((3, 3)it is much simpler to read and less lines
sorry has nothing to do with the PR :-)
|
Thank you for your interest in SMTB and for the report here! This was fixed, but by a different mechanism than proposed in this PR. #63 targets the I've opened #208 to add regression coverage for exactly this near-identity case, referencing this PR — confirmed it reproduces the original Closing as superseded, but appreciate you flagging it — it pointed at a real gap that's now got a test pinned to it. |
For the rotation part of trlog, the iseye condition does not catch all conditions where the rotation value is near-zero. I actually got divided-by-zero exception in the general case part while doing some simulation.
There are many ways to avoid divided-by-zero exception when we calculate skw = ... / math.sin(theta). But, I recommend you to fix iseye routine.
Instead of iseye routine, we can simply check if trace(R) = 1 + 2cos(theta=0) = 3