conditionalUniformMeasPdf1d.cpp
Go to the documentation of this file.
1 // $Id: conditionalUniforMeasPdf1d.cpp TDeLaet $
2 // Copyright (C) 2007 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 
20 #include <wrappers/rng/rng.h> // Wrapper around several rng libraries
21 
22 #define MEASMODEL_NUMCONDARGUMENTS 1
23 #define MEASMODEL_DIMENSION 1
24 
25 namespace BFL
26 {
27  using namespace MatrixWrapper;
28 
31  {
32  _measNoise = measNoise;
33  }
34 
35 
37 
39  ConditionalUniformMeasPdf1d::ProbabilityGet(const ColumnVector& measurement) const
40  {
41  // simplified version: the probability of a measurement is just the
42  // probability under the additive Gaussian noise. The discrete nature of the
43  // underlying state is not taken into account
44  int state = ConditionalArgumentGet(0);
45  ColumnVector expected_measurement(1);
46  // the expected measurement in this simplified 1d example is just two times
47  // the position of the 1d mobile robot
48  expected_measurement(1) = 2 * state;
49 
50  return _measNoise.ProbabilityGet(expected_measurement-measurement);
51  }
52 
53 }//namespace BFL
54 
Class representing Gaussian (or normal density)
Definition: gaussian.h:27
ConditionalUniformMeasPdf1d(const Gaussian &measNoise)
Constructor.
#define MEASMODEL_DIMENSION
Abstract Class representing conditional Pdfs P(x | ...)
const int & ConditionalArgumentGet(unsigned int n_argument) const
Get the n-th argument of the list.
Class representing a probability (a double between 0 and 1)
Definition: bfl_constants.h:39
virtual Probability ProbabilityGet(const MatrixWrapper::ColumnVector &input) const
Get the probability of a certain argument.
Definition: gaussian.cpp:75
virtual Probability ProbabilityGet(const MatrixWrapper::ColumnVector &measurement) const
Get the probability of a certain argument.
#define MEASMODEL_NUMCONDARGUMENTS


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 Jun 10 2019 12:47:58