include
gmcl
pf
pf_pdf.h
Go to the documentation of this file.
1
//this package is based on amcl and has been modified to fit gmcl
2
/*
3
* Author: Mhd Ali Alshikh Khalil
4
* Date: 20 June 2021
5
*
6
*/
7
8
//amcl author clarification
9
/*
10
* Player - One Hell of a Robot Server
11
* Copyright (C) 2000 Brian Gerkey & Kasper Stoy
12
* gerkey@usc.edu kaspers@robotics.usc.edu
13
*
14
* This library is free software; you can redistribute it and/or
15
* modify it under the terms of the GNU Lesser General Public
16
* License as published by the Free Software Foundation; either
17
* version 2.1 of the License, or (at your option) any later version.
18
*
19
* This library is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
* Lesser General Public License for more details.
23
*
24
* You should have received a copy of the GNU Lesser General Public
25
* License along with this library; if not, write to the Free Software
26
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
*
28
*/
29
/**************************************************************************
30
* Desc: Useful pdf functions
31
* Author: Andrew Howard
32
* Date: 10 Dec 2002
33
* CVS: $Id: pf_pdf.h 6345 2008-04-17 01:36:39Z gerkey $
34
*************************************************************************/
35
36
#ifndef PF_PDF_H
37
#define PF_PDF_H
38
39
#include "
pf_vector.h
"
40
41
//#include <gsl/gsl_rng.h>
42
//#include <gsl/gsl_randist.h>
43
44
#ifdef __cplusplus
45
extern
"C"
{
46
#endif
47
48
/**************************************************************************
49
* Gaussian
50
*************************************************************************/
51
52
// Gaussian PDF info
53
typedef
struct
54
{
55
// Mean, covariance and inverse covariance
56
pf_vector_t
x;
57
pf_matrix_t
cx;
58
//pf_matrix_t cxi;
59
double
cxdet;
60
61
// Decomposed covariance matrix (rotation * diagonal)
62
pf_matrix_t
cr;
63
pf_vector_t
cd;
64
65
// A random number generator
66
//gsl_rng *rng;
67
68
}
pf_pdf_gaussian_t
;
69
70
71
// Create a gaussian pdf
72
pf_pdf_gaussian_t
*
pf_pdf_gaussian_alloc
(
pf_vector_t
x,
pf_matrix_t
cx);
73
74
// Destroy the pdf
75
void
pf_pdf_gaussian_free
(
pf_pdf_gaussian_t
*pdf);
76
77
// Compute the value of the pdf at some point [z].
78
//double pf_pdf_gaussian_value(pf_pdf_gaussian_t *pdf, pf_vector_t z);
79
80
// Draw randomly from a zero-mean Gaussian distribution, with standard
81
// deviation sigma.
82
// We use the polar form of the Box-Muller transformation, explained here:
83
// http://www.taygeta.com/random/gaussian.html
84
double
pf_ran_gaussian
(
double
sigma);
85
86
// Generate a sample from the pdf.
87
pf_vector_t
pf_pdf_gaussian_sample
(
pf_pdf_gaussian_t
*pdf);
88
89
#ifdef __cplusplus
90
}
91
#endif
92
93
#endif
pf_vector_t
Definition:
pf_vector.h:46
pf_pdf_gaussian_t
Definition:
pf_pdf.h:53
pf_pdf_gaussian_free
void pf_pdf_gaussian_free(pf_pdf_gaussian_t *pdf)
Definition:
pf_pdf.c:83
pf_pdf_gaussian_alloc
pf_pdf_gaussian_t * pf_pdf_gaussian_alloc(pf_vector_t x, pf_matrix_t cx)
Definition:
pf_pdf.c:55
pf_matrix_t
Definition:
pf_vector.h:53
pf_ran_gaussian
double pf_ran_gaussian(double sigma)
Definition:
pf_pdf.c:141
pf_vector.h
pf_pdf_gaussian_sample
pf_vector_t pf_pdf_gaussian_sample(pf_pdf_gaussian_t *pdf)
Definition:
pf_pdf.c:114
gmcl
Author(s): Mhd Ali Alshikh Khalil, adler1994@gmail.com
autogenerated on Wed Mar 2 2022 00:20:14