2014-12-09 06:58:54 +08:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
|
|
|
|
|
* Atlanta, Georgia 30332-0415
|
|
|
|
|
* All Rights Reserved
|
|
|
|
|
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
|
|
|
|
|
|
|
|
|
|
* See LICENSE for the license information
|
|
|
|
|
|
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @file SO3.h
|
2014-12-09 07:52:53 +08:00
|
|
|
* @brief 3*3 matrix representation of SO(3)
|
2014-12-09 06:58:54 +08:00
|
|
|
* @author Frank Dellaert
|
|
|
|
|
* @date December 2014
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <gtsam/base/Matrix.h>
|
2014-12-22 07:12:08 +08:00
|
|
|
#include <gtsam/base/Lie.h>
|
2014-12-09 06:58:54 +08:00
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
|
|
|
|
|
|
namespace gtsam {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* True SO(3), i.e., 3*3 matrix subgroup
|
|
|
|
|
* We guarantee (all but first) constructors only generate from sub-manifold.
|
|
|
|
|
* However, round-off errors in repeated composition could move off it...
|
|
|
|
|
*/
|
|
|
|
|
class SO3: public Matrix3 {
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
public:
|
2014-12-18 05:53:56 +08:00
|
|
|
enum { dimension=3 };
|
2014-12-09 06:58:54 +08:00
|
|
|
|
|
|
|
|
/// Constructor from Eigen Matrix
|
|
|
|
|
template<typename Derived>
|
|
|
|
|
SO3(const MatrixBase<Derived>& R) :
|
|
|
|
|
Matrix3(R.eval()) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Constructor from AngleAxisd
|
|
|
|
|
SO3(const Eigen::AngleAxisd& angleAxis) :
|
|
|
|
|
Matrix3(angleAxis) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-12-18 05:53:56 +08:00
|
|
|
template<>
|
|
|
|
|
struct traits_x<SO3> : public internal::LieGroup<SO3, multiplicative_group_tag> {};
|
|
|
|
|
|
2014-12-09 06:58:54 +08:00
|
|
|
|
|
|
|
|
} // end namespace gtsam
|
|
|
|
|
|