NonLinearPrismaticMeasurementPdf.cpp
Go to the documentation of this file.
2 
3 #include <ros/ros.h>
4 
5 using namespace BFL;
6 
7 #define PRISM_PDF_DIM 6
8 #define PRISM_CONDITIONAL_VAR_DIM 4
9 #define PRISM_NUM_CONDITIONAL_ARGS 2
10 
12  AnalyticConditionalGaussianAdditiveNoise(additiveNoise, PRISM_NUM_CONDITIONAL_ARGS),
14 {
15 
16 }
17 
19 {
20 
21 }
22 
23 MatrixWrapper::ColumnVector NonLinearPrismaticMeasurementPdf::ExpectedValueGet() const
24 {
25  ColumnVector state = ConditionalArgumentGet(0);
26 
27  double phi = state(1);
28  double theta = state(2);
29  double pv = state(3);
30 
31  ColumnVector expected_pose(PRISM_PDF_DIM);
32  expected_pose(1) = pv * cos(phi) * sin(theta);
33  expected_pose(2) = pv * sin(phi) * sin(theta);
34  expected_pose(3) = pv * cos(theta);
35  expected_pose(4) = 0.;
36  expected_pose(5) = 0.;
37  expected_pose(6) = 0.;
38 
39  return expected_pose + this->AdditiveNoiseMuGet();
40 }
41 
42 MatrixWrapper::Matrix NonLinearPrismaticMeasurementPdf::dfGet(unsigned int i) const
43 {
44  if (i == 0) //derivative to the first conditional argument (x)
45  {
46  double phi = ConditionalArgumentGet(0)(1);
47  double theta = ConditionalArgumentGet(0)(2);
48  double pv = ConditionalArgumentGet(0)(3);
49 
50  dfx = 0;
51  dfx(1, 1) = -pv*sin(theta)*sin(phi);
52  dfx(2, 1) = pv*sin(theta)*cos(phi);
53  dfx(1, 2) = pv*cos(theta)*cos(phi);
54  dfx(2, 2) = pv*cos(theta)*sin(phi);
55  dfx(3, 2) = -pv*sin(theta);
56  dfx(1, 3) = sin(theta)*cos(phi);
57  dfx(2, 3) = sin(theta)*sin(phi);
58  dfx(3, 3) = cos(theta);
59  return dfx;
60  }
61  else
62  {
63  ROS_ERROR_STREAM_NAMED("NonLinearPrismaticMeasurementPdf::dfGet",
64  "The derivative is not implemented for the " << i << "th conditional argument");
65  exit(BFL_ERRMISUSE);
66  }
67 }
68 
#define ROS_ERROR_STREAM_NAMED(name, args)
virtual MatrixWrapper::ColumnVector ExpectedValueGet() const
Get the expected value E[x] of the pdf Get low order statistic (Expected Value) of this AnalyticPdf...
#define PRISM_NUM_CONDITIONAL_ARGS
virtual MatrixWrapper::Matrix dfGet(unsigned int i) const
Returns derivative from function to n-th conditional variable.
NonLinearPrismaticMeasurementPdf(const Gaussian &additiveNoise)
Constructor.
#define PRISM_CONDITIONAL_VAR_DIM
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)


joint_tracker
Author(s): Roberto Martín-Martín
autogenerated on Mon Jun 10 2019 14:06:16