25#include <boost/assign/list_of.hpp>
52 boost::shared_ptr<JacobianFactor> whitenedJacobian_;
61 boost::optional<double> gamma = boost::none)
64 throw std::invalid_argument(
"ShonanGaugeFactor must have p>=d.");
68 size_t P = SOn::Dimension(p);
69 rows_ = SOn::Dimension(q);
79 double invSigma = gamma ? std::sqrt(*gamma) : 1.0;
80 size_t i = 0, j = 0, n = p - 1 - d;
82 A.block(i, j, n, n) = invSigma * Matrix::Identity(n, n);
89 boost::make_shared<JacobianFactor>(key, A, Vector::Zero(rows_));
99 size_t dim()
const override {
return rows_; }
103 return whitenedJacobian_;
N*N matrix representation of SO(N).
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
Nonlinear factor base class.
Definition: NonlinearFactor.h:43
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:63
The ShonanGaugeFactor creates a constraint on a single SO(n) to avoid moving in the stabilizer.
Definition: ShonanGaugeFactor.h:47
double error(const Values &c) const override
Calculate the error of the factor: always zero.
Definition: ShonanGaugeFactor.h:96
~ShonanGaugeFactor() override
Destructor.
Definition: ShonanGaugeFactor.h:93
boost::shared_ptr< GaussianFactor > linearize(const Values &c) const override
linearize to a GaussianFactor
Definition: ShonanGaugeFactor.h:102
size_t dim() const override
get the dimension of the factor (number of rows on linearization)
Definition: ShonanGaugeFactor.h:99
ShonanGaugeFactor(Key key, size_t p, size_t d=3, boost::optional< double > gamma=boost::none)
Construct from key for an SO(p) matrix, for base dimension d (2 or 3) If parameter gamma is given,...
Definition: ShonanGaugeFactor.h:60