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

Tweak to fix rot2vec bug #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/so3/Operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ Eigen::Vector3d rot2vec(const Eigen::Matrix3d& C_ab) {
const double phi_ba = acos(std::clamp(0.5 * (C_ab.trace() - 1.0), -1.0, 1.0));
const double sinphi_ba = sin(phi_ba);

if (fabs(sinphi_ba) > 1e-9) {
if (fabs(sinphi_ba) > 1e-6) {
// General case, angle is NOT near 0, pi, or 2*pi
Eigen::Vector3d axis;
axis << C_ab(2, 1) - C_ab(1, 2), C_ab(0, 2) - C_ab(2, 0),
C_ab(1, 0) - C_ab(0, 1);
return (0.5 * phi_ba / sinphi_ba) * axis;

} else if (fabs(phi_ba) > 1e-9) {
} else if (fabs(phi_ba) > 1e-6) {
// Angle is near pi or 2*pi
// ** Note with this method we do not know the sign of 'phi', however since
// we know phi is
Expand Down