Bayes Filters Library
DrawParticles.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 <utility>
11 
12 using namespace bfl;
13 using namespace Eigen;
14 
15 
16 DrawParticles::DrawParticles(std::unique_ptr<StateModel> state_model) noexcept :
17  state_model_(std::move(state_model))
18 { }
19 
20 
21 DrawParticles::DrawParticles(std::unique_ptr<StateModel> state_model, std::unique_ptr<ExogenousModel> exogenous_model) noexcept :
22  state_model_(std::move(state_model)),
23  exogenous_model_(std::move(exogenous_model))
24 { }
25 
26 
28  PFPrediction(std::move(prediction)),
29  state_model_(std::move(prediction.state_model_)),
30  exogenous_model_(std::move(prediction.exogenous_model_))
31 { }
32 
33 
35 {
36  PFPrediction::operator=(std::move(prediction));
37 
38  state_model_ = std::move(prediction.state_model_);
39 
40  exogenous_model_ = std::move(prediction.exogenous_model_);
41 
42  return *this;
43 }
44 
45 
47 {
48  return *state_model_;
49 }
50 
51 
52 void DrawParticles::predictStep(const ParticleSet& prev_particles, ParticleSet& pred_particles)
53 {
54  getStateModel().motion(prev_particles.state(), pred_particles.state());
55 
56  pred_particles.weight() = prev_particles.weight();
57 }
bfl::DrawParticles::getStateModel
StateModel & getStateModel() noexcept override
Definition: DrawParticles.cpp:46
bfl
Port of boost::any for C++11 compilers.
Definition: AdditiveMeasurementModel.h:13
bfl::DrawParticles
Definition: DrawParticles.h:19
bfl::PFPrediction::operator=
PFPrediction & operator=(const PFPrediction &prediction) noexcept=delete
bfl::PFPrediction
Definition: PFPrediction.h:25
bfl::DrawParticles::DrawParticles
DrawParticles(std::unique_ptr< StateModel > state_model) noexcept
Definition: DrawParticles.cpp:16
bfl::StateModel
Definition: StateModel.h:22
bfl::ParticleSet::state
Eigen::Ref< Eigen::MatrixXd > state()
Definition: ParticleSet.cpp:84
bfl::DrawParticles::operator=
DrawParticles & operator=(const DrawParticles &prediction) noexcept=delete
bfl::ParticleSet
Definition: ParticleSet.h:20
bfl::GaussianMixture::weight
Eigen::Ref< Eigen::VectorXd > weight()
Definition: GaussianMixture.cpp:166
bfl::DrawParticles::predictStep
void predictStep(const ParticleSet &prev_particles, ParticleSet &pred_particles) override
Definition: DrawParticles.cpp:52
DrawParticles.h