Bayes Filters Library
LTIStateModel.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2019 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This software may be modified and distributed under the terms of the
5  * BSD 3-Clause license. See the accompanying LICENSE file for details.
6  */
7 
9 
10 using namespace bfl;
11 using namespace Eigen;
12 
13 
14 LTIStateModel::LTIStateModel(const Ref<const MatrixXd>& transition_matrix, const Ref<const MatrixXd>& noise_covariance_matrix) :
15  F_(transition_matrix),
16  Q_(noise_covariance_matrix)
17 {
18  if ((F_.rows() == 0) || (F_.cols() == 0))
19  throw std::runtime_error("ERROR::LTISTATEMODEL::CTOR\nERROR:\n\tState transition matrix dimensions cannot be 0.");
20  else if ((Q_.rows() == 0) || (Q_.cols() == 0))
21  throw std::runtime_error("ERROR::LTISTATEMODEL::CTOR\nERROR:\n\tNoise covariance matrix dimensions cannot be 0.");
22  else if (F_.rows() != F_.cols())
23  throw std::runtime_error("ERROR::LTISTATEMODEL::CTOR\nERROR:\n\tState transition matrix must be a square matrix.");
24  else if (Q_.rows() != Q_.cols())
25  throw std::runtime_error("ERROR::LTISTATEMODEL::CTOR\nERROR:\n\tNoise covariance matrix must be a square matrix.");
26  else if (F_.rows() != Q_.rows())
27  throw std::runtime_error("ERROR::LTISTATEMODEL::CTOR\nERROR:\n\tNumber of rows of the state transition matrix must be the same as the size of the noise covariance matrix.");
28 }
29 
30 
32  F_(std::move(state_model.F_)),
33  Q_(std::move(state_model.Q_))
34 { }
35 
36 
38 {
39  if (this == &state_model)
40  return *this;
41 
42  F_ = std::move(state_model.F_);
43 
44  Q_ = std::move(state_model.Q_);
45 
46  return *this;
47 }
48 
49 
50 bool LTIStateModel::setProperty(const std::string& property)
51 {
52  return false;
53 }
54 
55 
57 {
58  return Q_;
59 }
60 
61 
63 {
64  return F_;
65 }
66 
67 
69 {
70  return F_;
71 }
bfl::LTIStateModel::LTIStateModel
LTIStateModel(const Eigen::Ref< const Eigen::MatrixXd > &transition_matrix, const Eigen::Ref< const Eigen::MatrixXd > &noise_covariance_matrix)
bfl::LTIStateModel::F_
Eigen::MatrixXd F_
State transition matrix.
Definition: LTIStateModel.h:45
bfl
Port of boost::any for C++11 compilers.
Definition: AdditiveMeasurementModel.h:13
bfl::LTIStateModel::Q_
Eigen::MatrixXd Q_
Noise covariance matrix of a zero mean additive white noise.
Definition: LTIStateModel.h:50
bfl::LTIStateModel::getJacobian
Eigen::MatrixXd getJacobian() override
Definition: LTIStateModel.cpp:68
bfl::LTIStateModel::operator=
LTIStateModel & operator=(const LTIStateModel &state_model) noexcept=delete
bfl::LTIStateModel
Definition: LTIStateModel.h:18
bfl::LTIStateModel::getNoiseCovarianceMatrix
Eigen::MatrixXd getNoiseCovarianceMatrix() override
Definition: LTIStateModel.cpp:56
LTIStateModel.h
bfl::LTIStateModel::setProperty
bool setProperty(const std::string &property) override
Definition: LTIStateModel.cpp:50
bfl::LTIStateModel::getStateTransitionMatrix
Eigen::MatrixXd getStateTransitionMatrix() override
Definition: LTIStateModel.cpp:62