Bayes Filters Library
LinearMeasurementModel.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 #include <Eigen/Dense>
11 
12 using namespace bfl;
13 using namespace Eigen;
14 
15 
16 std::pair<bool, bfl::Data> LinearMeasurementModel::predictedMeasure(const Eigen::Ref<const Eigen::MatrixXd>& cur_states) const
17 {
18  MatrixXd prediction = getMeasurementMatrix() * cur_states;
19 
20  return std::make_pair(true, std::move(prediction));
21 }
22 
23 
24 std::pair<bool, bfl::Data> LinearMeasurementModel::innovation(const bfl::Data& predicted_measurements, const bfl::Data& measurements) const
25 {
26  MatrixXd innovation = -(any::any_cast<MatrixXd>(predicted_measurements).colwise() - any::any_cast<MatrixXd>(measurements).col(0));
27 
28  return std::make_pair(true, std::move(innovation));
29 }
bfl
Port of boost::any for C++11 compilers.
Definition: AdditiveMeasurementModel.h:13
LinearMeasurementModel.h
bfl::any::any
The class any describes a type-safe container for single values of any type.
Definition: any.h:77
bfl::LinearMeasurementModel::predictedMeasure
virtual std::pair< bool, bfl::Data > predictedMeasure(const Eigen::Ref< const Eigen::MatrixXd > &cur_states) const override
Definition: LinearMeasurementModel.cpp:16
bfl::LinearMeasurementModel::innovation
virtual std::pair< bool, bfl::Data > innovation(const bfl::Data &predicted_measurements, const bfl::Data &measurements) const override
Definition: LinearMeasurementModel.cpp:24