Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
isam2_optimizer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <gtsam/geometry/Point2.h>
4#include <gtsam/geometry/Pose2.h>
5#include <gtsam/geometry/Rot2.h>
6#include <gtsam/nonlinear/ISAM2.h>
7#include <gtsam/sam/BearingRangeFactor.h>
8#include <gtsam/slam/BetweenFactor.h>
9
11
18 gtsam::ISAM2 _isam2_; //< ISAM2 instance for the optimizer
19 gtsam::Values _last_estimate_; //< Last estimate from the optimizer
20 gtsam::Values _new_values_; //< New values to add to the optimizer
21 gtsam::NonlinearFactorGraph _new_factors_; //< New factors to add to the optimizer
22public:
23 ISAM2Optimizer(const SLAMParameters& params);
24 ISAM2Optimizer(const ISAM2Optimizer& other);
26
27 ~ISAM2Optimizer() override = default;
28
36 std::shared_ptr<BaseOptimizer> clone() const;
37
52 gtsam::Values optimize([[maybe_unused]] gtsam::NonlinearFactorGraph& factor_graph,
53 [[maybe_unused]] gtsam::Values& graph_values,
54 [[maybe_unused]] unsigned int pose_num,
55 [[maybe_unused]] unsigned int landmark_num) override;
56
57 friend class GraphSLAMInstance;
58};
Base class for graph optimizers.
Graph SLAM instance class - class to hold the factor graph and the values.
ISAM2 optimizer for graph SLAM.
gtsam::Values _new_values_
gtsam::Values optimize(gtsam::NonlinearFactorGraph &factor_graph, gtsam::Values &graph_values, unsigned int pose_num, unsigned int landmark_num) override
Optimize the graph.
~ISAM2Optimizer() override=default
std::shared_ptr< BaseOptimizer > clone() const
Clone the optimizer.
gtsam::NonlinearFactorGraph _new_factors_
ISAM2Optimizer & operator=(const ISAM2Optimizer &other)
gtsam::ISAM2 _isam2_
gtsam::Values _last_estimate_
Parameters for the SLAM node.