Vec.h
Go to the documentation of this file.
1 /*
2  * OpenVINS: An Open Platform for Visual-Inertial Research
3  * Copyright (C) 2018-2023 Patrick Geneva
4  * Copyright (C) 2018-2023 Guoquan Huang
5  * Copyright (C) 2018-2023 OpenVINS Contributors
6  * Copyright (C) 2018-2019 Kevin Eckenhoff
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef OV_TYPE_TYPE_VEC_H
23 #define OV_TYPE_TYPE_VEC_H
24 
25 #include "Type.h"
26 
27 namespace ov_type {
28 
32 class Vec : public Type {
33 
34 public:
39  Vec(int dim) : Type(dim) {
40  _value = Eigen::VectorXd::Zero(dim);
41  _fej = Eigen::VectorXd::Zero(dim);
42  }
43 
44  ~Vec() {}
45 
55  void update(const Eigen::VectorXd &dx) override {
56  assert(dx.rows() == _size);
57  set_value(_value + dx);
58  }
59 
63  std::shared_ptr<Type> clone() override {
64  auto Clone = std::shared_ptr<Type>(new Vec(_size));
65  Clone->set_value(value());
66  Clone->set_fej(fej());
67  return Clone;
68  }
69 };
70 
71 } // namespace ov_type
72 
73 #endif // OV_TYPE_TYPE_VEC_H
ov_type::Type::_size
int _size
Dimension of error state.
Definition: Type.h:132
ov_type::Type::set_value
virtual void set_value(const Eigen::MatrixXd &new_value)
Overwrite value of state's estimate.
Definition: Type.h:90
ov_type::Vec::clone
std::shared_ptr< Type > clone() override
Performs all the cloning.
Definition: Vec.h:63
Type.h
ov_type::Vec::update
void update(const Eigen::VectorXd &dx) override
Implements the update operation through standard vector addition.
Definition: Vec.h:55
ov_type::Type::value
virtual const Eigen::MatrixXd & value() const
Access variable's estimate.
Definition: Type.h:79
ov_type::Vec::~Vec
~Vec()
Definition: Vec.h:44
ov_type::Vec::Vec
Vec(int dim)
Default constructor for Vec.
Definition: Vec.h:39
ov_type
Dynamic type system types.
ov_type::Type::fej
virtual const Eigen::MatrixXd & fej() const
Access variable's first-estimate.
Definition: Type.h:84
ov_type::Type::_fej
Eigen::MatrixXd _fej
First-estimate.
Definition: Type.h:123
ov_type::Type::_value
Eigen::MatrixXd _value
Current best estimate.
Definition: Type.h:126
ov_type::Vec
Derived Type class that implements vector variables.
Definition: Vec.h:32
ov_type::Type
Base class for estimated variables.
Definition: Type.h:37


ov_core
Author(s): Patrick Geneva , Kevin Eckenhoff , Guoquan Huang
autogenerated on Mon Jan 22 2024 03:08:17