Main MRPT website > C++ reference for MRPT 1.3.2
octomap_utils.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2015, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 // $Id: octomap_utils.h 401 2012-08-03 15:16:39Z ahornung $
10 
11 /**
12 * OctoMap:
13 * A probabilistic, flexible, and compact 3D mapping library for robotic systems.
14 * @author K. M. Wurm, A. Hornung, University of Freiburg, Copyright (C) 2009.
15 * @see http://octomap.sourceforge.net/
16 * License: New BSD License
17 */
18 
19 /*
20  * Copyright (c) 2009, K. M. Wurm, A. Hornung, University of Freiburg
21  * All rights reserved.
22  *
23  * Redistribution and use in source and binary forms, with or without
24  * modification, are permitted provided that the following conditions are met:
25  *
26  * * Redistributions of source code must retain the above copyright
27  * notice, this list of conditions and the following disclaimer.
28  * * Redistributions in binary form must reproduce the above copyright
29  * notice, this list of conditions and the following disclaimer in the
30  * documentation and/or other materials provided with the distribution.
31  * * Neither the name of the University of Freiburg nor the names of its
32  * contributors may be used to endorse or promote products derived from
33  * this software without specific prior written permission.
34  *
35  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
36  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
38  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
39  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
40  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
41  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
42  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
43  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
44  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45  * POSSIBILITY OF SUCH DAMAGE.
46  */
47 
48 #ifndef OCTOMAP_UTILS_H_
49 #define OCTOMAP_UTILS_H_
50 
51 #include <math.h>
52 
53 namespace octomap{
54 
55  /// compute log-odds from probability:
56  inline float logodds(double probability){
57  return (float) log(probability/(1-probability));
58  }
59 
60  /// compute probability from logodds:
61  inline double probability(double logodds){
62  return 1. - ( 1. / (1. + exp(logodds)));
63 
64  }
65 }
66 
67 
68 
69 #endif /* OCTOMAP_UTILS_H_ */
OctoMap: A probabilistic, flexible, and compact 3D mapping library for robotic systems.
double probability(double logodds)
compute probability from logodds:
Definition: octomap_utils.h:61
float logodds(double probability)
compute log-odds from probability:
Definition: octomap_utils.h:56



Page generated by Doxygen 1.8.9.1 for MRPT 1.3.2 SVN:Unversioned directory at Thu Dec 10 00:07:55 UTC 2015