nonlinearSystemPdf.cpp
Go to the documentation of this file.
1 // $Id: nonlinearanalyticconditionalgaussianmobile.cpp 5823 2005-10-27 13:43:02Z TDeLaet $
2 // Copyright (C) 2006 Tinne De Laet <first dot last at mech dot kuleuven dot be>
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation; either version 2.1 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 //
18 
19 #include "nonlinearSystemPdf.h"
20 #include <wrappers/rng/rng.h> // Wrapper around several rng libraries
21 
22 #define SYSMODEL_NUMCONDARGUMENTS_MOBILE 2
23 #define SYSMODEL_DIMENSION_MOBILE 3
24 
25 namespace BFL
26 {
27  using namespace MatrixWrapper;
28 
31  {
32  _additiveNoise = additiveNoise;
33  }
34 
35 
37 
38 
39  bool NonlinearSystemPdf::SampleFrom (Sample<ColumnVector>& one_sample, int method, void * args) const
40  {
41  ColumnVector state = ConditionalArgumentGet(0);
42  ColumnVector vel = ConditionalArgumentGet(1);
43 
44  // system update
45  state(1) += cos(state(3)) * vel(1);
46  state(2) += sin(state(3)) * vel(1);
47  state(3) += vel(2);
48 
49  // sample from additive noise
51  _additiveNoise.SampleFrom(noise, method, args);
52 
53  // store results in one_sample
54  one_sample.ValueSet(state + noise.ValueGet());
55 
56  return true;
57  }
58 
59 }//namespace BFL
60 
virtual ~NonlinearSystemPdf()
Destructor.
NonlinearSystemPdf(const Gaussian &additiveNoise)
Constructor.
Class representing Gaussian (or normal density)
Definition: gaussian.h:27
void ValueSet(const T &value)
Set the value of the Sample.
const MatrixWrapper::ColumnVector & ConditionalArgumentGet(unsigned int n_argument) const
Get the n-th argument of the list.
bool SampleFrom(vector< Sample< MatrixWrapper::ColumnVector > > &list_samples, const int num_samples, int method=DEFAULT, void *args=NULL) const
Abstract Class representing conditional Pdfs P(x | ...)
T & ValueGet()
Get the value of the Sample.
#define SYSMODEL_NUMCONDARGUMENTS_MOBILE
virtual bool SampleFrom(Sample< MatrixWrapper::ColumnVector > &one_sample, int method=DEFAULT, void *args=NULL) const
#define SYSMODEL_DIMENSION_MOBILE


bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Mon Feb 28 2022 21:56:33