31 using namespace gtsam;
40 const std::string &
name,
41 ShonanAveraging3::Parameters
parameters = ShonanAveraging3::Parameters()) {
82 Values random = ShonanAveraging3::LiftTo<Rot3>(4, randomRotations);
119 Values initial = ShonanAveraging3::LiftTo<Rot3>(3, randomRotations);
134 Values random = ShonanAveraging3::LiftTo<Rot3>(4, randomRotations);
148 v << 1, 2, 3, 4, 5, 6, 7, 8, 9;
149 Vector expected0(10), expected1(10), expected2(10);
150 expected0 << 0, 3, -2, 1, 0, 0, 0, 0, 0, 0;
151 expected1 << 0, 6, -5, 4, 0, 0, 0, 0, 0, 0;
152 expected2 << 0, 9, -8, 7, 0, 0, 0, 0, 0, 0;
170 static std::mt19937
rng(0);
171 Vector descentDirection = Vector::Random(15);
173 Values random = ShonanAveraging3::LiftTo<Rot3>(3, randomRotations);
182 const Matrix S = ShonanAveraging3::StiefelElementMatrix(Qstar3);
184 bool computeEigenvectors =
false;
187 double minEigenValue = lambdas(0);
188 for (
int i = 1;
i < lambdas.size();
i++)
189 minEigenValue =
min(lambdas(
i), minEigenValue);
205 ShonanAveraging3::LiftwithDescent(4, Qstar3, descentDirection);
210 expected << 0.145767, -0.938445, 0.135713, -0.282233,
211 0.780348, -0.0104323, 0.266238, 0.565743,
212 -0.383624, 0.0434887, 0.917211, 0.0983088,
213 -0.471849, -0.342523, -0.263482, 0.768514;
215 expected << 0.100724, -0.987231, 0.104092, 0.0662867,
216 0.571527, 0.0292782, 0.226546, -0.788147,
217 -0.349294, 0.064102, 0.93465, 0.0177471,
218 0.735667, 0.142857, 0.253519, 0.611649;
220 expected << 0.0825862, -0.645931, 0.271896, 0.708537,
221 0.927285, -0.0156335, 0.291603, -0.234236,
222 -0.36419, -0.132115, 0.831933, -0.39724,
223 0.0262425, 0.751715, 0.385912, 0.534143;
232 Values random = ShonanAveraging3::LiftTo<Rot3>(3, randomRotations);
253 const Rot3 wR0(0.9992281076190063, -0.02676080288219576, -0.024497002638379624,
254 -0.015064701622500615);
255 const Rot3 wR1(0.998239108728862, -0.049543805396343954, -0.03232420352077356,
256 -0.004386230477751116);
257 const Rot3 wR2(0.9925378735259738, -0.07993768981394891, 0.0825062894866454,
258 -0.04088089479075661);
262 using namespace klaus;
277 static const Rot3 identity;
289 -0.01796327847857683, 0.010210006313668573),
320 using namespace klaus;
345 auto lmParams = LevenbergMarquardtParams::CeresDefaults();
365 auto lmParams = LevenbergMarquardtParams::CeresDefaults();
372 string parameters_print =
373 " ShonanAveragingParameters: \n alpha: 0\n beta: 1\n gamma: 0\n "
385 for (
size_t i=0;
i<=4;
i++) {
386 const auto &robust = std::dynamic_pointer_cast<noiseModel::Robust>(
403 auto lmParams = LevenbergMarquardtParams::CeresDefaults();
415 params.setKarcherWeight(0);
417 for (
auto i : {0,1,2}) {
420 std::static_pointer_cast<noiseModel::Isotropic>(
m.noiseModel());
421 CHECK(isotropic !=
nullptr);
436 auto unit3 = noiseModel::Unit::Create(3);