improved rotation transpose with quaternions

release/4.3a0
Varun Agrawal 2020-03-18 18:18:51 -04:00
parent 359bc161a6
commit 2a07cfed66
1 changed files with 3 additions and 3 deletions

View File

@ -19,8 +19,8 @@
#ifdef GTSAM_USE_QUATERNIONS
#include <boost/math/constants/constants.hpp>
#include <gtsam/geometry/Rot3.h>
#include <boost/math/constants/constants.hpp>
#include <cmath>
using namespace std;
@ -80,8 +80,8 @@ namespace gtsam {
/* ************************************************************************* */
const Eigen::Transpose<const Matrix3> Rot3::transpose() const {
// `.eval()` to avoid aliasing effect due to transpose (allows compilation).
return matrix().eval().transpose();
// `eval` for immediate evaluation (allows compilation).
return Rot3(matrix()).matrix().eval().transpose();
}
/* ************************************************************************* */