undo return type of Eigen::Transpose, and add back TODO to optimize RPY

release/4.3a0
Varun Agrawal 2020-03-18 19:25:31 -04:00
parent 7b6a80eba2
commit dec918c3d5
3 changed files with 14 additions and 4 deletions

View File

@ -411,7 +411,7 @@ namespace gtsam {
/** /**
* Return 3*3 transpose (inverse) rotation matrix * Return 3*3 transpose (inverse) rotation matrix
*/ */
const Eigen::Transpose<const Matrix3> transpose() const; Matrix3 transpose() const;
/// @deprecated, this is base 1, and was just confusing /// @deprecated, this is base 1, and was just confusing
Point3 column(int index) const; Point3 column(int index) const;
@ -440,16 +440,25 @@ namespace gtsam {
/** /**
* Accessor to get to component of angle representations * Accessor to get to component of angle representations
* NOTE: these are not efficient to get to multiple separate parts,
* you should instead use xyz() or ypr()
* TODO: make this more efficient
*/ */
inline double roll() const { return xyz()(0); } inline double roll() const { return xyz()(0); }
/** /**
* Accessor to get to component of angle representations * Accessor to get to component of angle representations
* NOTE: these are not efficient to get to multiple separate parts,
* you should instead use xyz() or ypr()
* TODO: make this more efficient
*/ */
inline double pitch() const { return xyz()(1); } inline double pitch() const { return xyz()(1); }
/** /**
* Accessor to get to component of angle representations * Accessor to get to component of angle representations
* NOTE: these are not efficient to get to multiple separate parts,
* you should instead use xyz() or ypr()
* TODO: make this more efficient
*/ */
inline double yaw() const { return xyz()(2); } inline double yaw() const { return xyz()(2); }

View File

@ -110,7 +110,7 @@ Rot3 Rot3::operator*(const Rot3& R2) const {
} }
/* ************************************************************************* */ /* ************************************************************************* */
const Eigen::Transpose<const Matrix3> Rot3::transpose() const { Matrix3 Rot3::transpose() const {
return rot_.matrix().transpose(); return rot_.matrix().transpose();
} }

View File

@ -79,9 +79,10 @@ namespace gtsam {
} }
/* ************************************************************************* */ /* ************************************************************************* */
const Eigen::Transpose<const Matrix3> Rot3::transpose() const { Matrix3 Rot3::transpose() const {
// `eval` for immediate evaluation (allows compilation). // `eval` for immediate evaluation (allows compilation).
return Rot3(matrix()).matrix().eval().transpose(); // return Rot3(matrix()).matrix().eval().transpose();
return matrix().eval().transpose();
} }
/* ************************************************************************* */ /* ************************************************************************* */