My Project 1.0
Holistic Fusion: A Generic Framework for Multimodal Sensor Fusion
Loading...
Searching...
No Matches
OptimizerLM.hpp
Go to the documentation of this file.
1/*
2Copyright 2024 by Julian Nubert, Robotic Systems Lab, ETH Zurich.
3All rights reserved.
4This file is released under the "BSD-3-Clause License".
5Please see the LICENSE file that has been included as part of this package.
6 */
7
8#ifndef OPTIMIZER_LM_HPP
9#define OPTIMIZER_LM_HPP
10
11// GTSAM
12#include <gtsam/nonlinear/LevenbergMarquardtOptimizer.h>
13
14// Workspace
16
17namespace holistic_fusion {
18
19class OptimizerLM : public OptimizerBase {
20 public:
21 explicit OptimizerLM(const std::shared_ptr<GraphConfig> graphConfigPtr) : OptimizerBase(graphConfigPtr) {
22 // Standard LM Parameters
23 lmParams_.setVerbosity("ERROR");
24 gtsam::LevenbergMarquardtParams::SetCeresDefaults(&lmParams_);
25
26 // Set Custom LM Parameters
27 // lmParams_.setLinearSolverType(
28 // "CHOLMOD"); // "MULTIFRONTAL_CHOLESKY", "MULTIFRONTAL_QR", "SEQUENTIAL_CHOLESKY", "SEQUENTIAL_QR", "ITERATIVE", "CHOLMOD"
29 lmParams_.setRelativeErrorTol(1e-6);
30 lmParams_.setAbsoluteErrorTol(1e-6);
31 // lmParams_.minModelFidelity = 1e-1;
32 }
33 ~OptimizerLM() = default;
34
35 // Implementation
36 bool updateExistingValues(const gtsam::Values& newGraphValues) override {
37 // Update Values
38 throw std::logic_error("HolisticFusion: OptimizerLM: updateExistingValues: Not implemented.");
39 }
40
41 protected:
42 // Parameters
43 gtsam::LevenbergMarquardtParams lmParams_;
44};
45
46} // namespace holistic_fusion
47
48#endif // OPTIMIZER_LM_HPP
OptimizerBase(const std::shared_ptr< GraphConfig > graphConfigPtr)
gtsam::LevenbergMarquardtParams lmParams_
OptimizerLM(const std::shared_ptr< GraphConfig > graphConfigPtr)
bool updateExistingValues(const gtsam::Values &newGraphValues) override